@CreoleResource(name="Document Editor", guiType=LARGE, resourceDisplayed="gate.Document", mainViewer=true) public class DocumentEditor extends AbstractVisualResource implements ActionsPublisher
DocumentView interface. Contains a search dialog and an option menu
button.| Modifier and Type | Class and Description |
|---|---|
protected class |
DocumentEditor.SearchAction
Dialog to search an expression in the document.
|
protected class |
DocumentEditor.SearchDialog |
protected class |
DocumentEditor.ViewButton |
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected JSplitPane |
bottomSplit |
protected int |
bottomViewIdx
The index in
horizontalViews of the currently active bottom view. |
protected int |
centralViewIdx
The index in
centralViews of the currently active central view. |
protected List<DocumentView> |
centralViews
A list of
DocumentView objects of type DocumentView.CENTRAL |
protected Document |
document |
protected int |
fKeyNumber
Used to know the last F-key used when adding a new view.
|
protected JSplitPane |
horizontalSplit |
protected List<DocumentView> |
horizontalViews
A list of
DocumentView objects of type
DocumentView.HORIZONTAL |
protected int |
rightViewIdx
The index in
verticalViews of the currently active right view. |
protected Action |
searchAction |
protected JToolBar |
topBar |
protected JSplitPane |
topSplit |
protected int |
topViewIdx
The index in
horizontalViews of the currently active top view. |
protected List<DocumentView> |
verticalViews
A list of
DocumentView objects of type
DocumentView.VERTICAL |
protected boolean |
viewsInited |
features, handlelistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
DocumentEditor() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addView(DocumentView view,
String name)
Registers a new view by adding it to the right list and creating the
activation button for it.
|
void |
cleanup()
Does nothing now, but meant to clear all internal data
|
List<Action> |
getActions()
The document view is just an empty shell.
|
protected DocumentView |
getBottomView()
Gets the currently showing bottom view
|
protected DocumentView |
getCentralView()
Gets the currently showing central view
|
List<DocumentView> |
getCentralViews() |
List<DocumentView> |
getHorizontalViews() |
protected DocumentView |
getRightView()
Gets the currently showing right view
|
List<AnnotationData> |
getSelectedAnnotations()
Gets the current set of selected annotations.
|
protected JTextComponent |
getTextComponent() |
protected DocumentView |
getTopView()
Gets the currently showing top view
|
List<DocumentView> |
getVerticalViews() |
Resource |
init()
Initialise this resource, and return it.
|
protected void |
initViews() |
void |
restoreSettings()
Restore the layout of the views and selected annotations.
|
void |
saveSettings()
Save the layout of the views and selected annotations.
|
protected void |
setBottomView(DocumentView view)
Sets a new UI component in the top location.
|
void |
setBottomView(int index)
Shows a new bottom view based on an index in the
horizontalViews
list. |
protected void |
setCentralView(DocumentView view)
Sets a new UI component in the central location.
|
void |
setCentralView(int index)
Shows a new central view based on an index in the
centralViews
list. |
void |
setEditable(boolean editable)
Set the document as editable or readonly.
|
void |
setRightToLeftOrientation(boolean set)
Set the text orientation in the document.
|
protected void |
setRightView(DocumentView view)
Sets a new UI component in the right hand side location.
|
void |
setRightView(int index)
Shows a new right view based on an index in the
verticalViews
list. |
void |
setSelectedAnnotations(List<AnnotationData> selectedAnnots)
Change the set of selected annotations.
|
void |
setTarget(Object target)
Called by the GUI when this viewer/editor has to initialise itself for a
specific object.
|
protected void |
setTopView(DocumentView view)
Sets a new UI component in the top location.
|
void |
setTopView(int index)
Shows a new top view based on an index in the
horizontalViews
list. |
protected void |
updateBar(JToolBar toolbar)
Updates the selected state of the buttons on one of the toolbars.
|
protected void |
updateSplitLocation(JSplitPane split,
int foo)
TODO: to remove? doesn't seems to be used anywhere.
|
getFeatures, getInitParameterValues, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValuesgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, updateadd, 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, validateTreeaction, 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, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittargetReinitialisedgetName, setNameprotected JSplitPane horizontalSplit
protected JSplitPane topSplit
protected JSplitPane bottomSplit
protected Action searchAction
protected JToolBar topBar
protected Document document
protected List<DocumentView> centralViews
DocumentView objects of type DocumentView.CENTRALprotected List<DocumentView> verticalViews
DocumentView objects of type
DocumentView.VERTICALprotected List<DocumentView> horizontalViews
DocumentView objects of type
DocumentView.HORIZONTALprotected int centralViewIdx
centralViews of the currently active central view.
-1 if none is active.protected int rightViewIdx
verticalViews of the currently active right view.
-1 if none is active.protected int topViewIdx
horizontalViews of the currently active top view.
-1 if none is active.protected int bottomViewIdx
horizontalViews of the currently active bottom view.
-1 if none is active.protected boolean viewsInited
protected int fKeyNumber
public void saveSettings()
public void restoreSettings()
public List<Action> getActions()
getActions in interface ActionsPublisherList of Actions.public Resource init() throws ResourceInstantiationException
AbstractVisualResourceinit in interface Resourceinit in class AbstractVisualResourceResourceInstantiationExceptionpublic void cleanup()
AbstractVisualResourcecleanup in interface Resourcecleanup in class AbstractVisualResourceprotected void initViews()
public List<DocumentView> getCentralViews()
public List<DocumentView> getHorizontalViews()
public List<DocumentView> getVerticalViews()
protected void addView(DocumentView view, String name)
view - view to add to the GUI as a buttonname - name of the view used in the GUI as a button nameprotected DocumentView getTopView()
DocumentView object.public void setTopView(int index)
horizontalViews
list.index - the index in horizontalViews list for the new view to be
shown.protected void setTopView(DocumentView view)
setTopView(int).view - the new view to be shown.protected DocumentView getCentralView()
DocumentView object.public void setCentralView(int index)
centralViews
list.index - the index in centralViews list for the new view to be
shown.protected void setCentralView(DocumentView view)
setCentralView(int).view - the new view to be shown.protected DocumentView getBottomView()
DocumentView object.public void setBottomView(int index)
horizontalViews
list.index - the index in horizontalViews list for the new view to be
shown.protected void setBottomView(DocumentView view)
setBottomView(int).view - the new view to be shown.protected DocumentView getRightView()
DocumentView object.public void setRightView(int index)
verticalViews
list.index - the index in verticalViews list for the new view to be
shown.protected void setRightView(DocumentView view)
setRightView(int).view - the new view to be shown.public void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
selectedAnnots - list of AnnotationData to selectpublic List<AnnotationData> getSelectedAnnotations()
protected void updateSplitLocation(JSplitPane split, int foo)
public void setTarget(Object target)
AbstractVisualResourcesetTarget in interface VisualResourcesetTarget in class AbstractVisualResourcetarget - the object (be it a Resource,
DataStore or whatever) this viewer has to displayprotected void updateBar(JToolBar toolbar)
toolbar - toolbar to updateprotected JTextComponent getTextComponent()
public void setEditable(boolean editable)
editable - true if editable, false if readonlypublic void setRightToLeftOrientation(boolean set)
set - If true, text is displayed from right to left.Copyright © 2024 GATE. All rights reserved.