org.annotation.wordfreak.viewer
Interface ViewerListener

All Superinterfaces:
ChooserListener
All Known Implementing Classes:
AnnotationScheme

public interface ViewerListener
extends ChooserListener

Describes the callbacks that an object listening to a Viewer must handle.

See Also:
Viewer

Method Summary
 java.lang.String[] getValuesForFeature(java.lang.String f)
          Returns the set of valid values for the specified feature.
 boolean linkAnnotation(Annotation source, Annotation target, int modifiers)
          Requests that the specified source annotation be linked to the specified target annotation given the modifiers.
 boolean moveAnnotation(Annotation child, Annotation newParent, Annotation oldParent)
          Requests that the specified child annotation be moved form the specified old parent to the specified new parent.
 void reloadFiles(java.lang.String encoding)
          Requests that all loaded files be reloaded using the specified encoding or the default encoding is the specified encoding is null.
 void selectCurrentAnnotation()
          Requests that the current annotation be selected.
 void setSelection(AnnotationSelection anns)
          Requests that the specified annotation selection should be set as the current selection.
 void setSelection(AnnotationSelection anns, boolean validate)
          Requests that the specified annotation selection should be set as the current selection and adjusted if the specified validate condition is true.
 void setSelectionEnd(int offset)
          Specifies that a selection is being made which ends at the specified offset.
 void setSelectionStart(int offset)
          Specifies that a selection is being made which starts at the specified offset.
 
Methods inherited from interface org.annotation.wordfreak.chooser.ChooserListener
down, next, nextFile, nextOutcome, prev, prevFile, prevOutcome, set, set, set, set, setAnnotation, up
 

Method Detail

linkAnnotation

public boolean linkAnnotation(Annotation source,
                              Annotation target,
                              int modifiers)
Requests that the specified source annotation be linked to the specified target annotation given the modifiers. This behavior can be used for arbitray actions in viewers which involve two annotations. Currently it is used for annotating traces in ConstituentAnnotaitonScheme.

Parameters:
source - The source annotation.
target - The target annotation.
modifiers - The modifiers selected when this action was taken.
Returns:
true if the operation wsa successful, false otherwise.

moveAnnotation

public boolean moveAnnotation(Annotation child,
                              Annotation newParent,
                              Annotation oldParent)
Requests that the specified child annotation be moved form the specified old parent to the specified new parent.

Parameters:
child - The annotation to be moved.
newParent - The parent under which the specified child should be placed.
oldParent - The previous parent.
Returns:
true if the move was successful, false otherwise.

reloadFiles

public void reloadFiles(java.lang.String encoding)
Requests that all loaded files be reloaded using the specified encoding or the default encoding is the specified encoding is null.

Parameters:
encoding - The encoding which should be used to reload the files.

setSelection

public void setSelection(AnnotationSelection anns)
Requests that the specified annotation selection should be set as the current selection. The selection will be adjusted to ensure that only a valid selection is made.

Parameters:
anns - The annotations to be selected.

setSelection

public void setSelection(AnnotationSelection anns,
                         boolean validate)
Requests that the specified annotation selection should be set as the current selection and adjusted if the specified validate condition is true.

Parameters:
anns - The annotations to be selected.
validate - Whether the annotaitons should be adjusted to be a valid selection.

setSelectionStart

public void setSelectionStart(int offset)
Specifies that a selection is being made which starts at the specified offset.

Parameters:
offset - The start of the selection.

setSelectionEnd

public void setSelectionEnd(int offset)
Specifies that a selection is being made which ends at the specified offset. This method is continually called as a selection is being extended.

Parameters:
offset - The end of the selection.

getValuesForFeature

public java.lang.String[] getValuesForFeature(java.lang.String f)
Returns the set of valid values for the specified feature. Typically this is only valid for the type feature.

Parameters:
f - The feature whose value are being requested.
Returns:
An array containing the valid values for the specified feature or null if the specified feature does not have a fixed set of values.

selectCurrentAnnotation

public void selectCurrentAnnotation()
Requests that the current annotation be selected.



Copyright © 2004 Thomas Morton and Jeremy LaCivita. All Rights Reserved.