|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gate.creole.AbstractVisualResource
gate.gui.docview.DocumentEditor
@CreoleResource(name="Document Editor", guiType=LARGE, resourceDisplayed="gate.Document", mainViewer=true) public class DocumentEditor
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. Contains a search dialog and an option menu
button.
Nested Class Summary | |
---|---|
protected class |
DocumentEditor.SearchAction
Dialog to search an expression in the document. |
protected class |
DocumentEditor.SearchDialog
|
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.BaselineResizeBehavior, 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<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
|
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<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? |
Methods inherited from class gate.creole.AbstractVisualResource |
---|
getFeatures, getInitParameterValues, getParameterValue, setFeatures, setHandle, setParameterValue, setParameterValues |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
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 |
---|
protected 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.CENTRAL
protected List<DocumentView> verticalViews
DocumentView
objects of type
DocumentView.VERTICAL
protected List<DocumentView> horizontalViews
DocumentView
objects of type
DocumentView.HORIZONTAL
protected 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
Constructor Detail |
---|
public DocumentEditor()
Method Detail |
---|
public void saveSettings()
public void restoreSettings()
public List getActions()
getActions
in interface ActionsPublisher
List
of Action
s.public Resource init() throws ResourceInstantiationException
AbstractVisualResource
init
in interface Resource
init
in class AbstractVisualResource
ResourceInstantiationException
public void cleanup()
AbstractVisualResource
cleanup
in interface Resource
cleanup
in class AbstractVisualResource
protected 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)
AbstractVisualResource
setTarget
in interface VisualResource
setTarget
in class AbstractVisualResource
target
- 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |