public abstract class AbstractDocumentView extends AbstractResource implements DocumentView
DocumentView
that
can be extended by implementers of document views.
An implementation of a document view that extends this class will need to
provide implementations for the three abstract methods:
initGUI()
, registerHooks()
and unregisterHooks()
.Modifier and Type | Field and Description |
---|---|
protected boolean |
active
Stores the active state of this view.
|
protected Document |
document
The document this view displays.
|
protected boolean |
guiInitialised
Has the UI been initialised yet?
|
protected Handle |
handle
Stores the handle of this view.
|
protected DocumentEditor |
owner
The
DocumentEditor this view is part of. |
name
features
CENTRAL, HORIZONTAL, VERTICAL
Constructor and Description |
---|
AbstractDocumentView() |
Modifier and Type | Method and Description |
---|---|
List<Action> |
getActions()
Returns a list of Action objects.
|
Document |
getDocument()
Gets the document this view displays.
|
Handle |
getHandle() |
DocumentEditor |
getOwner() |
protected abstract void |
initGUI()
Implementers should override this method and use it for populating the GUI.
|
boolean |
isActive()
Returns the active state of this view.
|
protected abstract void |
registerHooks()
This method will be called whenever the view becomes active.
|
void |
setActive(boolean active)
Notifies this view that it has become active or inactive.
|
void |
setHandle(Handle handle)
Used by the main GUI to tell this VR what handle created it.
|
void |
setOwner(DocumentEditor editor)
Stores the owner of this view into the
owner field. |
void |
setSelectedAnnotations(List<AnnotationData> selectedAnnots)
Some document views can use the concept of selected annotations.
|
void |
setTarget(Object target)
|
protected abstract void |
unregisterHooks()
This method will be called whenever this view becomes inactive.
|
checkParameterValues, cleanup, flushBeanInfoCache, forgetBeanInfo, getBeanInfo, getInitParameterValues, getInitParameterValues, getName, getParameterValue, getParameterValue, getParameterValues, init, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners, toString
getFeatures, setFeatures
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getGUI, getType
targetReinitialised
cleanup, getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
protected boolean active
protected Handle handle
protected boolean guiInitialised
protected Document document
protected DocumentEditor owner
DocumentEditor
this view is part of.public void setActive(boolean active)
setActive
in interface DocumentView
active
- a boolean value.public boolean isActive()
isActive
in interface DocumentView
public void setSelectedAnnotations(List<AnnotationData> selectedAnnots)
DocumentView
DocumentEditor.setSelectedAnnotations(List)
method.setSelectedAnnotations
in interface DocumentView
public List<Action> getActions()
ActionsPublisher
getActions
in interface ActionsPublisher
List
of Action
s.public void setHandle(Handle handle)
VisualResource
setHandle
in interface VisualResource
public void setTarget(Object target)
setTarget
in interface VisualResource
target
- the object (be it a Resource
,
DataStore
or whatever) this viewer has to displaypublic void setOwner(DocumentEditor editor)
owner
field. The owner is
the DocumentEditor
this view is part of.setOwner
in interface DocumentView
editor
- the DocumentEditor
that contains this view.public Handle getHandle()
public DocumentEditor getOwner()
protected abstract void initGUI()
protected abstract void registerHooks()
protected abstract void unregisterHooks()
registerHooks()
.Copyright © 2024 GATE. All rights reserved.