GATE
Version 3.1-2270

gate.gui.docview
Class DocumentEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by gate.creole.AbstractVisualResource
                      extended by gate.gui.docview.DocumentEditor
All Implemented Interfaces:
ActionsPublisher, Resource, FeatureBearer, NameBearer, VisualResource, ImageObserver, MenuContainer, Serializable, Accessible

public class DocumentEditor
extends AbstractVisualResource
implements ActionsPublisher

This is the GATE Document viewer/editor. This class is only the shell of the main document VR, which gets populated with views (objects that implement the DocumentView interface.

See Also:
Serialized Form

Nested Class Summary
protected  class DocumentEditor.ViewButton
           
 
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.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
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 centralViews
          A list of DocumentView objects of type DocumentView.CENTRAL
protected  Document document
           
protected  JSplitPane horizontalSplit
           
protected  List horizontalViews
          A list of DocumentView objects of type DocumentView.HORIZONTAL
protected  int rightViewIdx
          The index in verticalViews of the currently active right view.
protected  JToolBar topBar
           
protected  JSplitPane topSplit
           
protected  int topViewIdx
          The index in horizontalViews of the currently active top view.
protected  List verticalViews
          A list of DocumentView objects of type DocumentView.VERTICAL
protected  boolean viewsInited
           
 
Fields inherited from class gate.creole.AbstractVisualResource
features, handle
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
DocumentEditor()
           
 
Method Summary
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 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 getCentralViews()
           
 List getHorizontalViews()
           
protected  DocumentView getRightView()
          Gets the currently showing right view
protected  DocumentView getTopView()
          Gets the currently showing top view
 List getVerticalViews()
           
 Resource init()
          Initialise this resource, and return it.
protected  void initViews()
           
protected  void setBottomView(DocumentView view)
          Sets a new UI component in the top location.
protected  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.
protected  void setCentralView(int index)
          Shows a new central view based on an index in the centralViews list.
protected  void setRightView(DocumentView view)
          Sets a new UI component in the right hand side location.
protected  void setRightView(int index)
          Shows a new right view based on an index in the verticalViews list.
 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.
protected  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)
           
 
Methods inherited from class gate.creole.AbstractVisualResource
getFeatures, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues
 
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, 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, 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, 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, transferFocusBackward, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

horizontalSplit

protected JSplitPane horizontalSplit

topSplit

protected JSplitPane topSplit

bottomSplit

protected JSplitPane bottomSplit

topBar

protected JToolBar topBar

document

protected Document document

centralViews

protected List centralViews
A list of DocumentView objects of type DocumentView.CENTRAL


verticalViews

protected List verticalViews
A list of DocumentView objects of type DocumentView.VERTICAL


horizontalViews

protected List horizontalViews
A list of DocumentView objects of type DocumentView.HORIZONTAL


centralViewIdx

protected int centralViewIdx
The index in centralViews of the currently active central view. -1 if none is active.


rightViewIdx

protected int rightViewIdx
The index in verticalViews of the currently active right view. -1 if none is active.


topViewIdx

protected int topViewIdx
The index in horizontalViews of the currently active top view. -1 if none is active.


bottomViewIdx

protected int bottomViewIdx
The index in horizontalViews of the currently active bottom view. -1 if none is active.


viewsInited

protected boolean viewsInited
Constructor Detail

DocumentEditor

public DocumentEditor()
Method Detail

getActions

public List getActions()
The document view is just an empty shell. This method publishes the actions from the contained views.

Specified by:
getActions in interface ActionsPublisher
Returns:
a List of Actions.

init

public Resource init()
              throws ResourceInstantiationException
Description copied from class: AbstractVisualResource
Initialise this resource, and return it.

Specified by:
init in interface Resource
Overrides:
init in class AbstractVisualResource
Throws:
ResourceInstantiationException

cleanup

public void cleanup()
Description copied from class: AbstractVisualResource
Does nothing now, but meant to clear all internal data

Specified by:
cleanup in interface Resource
Overrides:
cleanup in class AbstractVisualResource

initViews

protected void initViews()

getCentralViews

public List getCentralViews()

getHorizontalViews

public List getHorizontalViews()

getVerticalViews

public List getVerticalViews()

addView

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.

Parameters:
view -

getTopView

protected DocumentView getTopView()
Gets the currently showing top view

Returns:
a DocumentView object.

setTopView

protected void setTopView(int index)
Shows a new top view based on an index in the horizontalViews list.

Parameters:
index - the index in horizontalViews list for the new view to be shown.

setTopView

protected void setTopView(DocumentView view)
Sets a new UI component in the top location. This method is intended to only be called from setTopView(int).

Parameters:
view - the new view to be shown.

getCentralView

protected DocumentView getCentralView()
Gets the currently showing central view

Returns:
a DocumentView object.

setCentralView

protected void setCentralView(int index)
Shows a new central view based on an index in the centralViews list.

Parameters:
index - the index in centralViews list for the new view to be shown.

setCentralView

protected void setCentralView(DocumentView view)
Sets a new UI component in the central location. This method is intended to only be called from setCentralView(int).

Parameters:
view - the new view to be shown.

getBottomView

protected DocumentView getBottomView()
Gets the currently showing bottom view

Returns:
a DocumentView object.

setBottomView

protected void setBottomView(int index)
Shows a new bottom view based on an index in the horizontalViews list.

Parameters:
index - the index in horizontalViews list for the new view to be shown.

setBottomView

protected void setBottomView(DocumentView view)
Sets a new UI component in the top location. This method is intended to only be called from setBottomView(int).

Parameters:
view - the new view to be shown.

getRightView

protected DocumentView getRightView()
Gets the currently showing right view

Returns:
a DocumentView object.

setRightView

protected void setRightView(int index)
Shows a new right view based on an index in the verticalViews list.

Parameters:
index - the index in verticalViews list for the new view to be shown.

setRightView

protected void setRightView(DocumentView view)
Sets a new UI component in the right hand side location. This method is intended to only be called from setRightView(int).

Parameters:
view - the new view to be shown.

updateSplitLocation

protected void updateSplitLocation(JSplitPane split,
                                   int foo)

setTarget

public void setTarget(Object target)
Description copied from class: AbstractVisualResource
Called by the GUI when this viewer/editor has to initialise itself for a specific object.

Specified by:
setTarget in interface VisualResource
Overrides:
setTarget in class AbstractVisualResource
Parameters:
target - the object (be it a Resource, DataStore or whatever) this viewer has to display

updateBar

protected void updateBar(JToolBar toolbar)
Updates the selected state of the buttons on one of the toolbars.

Parameters:
toolbar -

GATE
Version 3.1-2270