net.sourceforge.nite.gui.transcriptionviewer
Class NTranscriptionView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JEditorPane
                      extended by javax.swing.JTextPane
                          extended by net.sourceforge.nite.gui.textviewer.NTextArea
                              extended by net.sourceforge.nite.gui.transcriptionviewer.NTranscriptionView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable, QueryResultHandler, SimpleQueryResultHandler, ScrollingTimeHandler, TimeHandler

public class NTranscriptionView
extends NTextArea

NTranscriptionView is a text pane used for customizable display of annotated speech transcripts, also providing flexible selection behaviour.

NTranscriptionView is one of the core classes in the transcriptionviewer package. It has been created to display speech transcriptions from a corpus of interactions, display extra information annotated on these transcriptions (e.g. dialogue acts or adjacency pairs) and provide a variety of GUI interface methods for selecting transcriptions and/or annotations.

The documentation of this class is grouped in three subjects: what is displyed; how will it be displayed; what selection mechanisms are available. SOMEBODY PLEASE FINISH THIS DOCUMENTATION FOR ME! I'm fed up with it :p When finishing this documentation, take care to link always to the central methods that support a certain functionality, because those methods also contain a lot of detailed documentation

What is displayed?


the transcription layer transLayerName
the segment layer segmentationElementName
the setDisplayedSegments methods setDisplayedSegments(Iterator elements)
the displayAnnotationELements methods (which display only those ann. els for which (part of) the transcription elements are displayed). displayAnnotationElement(NOMElement element)

How will it be displayed?


Transcription: ascending preference: default is text. If attribute name is set, that is used. If delegate is set, that is used. transToTextDelegate
Annotations: Display strategies in combination with TransToAnnoMaps setDisplayStrategy(String annotationElementName, DisplayStrategy ds)

What selection mechanisms are available?


transcription selection (settings!)
annotation element selection (uses transtoannomaps and some extra settings)
selection changed listeners!
Access of selection data thorugh getSelectedAnno and Trans Elements

WISHLIST

Author:
Dennis Reidsma, Natasa Jovanovic, Jonathan Kilgour, Jean Carletta
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int CROSS_SEGMENT_PHRASE
          See wordlevelSelectionType documentation.
static int FIRST_TEXT_SELECT_TYPE
          See wordlevelSelectionType documentation.
static int IN_SEGMENT_PHRASE
          See wordlevelSelectionType documentation.
static int LAST_TEXT_SELECT_TYPE
          See wordlevelSelectionType documentation.
static int MULTIPLE_ANNOTATIONS
          See annotationSelectionGranularity documentation.
static int MULTIPLE_SEGMENTS
          See wordlevelSelectionType documentation.
static int ONE_SEGMENT
          See wordlevelSelectionType documentation.
static int ONE_WORD
          See wordlevelSelectionType documentation.
static int SINGLE_ANNOTATION
          See annotationSelectionGranularity documentation.
 
Fields inherited from class net.sourceforge.nite.gui.textviewer.NTextArea
QUERY_HIGHLIGHTS, SELECTION_HIGHLIGHTS, TIME_HIGHLIGHTS, USER_HIGHLIGHTS
 
Fields inherited from class javax.swing.JEditorPane
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NTranscriptionView()
          Describe all default settings for everything here? (defaulttranstoannomap, default selection settings, etc)
 
Method Summary
 void addTransToAnnoMap(TransToAnnoMap newmap)
          See getTransToAnnoMaps() documentation.
 void clearTransToAnnoMaps()
          See getTransToAnnoMaps() documentation.
 void displayAnnotationElement(NOMElement element)
          The given annotation element is displayed in the appropriate way in the transcription texts.
 void displayAnnotationElements(java.util.Iterator elements)
          See displayAnnotationElement(NOMElement element) documentation
 void displayAnnotationElements(java.util.List elements)
          See displayAnnotationElement(NOMElement element) documentation
 void displayAnnotationElements(java.util.Set elements)
          See displayAnnotationElement(NOMElement element) documentation
 boolean getAllowAnnotationSelect()
          See allowAnnotationSelect documentation
 boolean getAllowMultiAgentSelect()
          See allowMultiAgentSelect documentation.
 boolean getAllowTranscriptSelect()
          See allowTranscriptSelect documentation.
 java.lang.String getSegmentationElementName()
          See the documentation of the method setSegmentationElementName
 java.util.Set getSelectableAnnotationTypes()
          Returns a copy of the selectableAnnotationTypes set.
 boolean getSelectDirectTextRepresentations()
          See setSelectDirectTextRepresentations(boolean) documentation.
 java.util.Set getSelectedAnnoElements()
          See selectedAnnoElements documentation.
 java.util.Set getSelectedTransElements()
          Returns the set of speech transcription nomelements that are currently selected Works always, if selection type is trans-text-selection
 java.util.Set getSelectedTransSegments()
          Returns the set of speech transcription SEGMENTS!!! that are currently selected returns elements from segmenttationLayer works only if selection type is actually transtext+ (segment or multisegment)
 boolean getSelectTranscriptionAncestors()
          See setSelectTranscriptionAncestors(boolean) documentation.
 java.lang.String getTranscriptionAttribute()
          See the documentation of the method setTranscriptionToTextDelegate
 java.util.Set getTranscriptionDescendants(NOMElement nwe)
          Given ANY element, return the NOMElement descendants that are transcripotion elements (descendants in parent - child hierarchy)
 java.lang.String getTranscriptionText(NOMElement nme)
          This method returns the transcript text of a certain transcription element.
 java.lang.String getTransLayerName()
          See the documentation of the method setTransLayerName
 java.util.Set getTransToAnnoMaps()
          Return the TransToAnnoMaps used for determining which annotation elements are selectable through clicking on the text of a transcription element.
 boolean isTranscriptionElement(NOMElement element)
          Returns true iff the given element is a transcription element.
 void newSelection(int dot, int mark)
          Given a click or drag, defined by (dot,mark), update the selection.
 void setAddNewlines(boolean add)
          If true, segments should be separated with newlines.
 void setAllowAnnotationSelect(boolean annoSel)
          See allowAnnotationSelect documentation
 void setAllowMultiAgentSelect(boolean multiagent)
          See allowMultiAgentSelect documentation.
 void setAllowTranscriptSelect(boolean transSel)
          See allowTranscriptSelect documentation.
 void setAnnotationSelectionGranularity(int granularity)
          See annotationSelectionGranularity documentation.
 void setBasicStyle(javax.swing.text.Style newStyle)
          Set the text style used for transcription text.
 void setDisplayedSegments(java.util.Iterator elements)
          This method is used to pass the actual speech transcription text to the NTranscriptionView.
 void setDisplayedSegments(java.util.List elements)
          See setDisplayedSegments(Iterator elements) documentation
 void setDisplayedSegments(java.util.Set elements)
          See setDisplayedSegments(Iterator elements) documentation
 void setDisplayStrategy(java.lang.String annotationElementName, DisplayStrategy ds)
          Administration of DisplayStrategies.
 void setSegmentationElementName(java.lang.String newName)
          The segmentation of the speech transcriptions determines how the transcriptions will be grouped and sorted.
 void setSelectableAnnotationTypes(java.util.Set newset)
          This set determines which annotation elements are selectable.
 void setSelectDirectTextRepresentations(boolean newval)
          If false, it is never possible to select annotation elements through clicking their own text representation.
 void setSelectTranscriptionAncestors(boolean newval)
          If false, it is never possible to select annotation elements through clicking om the text representation of their corresponding transcription elements.
 void setTranscriptionAttribute(java.lang.String newName)
          See the documentation of the method setTranscriptionToTextDelegate
 void setTranscriptionToTextDelegate(TranscriptionToTextDelegate newDelegate)
          There are three ways to determine the text that should be used to represent a certain element tle from the transcription layer.
 void setTransLayerName(java.lang.String newName)
          The core of the display is formed by the actual transcription text.
 void setWordlevelSelectionType(int newType)
          See wordlevelSelectionType documentation.
 void undisplayAnnotationElement(NOMElement element)
          Undisplays element, using displaystrategy.undisplay.
 void undisplayAnnotationElements(java.util.Iterator elements)
          See undisplayAnnotationElements(Iterator elements) documentation
 void undisplayAnnotationElements(java.util.List elements)
          See undisplayAnnotationElements(Iterator elements) documentation
 void undisplayAnnotationElements(java.util.Set elements)
          See undisplayAnnotationElements(Iterator elements) documentation
 
Methods inherited from class net.sourceforge.nite.gui.textviewer.NTextArea
acceptQueryResult, acceptQueryResults, acceptResults, acceptTimeChange, acceptTimeSpanChange, addCaretListener, addElement, addElement, addNTASelectionListener, clear, clearHighlights, clearSelection, getClock, getElementsBetweenTimes, getHighlightedModelElements, getHighlightedNOMElements, getHighlightedTextElements, getMaxTime, getNTextElementAtPoint, getNTextElementAtPosition, getObjectModelElementAtPoint, getObjectModelElementAtPosition, getSelectedElements, getSelectedElementsOrdered, getSelectedNOMElements, getSelectedNOMElementsOrdered, getSelectedTextElements, getSelectionEndPosition, getSelectionStartPosition, getTextElements, gotoDocumentEnd, gotoDocumentStart, insertCopyOfStyle, insertDisplayElement, insertElement, isResultRelevant, newTimeSelection, print, printTextArea, redisplayElement, redisplayElement, redisplayElement, redisplayTextElement, removeDisplayComponent, removeHighlighted, removeNTASelectionListener, removeStyleFromChain, scrollTo, setAutoScroll, setClock, setHighlighted, setHighlighted, setHighlighted, setHighlighted, setHighlighted, setHighlighted, setHighlightingStyle, setQueryHighlightColor, setReplayEnabled, setSelected, setTime, setTimeHighlightColor, setTimeSpan, showTimeSpan
 
Methods inherited from class javax.swing.JTextPane
addStyle, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getUIClassID, insertComponent, insertIcon, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument
 
Methods inherited from class javax.swing.JEditorPane
addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getText, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setContentType, setEditorKitForContentType, setPage, setPage, setText
 
Methods inherited from class javax.swing.text.JTextComponent
addInputMethodListener, addKeymap, copy, cut, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, read, removeCaretListener, removeKeymap, removeNotify, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SINGLE_ANNOTATION

public static final int SINGLE_ANNOTATION
See annotationSelectionGranularity documentation.

See Also:
Constant Field Values

MULTIPLE_ANNOTATIONS

public static final int MULTIPLE_ANNOTATIONS
See annotationSelectionGranularity documentation.

See Also:
Constant Field Values

FIRST_TEXT_SELECT_TYPE

public static final int FIRST_TEXT_SELECT_TYPE
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

ONE_WORD

public static final int ONE_WORD
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

ONE_SEGMENT

public static final int ONE_SEGMENT
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

MULTIPLE_SEGMENTS

public static final int MULTIPLE_SEGMENTS
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

IN_SEGMENT_PHRASE

public static final int IN_SEGMENT_PHRASE
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

CROSS_SEGMENT_PHRASE

public static final int CROSS_SEGMENT_PHRASE
See wordlevelSelectionType documentation.

See Also:
Constant Field Values

LAST_TEXT_SELECT_TYPE

public static final int LAST_TEXT_SELECT_TYPE
See wordlevelSelectionType documentation.

See Also:
Constant Field Values
Constructor Detail

NTranscriptionView

public NTranscriptionView()
Describe all default settings for everything here? (defaulttranstoannomap, default selection settings, etc)

People who use such things can add here some trivial extra constructors that take more arguments, such as selection settings parameters. In that case, don't forget to call this parameterfree constructor!

Method Detail

setSegmentationElementName

public void setSegmentationElementName(java.lang.String newName)
The segmentation of the speech transcriptions determines how the transcriptions will be grouped and sorted.

Usually the transcription should be displayed in `screen lines'. Each line stands for one utterance or dialogue contribution or prosodic `sentence fragment' or something like that. The `screen lines' can be sorted on time, or on dialogue structure, or any other way. [DR: comment: see wishlist on sorting.]

Examples of this segmentation can be utterances, dialogue acts, or simple the segments as have been created in ChannelTrans [ref].

The class NTranscriptionView supposes that this grouping is defined by a layer of segmentation elements that form a non-overlapping segmentation of the speech of the participants (non-overlapping in the sense that each word belongs to at most one segment). The attribute segmentationElementName defines the name of the segmentation elements. In the metadata this is a structural layer with <code name="###"/> having the `word' elements as its children.


getSegmentationElementName

public java.lang.String getSegmentationElementName()
See the documentation of the method setSegmentationElementName


setTransLayerName

public void setTransLayerName(java.lang.String newName)
The core of the display is formed by the actual transcription text. Transcription text is stored in a specific layer of NOMElements with a certain name (in the metadata: <time-aligned-layer name="###"/>).

Since the name "###" can be different for different corpora this name should be stored in the transcriptionViewer.

For documentation on the way in which the transcription elements are actually visualized, please see the overview documentation of this class.


getTransLayerName

public java.lang.String getTransLayerName()
See the documentation of the method setTransLayerName


isTranscriptionElement

public boolean isTranscriptionElement(NOMElement element)
Returns true iff the given element is a transcription element.


setTranscriptionToTextDelegate

public void setTranscriptionToTextDelegate(TranscriptionToTextDelegate newDelegate)
There are three ways to determine the text that should be used to represent a certain element tle from the transcription layer.

The one with the highest precedence is the TranscriptionToTextDelegate. If this parameter is set, the text for element tle is determined by a call to getTextForTranscriptionElement.
The one with the second-highest precedence is the parameter transcriptionAttribute. If there is no TranscriptionToTextDelegate set, and this parameter is non-null, the text for element tle is determined by the value of attribute 'transcriptionAttribute' of that element.
If both above parameters are not set, the text representation of element tle is taken to be the text content of the element.

In order to make the text of a transcription element available independent of these different styles of derivation the method getTranscriptionText(net.sourceforge.nite.nom.nomwrite.NOMElement) is used.


setTranscriptionAttribute

public void setTranscriptionAttribute(java.lang.String newName)
See the documentation of the method setTranscriptionToTextDelegate


getTranscriptionAttribute

public java.lang.String getTranscriptionAttribute()
See the documentation of the method setTranscriptionToTextDelegate


getTranscriptionText

public java.lang.String getTranscriptionText(NOMElement nme)
This method returns the transcript text of a certain transcription element. See transcriptionAttribute for information on how that text is derived.

This method should be used whenever the text content for a certain transcription element is needed.

Parameters:
nme - The NOMElement containing transcription data.
Throws:
java.lang.IllegalArgumentException - If called with wrong TYPE of element (not in transcription layer), an IllegalArgumentException is thrown.
java.util.NoSuchElementException - : If the given element does not contain the right attribute transcriptionAttribute when that attribute is needed, a NoSuchElementException is thrown.

setBasicStyle

public void setBasicStyle(javax.swing.text.Style newStyle)
Set the text style used for transcription text. By default, the transcription text is shown without any special styles. This method allows you to set a style for it.

NB: The style must have been added to the NTranscriptionView!


setAddNewlines

public void setAddNewlines(boolean add)
If true, segments should be separated with newlines.


setDisplayedSegments

public void setDisplayedSegments(java.util.Iterator elements)
This method is used to pass the actual speech transcription text to the NTranscriptionView.

The segments should belong to the correct segment layer (see segmentationElementName), having children or descendants in the transcription layer. The segments will be ordered on their starttime@@See also @link wishlist!!!!!!!!, and displayed one by one in the NTranscriptionView by displaying the text of their transcription elements (see getTranscriptionText(net.sourceforge.nite.nom.nomwrite.NOMElement)).

The segments will be separated by newlines yet if addNewlines is true. If a DisplayStrategy is known for the segment elements it will immediately be invoked for them (see setDisplayStrategy).

See remark in overview about sorting!


setDisplayedSegments

public void setDisplayedSegments(java.util.List elements)
See setDisplayedSegments(Iterator elements) documentation


setDisplayedSegments

public void setDisplayedSegments(java.util.Set elements)
See setDisplayedSegments(Iterator elements) documentation


displayAnnotationElements

public void displayAnnotationElements(java.util.Set elements)
See displayAnnotationElement(NOMElement element) documentation


displayAnnotationElements

public void displayAnnotationElements(java.util.List elements)
See displayAnnotationElement(NOMElement element) documentation


displayAnnotationElements

public void displayAnnotationElements(java.util.Iterator elements)
See displayAnnotationElement(NOMElement element) documentation


displayAnnotationElement

public void displayAnnotationElement(NOMElement element)
The given annotation element is displayed in the appropriate way in the transcription texts. 'The appropriate way' is determined by the display strategies that have been registered for elements of different types.

If already displayed: remove & redisplay!

If, for one of the annotation elements, no display strategy is known, the element is not displayed.

If, for one of the annotation elements, the Transcription fragment to which it pertains is not displayed in the NTranscriptionView, the annotation element will not be added. If at a later time the relevant transcription elements are added, you will have to add these annotation elements again.

Internally administrates fact that this element has been displayed.


undisplayAnnotationElements

public void undisplayAnnotationElements(java.util.Set elements)
See undisplayAnnotationElements(Iterator elements) documentation


undisplayAnnotationElements

public void undisplayAnnotationElements(java.util.List elements)
See undisplayAnnotationElements(Iterator elements) documentation


undisplayAnnotationElements

public void undisplayAnnotationElements(java.util.Iterator elements)
See undisplayAnnotationElements(Iterator elements) documentation


undisplayAnnotationElement

public void undisplayAnnotationElement(NOMElement element)
Undisplays element, using displaystrategy.undisplay. Also updates internal administration


setDisplayStrategy

public void setDisplayStrategy(java.lang.String annotationElementName,
                               DisplayStrategy ds)
Administration of DisplayStrategies.

The central focus of the display in text labelling tools will be the text of the transcriptions. The NTranscriptionViewer will show this text plainly, without styles or extra markup or characters. Elements annotated on this text can be shown in two ways: 1) by changing the style of the corresponding text and 2) by adding extra markup characters such as brackets. It seems natural to associate a specific display style with each element type annotated on the text. The actual displaying of elements is performed by delegates: DisplayStrategy.

setDisplayStrategy(elementname, DisplayStrategy): indicates that the annotation elements with the given name (e.g. ``da'', ``pos'', ``propername'') will be displayed using the given DisplayStrategy object.


setAllowTranscriptSelect

public void setAllowTranscriptSelect(boolean transSel)
See allowTranscriptSelect documentation.

See also the general documentation on selection: newSelection(int, int)


getAllowTranscriptSelect

public boolean getAllowTranscriptSelect()
See allowTranscriptSelect documentation.

See also the general documentation on selection: newSelection(int, int)


setAllowAnnotationSelect

public void setAllowAnnotationSelect(boolean annoSel)
See allowAnnotationSelect documentation

See also the general documentation on selection: newSelection(int, int)


getAllowAnnotationSelect

public boolean getAllowAnnotationSelect()
See allowAnnotationSelect documentation

See also the general documentation on selection: newSelection(int, int)


setAllowMultiAgentSelect

public void setAllowMultiAgentSelect(boolean multiagent)
See allowMultiAgentSelect documentation.

See also the general documentation on selection: newSelection(int, int)


getAllowMultiAgentSelect

public boolean getAllowMultiAgentSelect()
See allowMultiAgentSelect documentation.

See also the general documentation on selection: newSelection(int, int)


newSelection

public void newSelection(int dot,
                         int mark)
Given a click or drag, defined by (dot,mark), update the selection. What has been selected: transcript text, annotation elements, depends on the diverse selection settings. This method also takes care of appropriate highlighting.

NTranscriptionView selection mechanisms

Somebody finish this documentation for me :-) wsetgjiuytfrdcgvnjhuygrdsxgvnjkljhgvfcszdgvnjmk LINK TO APPROPRIATE OTHER PARTS (setselectiontypes enzo)

Overrides:
newSelection in class NTextArea

setAnnotationSelectionGranularity

public void setAnnotationSelectionGranularity(int granularity)
See annotationSelectionGranularity documentation.


setSelectableAnnotationTypes

public void setSelectableAnnotationTypes(java.util.Set newset)
This set determines which annotation elements are selectable. If it is empty, any element that should potentially be selected based on the current user drag/click will be selected. Otherwise only those elements with a type in this set will be selected.


getSelectableAnnotationTypes

public java.util.Set getSelectableAnnotationTypes()
Returns a copy of the selectableAnnotationTypes set. See setSelectableAnnotationTypes(java.util.Set) documentation.


setSelectDirectTextRepresentations

public void setSelectDirectTextRepresentations(boolean newval)
If false, it is never possible to select annotation elements through clicking their own text representation.


getSelectDirectTextRepresentations

public boolean getSelectDirectTextRepresentations()
See setSelectDirectTextRepresentations(boolean) documentation.


setSelectTranscriptionAncestors

public void setSelectTranscriptionAncestors(boolean newval)
If false, it is never possible to select annotation elements through clicking om the text representation of their corresponding transcription elements.


getSelectTranscriptionAncestors

public boolean getSelectTranscriptionAncestors()
See setSelectTranscriptionAncestors(boolean) documentation.


getTransToAnnoMaps

public java.util.Set getTransToAnnoMaps()
Return the TransToAnnoMaps used for determining which annotation elements are selectable through clicking on the text of a transcription element.


clearTransToAnnoMaps

public void clearTransToAnnoMaps()
See getTransToAnnoMaps() documentation.


addTransToAnnoMap

public void addTransToAnnoMap(TransToAnnoMap newmap)
See getTransToAnnoMaps() documentation.


getSelectedAnnoElements

public java.util.Set getSelectedAnnoElements()
See selectedAnnoElements documentation.


setWordlevelSelectionType

public void setWordlevelSelectionType(int newType)
See wordlevelSelectionType documentation.

Throws exception if out of range (see max & min types)


getSelectedTransElements

public java.util.Set getSelectedTransElements()
Returns the set of speech transcription nomelements that are currently selected Works always, if selection type is trans-text-selection


getSelectedTransSegments

public java.util.Set getSelectedTransSegments()
Returns the set of speech transcription SEGMENTS!!! that are currently selected returns elements from segmenttationLayer works only if selection type is actually transtext+ (segment or multisegment)


getTranscriptionDescendants

public java.util.Set getTranscriptionDescendants(NOMElement nwe)
Given ANY element, return the NOMElement descendants that are transcripotion elements (descendants in parent - child hierarchy)