edu.uchsc.ccp.knowtator.ui
Class KnowtatorTextPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JEditorPane
javax.swing.JTextPane
edu.uchsc.ccp.knowtator.ui.KnowtatorTextPane
- All Implemented Interfaces:
- AnnotationCreatedListener, RefreshAnnotationsDisplayListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, Scrollable
public class KnowtatorTextPane
- extends JTextPane
- implements RefreshAnnotationsDisplayListener, AnnotationCreatedListener
- See Also:
- Serialized Form
Methods inherited from class javax.swing.JTextPane |
addStyle, createDefaultEditorKit, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, 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, getStream, getText, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setContentType, setEditorKitForContentType, setPage, setPage |
Methods inherited from class javax.swing.text.JTextComponent |
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, 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, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, 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, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
NO_LINES
public static final int NO_LINES
- See Also:
- Constant Field Values
SOLID_LINES
public static final int SOLID_LINES
- See Also:
- Constant Field Values
DASHED_LINES
public static final int DASHED_LINES
- See Also:
- Constant Field Values
VERTICAL_LINES
public static final int VERTICAL_LINES
- See Also:
- Constant Field Values
KnowtatorTextPane
public KnowtatorTextPane(KnowtatorManager manager)
annotationCreated
public void annotationCreated(AnnotationCreatedEvent event)
- Specified by:
annotationCreated
in interface AnnotationCreatedListener
refreshAnnotationsDisplay
public void refreshAnnotationsDisplay(boolean scrollToSelection)
- Specified by:
refreshAnnotationsDisplay
in interface RefreshAnnotationsDisplayListener
- Parameters:
scrollToSelection
- this was added to the interface to solve a scrolling problem.
Essentially, when you scroll using a scroll bar, you do not
want to enforce that the selected annotation remain visible -
otherwise refreshing the annotations will cause the scroll bar
to go right back to the selected annotation immediately after
it is scrolled out of view.- See Also:
TextViewer.initialize()
,
KnowtatorManager.refreshAnnotationsDisplay(boolean)
repaint
public void repaint()
- Overrides:
repaint
in class Component
highlightSpans
public void highlightSpans(boolean scrollToSelection)
setScrollPane
public void setScrollPane(JScrollPane scrollPane)
setAnnotationUtil
public void setAnnotationUtil(AnnotationUtil annotationUtil)
setDisplayColors
public void setDisplayColors(DisplayColors displayColors)
updateTokenRegex
public void updateTokenRegex()
select
public void select(int start)
select
public void select(int start,
int end)
- Overrides:
select
in class JTextComponent
select
public void select(Span span)
select
public boolean select(Span span,
boolean isNew)
select
public void select(Collection<Span> spans)
addAnnotationHighlights
public void addAnnotationHighlights(Collection<Span> spans,
Color color,
int lines)
clearHighlights
public void clearHighlights()
hideHighlights
public void hideHighlights()
clearAnnotationHighlights
public void clearAnnotationHighlights()
clearSelectionHighlights
public void clearSelectionHighlights()
showAllHighlights
public void showAllHighlights()
showSelectionHighlights
public void showSelectionHighlights()
showAnnotationHighlights
public void showAnnotationHighlights()
setText
public void setText(String text)
- Overrides:
setText
in class JEditorPane
highlightAnnotationTemp
public void highlightAnnotationTemp(SimpleInstance annotation)
- written to provide a way for AnnotationPicker and AnnotationSchemaTree
context menu to temporarily highlight an annotation.
- Parameters:
annotation
- - See Also:
AnnotationPicker.mouseMoved(MouseEvent)
highlightSelectedInstance
public void highlightSelectedInstance(SimpleInstance selectedAnnotation,
boolean scrollToSelection)
throws InvalidSpanException
- Throws:
InvalidSpanException
highlightSpans
public void highlightSpans(SimpleInstance selectedAnnotation,
List<SimpleInstance> annotations,
boolean scrollToSelection)
throws InvalidSpanException
- Throws:
InvalidSpanException