Package org.apache.uima.tools.viewer
Class CasAnnotationViewer
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.apache.uima.tools.viewer.CasAnnotationViewer
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
A Swing component that displays annotations in a text pane with highlighting. There is also a
tree view for display details of annotations on which the user clicks. This class extends
JPanel
and so can be reused within any Swing application.
To launch the viewer, call the setCAS(CAS)
method with the CAS to be viewed.
The viewer is configurable via the following methods:
setConsistentColors(boolean)
- if set to true (default), the color assigned to any annotation type will be the same across all documents. If set to false, colors may vary across documents.setDisplayedTypes(String[])
- specifies a set of types that will be highlighted in the viewer's text pane.setHiddenTypes(String[])
- specifies a set of types that will NOT be highlighted in the viewer's text pane.setHiddenFeatures(String[])
- specifies a set of features that will never shown in the viewer's annotation details tree.setHighFrequencyTypes(String[])
- this can be used to specify a set of types that occur frequently. These types will the be assigned the most distinguishable colors.setInitiallySelectedTypes(String[])
- this can be used to specify a set of types that will initially be selected (i.e. have their checkboxes checked) in the viewer. The default is for all types to be initially selected.setRightToLeftTextOrientation(boolean)
- switches the text pane from left-to-right (default) to right-to-left mode. This is needed to support languages such as Arabic and Hebrew, which are read from right to left.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
class
Trivial entity resolver that's applied if the user turns on entity mode without specifying their own entity resolver.private static class
Inner class containing data for a tree node representing a FeatureStructureprivate static class
Inner class containing data for a tree node representing a Typeprivate static class
A panel that is to be placed in a JScrollPane that can only scroll vertically.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JRadioButton
private String[]
private int[]
private static final float
private CAS
private static final Color[]
private static String[]
private JScrollPane
private JRadioButton
private EntityResolver
private Map
<EntityResolver.Entity, JCheckBox> private JRadioButton
private Map
<String, JRadioButton> private JScrollPane
private JScrollPane
private Type
private boolean
private JSplitPane
private static final short
private static final short
private static final short
private JTree
private DefaultTreeModel
private static final long
private JButton
private JComboBox
private JPanel
private Type
private JTabbedPane
private JTextPane
private JScrollPane
private JScrollPane
private Map
<Type, JRadioButton> private JScrollPane
private TypeSystem
private boolean
private JSplitPane
private short
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a CAS Annotation Viewer.CasAnnotationViewer
(boolean aEntityViewEnabled) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAnnotationToTree
(AnnotationFS aAnnotation) Adds an annotation to the selected annotations tree.private void
private void
addFeatureTreeNodes
(DefaultMutableTreeNode aParentNode, FeatureStructure aFS) private void
private void
private void
void
applyBoldfaceToKeywords
(String[] aWords) Causes the specified words to appear in boldface wherever they occur in the document.void
applyBoldfaceToSpans
(int[] aSpans) Causes the specified spans to appear in boldface.void
assignCheckedFromList
(List<String> aNotChecked) Assign initially checked to the specified types, pairing up down the listsvoid
assignColorsFromList
(List<Color> aColors, List<String> aTypeNames) Assign colors to the specified types, pairing up down the listsprivate void
assignTypeColors
(List<String> aTypeNames) Assign colors to the specified typesprivate static String
checkString
(String stringValue, String defaultIfNull, int maxLength) Check if a string is null or longer than specified limit.void
Configures the viewer appropriately for displaying a hit against an XML fragments query.void
configureViewForXmlFragmentsQuery
(String aQuery, String aTypeNamespace) Configures the viewer appropriately for displaying a hit against an XML fragments query.private void
private JPanel
private JButton
private void
private void
private void
private void
private void
private void
private JButton
private JPanel
private void
private void
private void
private void
private JTabbedPane
private void
private JPanel
private void
private void
private void
private JPanel
private JPanel
private void
display()
Creates/updates the display.private void
Creates the annotation display.private void
Creates the entity display.private void
Create/update the feature view.private void
Applies boldface as per the mBoldfaceKeywords and mBoldfaceSpans fields.private void
private void
private String
getFeatureValueInString
(FeatureStructure aFS, Feature feature) Get feature value in string, if value is not another annotation and not an array of annotations.protected JTree
Gets the selected annotation tree component.private void
private boolean
isMatch
(Annotation annotation) Check if an annotation matches the filters set by the user.private void
processOneAnnotationInAnnotationView
(StyledDocument doc, AnnotationFS annotation) private void
processOneAnnotationInEntityView
(StyledDocument doc, Annotation annotation) private boolean
processOneAnnotationInFeatureView
(StyledDocument doc, Annotation annotation, boolean firstType) Examine an annotation and add type/feature/value-related controls if necessary.private boolean
processOneFeature
(StyledDocument doc, Annotation annotation, Feature feature, boolean firstFeature) Examine one feature of the given annotation and create the feature-related controls.private boolean
processOneFeatureValue
(StyledDocument doc, Annotation annotation, Feature feature) Examine one feature of the given annotation and create the feature-value-related controls.private void
reset()
private void
private void
private void
private void
private void
Re-populate the tabbed pane's tabs depending on the current view mode.private void
private void
private void
void
Sets the CAS to be viewed.void
setConsistentColors
(boolean aConsistent) Sets whether colors will be consistent in all documents viewed using this viewer.void
setDisplayedTypes
(String[] aDisplayedTypeNames) Set the list of types that will be highlighted in the viewer.void
setEntityResolver
(EntityResolver aEntityResolver) Sets theEntityResolver
to use when the viewer is in entity mode.void
setHiddenFeatures
(String[] aFeatureNames) Configures the viewer to hide certain features in the annotation deatail pane.void
setHiddenTypes
(String[] aTypeNames) Set the list of types that will NOT be highlighted in the viewer.void
setHideUnselectedCheckboxes
(boolean aHideUnselected) Sets whether unselected (unchecked) checkboxes will be hidden entirely from the legend.void
setHighFrequencyTypes
(String[] aTypeNames) Set the list of types that occur most frequently.void
setInitiallySelectedTypes
(String[] aTypeNames) Configures the initially selected types in the viewer.void
setRightToLeftTextOrientation
(boolean aRightToLeft) Sets the text orientation.void
void
setUserTypes
(List<String> userTypes) private static boolean
typeNamesContains
(Set<String> names, String name) Does wildcard matching to determine if a give type name is "contained" in a Set of type names.private void
updateSelectedAnnotationTree
(int aPosition) Refreshes the selected annotation tree.private static boolean
wildCardMatch
(String name, String pattern) Helper forinvalid reference
#typeNamesContains(HashSet, String)
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
MODE_ANNOTATIONS
private static final short MODE_ANNOTATIONS- See Also:
-
MODE_ENTITIES
private static final short MODE_ENTITIES- See Also:
-
MODE_FEATURES
private static final short MODE_FEATURES- See Also:
-
DEFAULT_HIDDEN_FEATURES
-
BRIGHT
private static final float BRIGHT- See Also:
-
COLORS
-
cas
-
typeSystem
-
stringType
-
fsArrayType
-
useConsistentColors
private boolean useConsistentColors -
highFrequencyTypes
-
boldFaceKeyWords
-
boldFaceSpans
private int[] boldFaceSpans -
displayedTypeNames
-
initiallySelectedTypeNames
-
hideUnselectedCheckBoxes
private boolean hideUnselectedCheckBoxes -
userTypes
-
typesNotChecked
-
typeColorMap
-
featureColorMap
-
entityResolver
-
viewMode
private short viewMode -
typeToCheckBoxMap
-
entityToCheckBoxMap
-
horizontalSplitPane
-
verticalSplitPane
-
textPane
-
textScrollPane
-
typeRadioButtonMap
-
featureRadioButtonMap
-
featureValueCheckBoxMap
-
featureValueColorMap
-
showHideUnselectedButton
-
selectedAnnotationTree
-
selectedAnnotationTreeModel
-
annotationModeButton
-
entityModeButton
-
featureModeButton
-
sofaSelectionPanel
-
sofaSelectionComboBox
-
tabbedChoicePane
-
typeCheckBoxScrollPane
-
typeCheckBoxVerticalScrollPanel
-
entityCheckBoxScrollPane
-
entityCheckBoxVerticalScrollPanel
-
typeRadioButtonScrollPane
-
typeRadioButtonVerticalScrollPanel
-
featureRadioButtonScrollPane
-
featureRadioButtonVerticalScrollPanel
-
featureValueCheckBoxScrollPane
-
featureValueCheckBoxVerticalScrollPanel
-
-
Constructor Details
-
CasAnnotationViewer
public CasAnnotationViewer()Creates a CAS Annotation Viewer. -
CasAnnotationViewer
Deprecated.use the zero-argument constructor and callinvalid reference
#setEntityViewEnabled(boolean)
-
-
Method Details
-
createControlPanel
-
createSelectButtonPanel
-
createViewPanel
-
createViewModePanel
-
createFeatureModeButton
private void createFeatureModeButton() -
createEntityModeButton
private void createEntityModeButton() -
createAnnotationModeButton
private void createAnnotationModeButton() -
createSofaSelectionPanel
private void createSofaSelectionPanel() -
createSofaSelectionComboBox
private void createSofaSelectionComboBox() -
createShowHideUnselectedButton
private void createShowHideUnselectedButton() -
createDeselectAllButton
-
createSelectAllButton
-
resetTabbedPane
private void resetTabbedPane()Re-populate the tabbed pane's tabs depending on the current view mode. -
createHorizontalSplitPane
private void createHorizontalSplitPane() -
createTreePanel
-
createSelectedAnnotationTree
private void createSelectedAnnotationTree() -
createVerticalSplitPane
private void createVerticalSplitPane() -
createTabbedChoicePane
-
createFeatureValueCheckBoxPane
private void createFeatureValueCheckBoxPane() -
createFeatureRadioButtonPane
private void createFeatureRadioButtonPane() -
createTypeRadioButtonPane
private void createTypeRadioButtonPane() -
createEntityCheckBoxPane
private void createEntityCheckBoxPane() -
createTypeCheckBoxPane
private void createTypeCheckBoxPane() -
createTextScrollPane
private void createTextScrollPane() -
getUserTypes
- Returns:
- Returns the userTypes.
-
setUserTypes
- Parameters:
userTypes
- The userTypes to set.
-
setHighFrequencyTypes
Set the list of types that occur most frequently. This method assigns the most distinguishable colors to these types.- Parameters:
aTypeNames
- names of types that are occur frequently. Ideally these should be ordered by frequency, with the most frequent being first.
-
setDisplayedTypes
Set the list of types that will be highlighted in the viewer. Types not in this list will not appear in the legend and will never be highlighted. If this method is not called, the default is to show all types in the CAS (except those specifically hidden by a call tosetHiddenTypes(String[])
.- Parameters:
aDisplayedTypeNames
- names of types that are to be highlighted. Null indicates that all types in the CAS should be highlighted.
-
setHiddenTypes
Set the list of types that will NOT be highlighted in the viewer.- Parameters:
aTypeNames
- names of types that are never to be highlighted.
-
setInitiallySelectedTypes
Configures the initially selected types in the viewer. If not called, all types will be initially selected.- Parameters:
aTypeNames
- array of fully-qualified names of types to be initially selected
-
setHiddenFeatures
Configures the viewer to hide certain features in the annotation deatail pane.- Parameters:
aFeatureNames
- array of (short) feature names to be hidden
-
setEntityResolver
Sets theEntityResolver
to use when the viewer is in entity mode. Entity mode must be turned on using theinvalid reference
#setEntityViewEnabled(boolean)
- Parameters:
aEntityResolver
- user-supplied class that can determine which annotations correspond to the same entity.
-
setConsistentColors
public void setConsistentColors(boolean aConsistent) Sets whether colors will be consistent in all documents viewed using this viewer. If set to true, assignments of color to annotation type will persist across documents; if false, colors will be reassigned in each new document. (Note that if high frequency types are set viasetHighFrequencyTypes(String[])
, the colors for those types will always be consistent, regardless of the value passed to this method.- Parameters:
aConsistent
- true (the default) causes colors to be consistent across documents, false allows them to vary
-
setRightToLeftTextOrientation
public void setRightToLeftTextOrientation(boolean aRightToLeft) Sets the text orientation. The default is left-to-right, but needs to be set to right-to-left to properly display some languages, most notably Arabic and Hebrew.- Parameters:
aRightToLeft
- true to put the viewer in right-to-left mode, false for left-to-right (the default).
-
setHideUnselectedCheckboxes
public void setHideUnselectedCheckboxes(boolean aHideUnselected) Sets whether unselected (unchecked) checkboxes will be hidden entirely from the legend. This mode makes for a cleaner legend at the expense of making it more difficult to toggle which types are selected. There's also a button in the GUI that lets the user change this setting.- Parameters:
aHideUnselected
-
-
setCAS
Sets the CAS to be viewed. This must be called beforedisplay()
.- Parameters:
aCAS
- the CSA to be viewed
-
initializeSofaSelectionPanel
private void initializeSofaSelectionPanel() -
reset
private void reset() -
resetSelectedAnnotationTree
private void resetSelectedAnnotationTree() -
resetEntityCheckBoxPanel
private void resetEntityCheckBoxPanel() -
resetTypeCheckBoxPanel
private void resetTypeCheckBoxPanel() -
resetFeatureValuePanel
private void resetFeatureValuePanel() -
resetFeaturePanel
private void resetFeaturePanel() -
resetTypeRadioButtonPanel
private void resetTypeRadioButtonPanel() -
resetTypeColorMap
private void resetTypeColorMap() -
applyBoldfaceToKeywords
Causes the specified words to appear in boldface wherever they occur in the document. This is case-insensitive. Call this method aftersetCAS(CAS)
. It wil apply only to the current document, and will be reset on the next call tosetCAS(CAS)
.- Parameters:
aWords
- array of words to highlight in boldface.
-
applyBoldfaceToSpans
public void applyBoldfaceToSpans(int[] aSpans) Causes the specified spans to appear in boldface. This is case-insensitive. Call this method aftersetCAS(CAS)
. It wil apply only to the current document, and will be reset on the next call tosetCAS(CAS)
.- Parameters:
aSpans
- spans to appear in boldface (begin1, end1, begin2, end2, ...)
-
configureViewForXmlFragmentsQuery
Configures the viewer appropriately for displaying a hit against an XML fragments query. This does not use a sophisticated algorithm for determining the location of the document that matched the query. Currently all it does is callsetInitiallySelectedTypes(String[])
with the list of types mentioned in the query andapplyBoldfaceToKeywords(String[])
on any keywords mentioned in the query.- Parameters:
aQuery
- an XML fragments queryaTypeNamespace
- namespace to prepend to the element names in the query in order to form fully-qualified CAS type names. This is optional; if not specified, type namespaces are ignored and any type whose local name matches the query will be selected.
-
configureViewForXmlFragmentsQuery
Configures the viewer appropriately for displaying a hit against an XML fragments query. This does not use a sophisticated algorithm for determining the location of the document that matched the query. Currently all it does is callsetInitiallySelectedTypes(String[])
with the list of types mentioned in the query andapplyBoldfaceToKeywords(String[])
on any keywords mentioned in the query.- Parameters:
aQuery
- an XML fragments query
-
assignCheckedFromList
Assign initially checked to the specified types, pairing up down the lists- Parameters:
aNotChecked
- list of types not to be initially checked JMP
-
assignColorsFromList
Assign colors to the specified types, pairing up down the lists- Parameters:
aColors
- list of colorsaTypeNames
- list of type names JMP
-
assignTypeColors
Assign colors to the specified types- Parameters:
aTypeNames
- list of type names
-
display
private void display()Creates/updates the display. This is called when setCAS() is called and again each time to user's mode or checkbox selections change. -
displayFeatureView
private void displayFeatureView()Create/update the feature view. -
addFeatureValueCheckBoxes
private void addFeatureValueCheckBoxes() -
addFeatureRadioButtons
private void addFeatureRadioButtons() -
addTypeRadioButtons
private void addTypeRadioButtons() -
processOneAnnotationInFeatureView
private boolean processOneAnnotationInFeatureView(StyledDocument doc, Annotation annotation, boolean firstType) Examine an annotation and add type/feature/value-related controls if necessary.- Parameters:
doc
-annotation
-firstType
- If true, the annotation being examined has the first type-related radio button that needs to be created and also set as selected.- Returns:
- If true, the annotation being examined has its type being selected, its feature-related radio buttons being displayed and one of its features being selected, and the feature's value is selected. So that the next annotation of different type will not have its features being displayed in the control panel.
-
processOneFeature
private boolean processOneFeature(StyledDocument doc, Annotation annotation, Feature feature, boolean firstFeature) Examine one feature of the given annotation and create the feature-related controls.- Parameters:
doc
-annotation
-feature
-firstFeature
-- Returns:
-
processOneFeatureValue
Examine one feature of the given annotation and create the feature-value-related controls.- Parameters:
doc
-annotation
-feature
-- Returns:
-
displayAnnotationView
private void displayAnnotationView()Creates the annotation display. -
addTypeCheckBoxes
private void addTypeCheckBoxes() -
processOneAnnotationInAnnotationView
-
displayEntityView
private void displayEntityView()Creates the entity display. -
processOneAnnotationInEntityView
-
updateSelectedAnnotationTree
private void updateSelectedAnnotationTree(int aPosition) Refreshes the selected annotation tree.- Parameters:
aPosition
- the currently selected offset into the document. All annotations overlapping this point will be rendered in the tree.
-
isMatch
Check if an annotation matches the filters set by the user. If true, the annotation will be added to the annotation tree display panel.- Parameters:
annotation
-- Returns:
-
addAnnotationToTree
Adds an annotation to the selected annotations tree. Annotations in the tree are grouped by type.- Parameters:
aAnnotation
- the annotation to add
-
addFeatureTreeNodes
-
getFeatureValueInString
Get feature value in string, if value is not another annotation and not an array of annotations.- Parameters:
aFS
-feature
-- Returns:
-
checkString
Check if a string is null or longer than specified limit. If null, use default value. If longer than specified limit, take only the leading substring that would fit in the limit.- Parameters:
stringValue
-defaultIfNull
-maxLength
-- Returns:
-
typeNamesContains
Does wildcard matching to determine if a give type name is "contained" in a Set of type names.- Parameters:
names
- Type names, which may include wildcards (e.g, uima.tt.*)name
- A type name- Returns:
- True iff name matches a name in type names
-
wildCardMatch
Helper forinvalid reference
#typeNamesContains(HashSet, String)
- Parameters:
name
- A litteral stringpattern
- A string that includes one or more *'s as wildcards- Returns:
- True iff the string matches the pattern.
-
setSize
-
doBoldFace
private void doBoldFace()Applies boldface as per the mBoldfaceKeywords and mBoldfaceSpans fields. -
doBoldFaceBySpans
private void doBoldFaceBySpans() -
doBoldFaceByKeyWords
private void doBoldFaceByKeyWords() -
getSelectedAnnotationTree
Gets the selected annotation tree component.- Returns:
- the tree that displays annotation details about annotations overlapping the point where the user last clicked in the text.
-
invalid reference