|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nite.tools.videolabeler.AnnotationLayer
net.sourceforge.nite.tools.videolabeler.LabelAnnotationLayer
public class LabelAnnotationLayer
In this annotation layer the annotation targets are elements from an
object set or ontology. Each label is assigned its own colour using a
ValueColourMap
. The
element formatter displays the label of an annotation target. The label is
displayed between brackets [] and the text will have the colour that was
assigned to the label.
Constructor Summary | |
---|---|
LabelAnnotationLayer(NLayer layer,
java.lang.String codeName,
java.lang.String panelType,
org.w3c.dom.Node layerInfo)
Constructs a new label annotation layer. |
Method Summary | |
---|---|
void |
createGap(NOMElement annotation,
double startTime,
double endTime)
Splits an annotation, so there will be a gap between the specified start time and end time. |
ValueColourMap |
getColourMap()
Returns a colour map that maps targets (instances of NOMElement ) to
colours. |
java.lang.String |
getLabel(NOMElement annotation)
Returns the label of an annotation in this layer. |
java.lang.String |
getLabelAttribute()
Returns the attribute of an object set or ontology element that contains the label of the annotation target. |
NPointer |
getPointer()
Returns the pointer that points from an annotation to its target. |
java.util.HashMap |
getStyleMap()
Returns a hash map that maps style names to styles. |
NOMElement |
getTarget(NOMElement annotation)
Returns the target of the specified annotation. |
java.lang.String |
getTargetName(NOMElement target)
Returns the label of the specified target element. |
java.lang.String |
getTargetRootID()
Returns the root ID of the target object set or ontology. |
java.util.List |
getTargets()
Returns the possible targets of this layer. |
boolean |
sameTargets(NOMElement elem1,
NOMElement elem2)
Compares two annotations and returns true if they have the same target. |
Methods inherited from class net.sourceforge.nite.tools.videolabeler.AnnotationLayer |
---|
createTargetControlPanel, getCodeElement, getElementFormatter, getNLayer, showAnnotationArea |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LabelAnnotationLayer(NLayer layer, java.lang.String codeName, java.lang.String panelType, org.w3c.dom.Node layerInfo) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.Exception
Constructs a new label annotation layer. The layerInfo parameter is the layerinfo element from the configuration file. It should have the following two attributes:
layer
- the NXT layercodeName
- the name of the code elements that represent annotations
in this layerpanelType
- the qualified class name of the target control panel
that should be used with this layerlayerInfo
- the layerinfo element
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.Exception
Method Detail |
---|
public NPointer getPointer()
Returns the pointer that points from an annotation to its target.
public java.lang.String getLabelAttribute()
Returns the attribute of an object set or ontology element that contains the label of the annotation target.
public java.lang.String getTargetRootID()
Returns the root ID of the target object set or ontology. The ID
consists of the name of the object set or ontology, a # character, and
the ID of the root element of the object set or ontology. If the
targets of this layer are in an ontology, the returned root ID can be
used to create an
OntologyTreeView
.
public ValueColourMap getColourMap()
Returns a colour map that maps targets (instances of
NOMElement
) to
colours.
public java.util.List getTargets()
Returns the possible targets of this layer. This method returns a
list with the elements in the object set or ontology that this layer
points to. The objects in the list are instances of
NOMElement
.
public java.util.HashMap getStyleMap()
Returns a hash map that maps style names to styles.
getStyleMap
in class AnnotationLayer
public java.lang.String getTargetName(NOMElement target)
Returns the label of the specified target element. The target element should have an attribute with the name of the labelattribute specified in the layerinfo element from the configuration file. This method returns the value of that attribute. If there is no such attribute, this method returns null.
public NOMElement getTarget(NOMElement annotation)
Returns the target of the specified annotation. If the annotation does not have a target or the target could not be retrieved, this method returns null.
public java.lang.String getLabel(NOMElement annotation)
Returns the label of an annotation in this layer. If the label could not be retrieved, this method returns null.
getLabel
in class AnnotationLayer
annotation
- an annotation in this layer
public void createGap(NOMElement annotation, double startTime, double endTime) throws java.lang.Exception
Splits an annotation, so there will be a gap between the specified start time and end time. The specified annotation must start before the start time and it must end after the end time.
createGap
in class AnnotationLayer
annotation
- the annotation that will be splitstartTime
- the time where the gap will startendTime
- the time where the gap will end
java.lang.Exception
- if an error occurspublic boolean sameTargets(NOMElement elem1, NOMElement elem2)
Compares two annotations and returns true if they have the same target. If the two annotations are adjacent, it means they can be merged into one annotation.
sameTargets
in class AnnotationLayer
elem1
- the first annotationelem2
- the second annotation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |