public abstract class DocumentViewer extends Object
DocumentViewerFactory.createViewer(com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[]).
A plugin may provide a set of DocumentViewerFactories
via GeneiousPlugin.getDocumentViewerFactories().| Modifier and Type | Class and Description |
|---|---|
static class |
DocumentViewer.ViewerLocation
Information about the location of a viewer eg.
|
| Constructor and Description |
|---|
DocumentViewer() |
| Modifier and Type | Method and Description |
|---|---|
ActionProvider |
getActionProvider()
Provide support for this DocumentViewer interacting with
copy/paste etc, or any custom actions.
|
abstract JComponent |
getComponent()
Get the graphical component displayed to the user.
|
ExtendedPrintable |
getExtendedPrintable()
Get an ExtendedPrintable for providing advanced printing
and saving to image support.
|
Findable |
getFindable()
Provide support for this DocumentViewer to interact with the find text dialog
|
DocumentViewerMessageHandler |
getIncomingMessageHandler()
Viewer handling for incoming messages.
|
String |
getName() |
NoLongerViewedListener |
getNoLongerViewedListener()
Used to provide notification to the DocumentViewer when
the user is no longer interested in viewing it.
|
DocumentViewerMessageHandler |
getOutgoingMessageHandler()
Get the outgoing message handler.
|
Printable |
getPrintable()
Get a Printable for handling printing and saving as an image
If
getExtendedPrintable() is implemented and returns a non null value, this method will not be used. |
JComponent |
getPrintableComponent()
Returns the component that Geneious should print (if not the component returned by
getComponent(). |
void |
setEditingEnabled(boolean isEditingEnabled,
String reasonDisabled)
This method should be overridden if the viewer allows editing of documents.
|
void |
setInSplitLayout(DocumentViewer.ViewerLocation location)
This method can optionally be overridden so the viewer is notified when it becomes part of a split layout (multiple
views on the same document).
|
void |
setOutgoingMessageHandler(DocumentViewerMessageHandler handler)
Set the outgoing message handler.
|
public abstract JComponent getComponent()
public JComponent getPrintableComponent()
getComponent(). This method is only used if getPrintable() and getExtendedPrintable() both return null.getComponent()getPrintable(),
()public Printable getPrintable()
getExtendedPrintable() is implemented and returns a non null value, this method will not be used.getExtendedPrintable(),
getPrintableComponent()public ExtendedPrintable getExtendedPrintable()
getPrintable()
need not be implemented and should not be called.getPrintable(),
getPrintableComponent()public Findable getFindable()
public ActionProvider getActionProvider()
public NoLongerViewedListener getNoLongerViewedListener()
public DocumentViewerMessageHandler getIncomingMessageHandler()
DocumentViewerMessageHandler.handleMessage(org.jdom.Element, String, boolean)
will be called whenever a message is received from any other viewer.
See DocumentViewerMessageHandler
for a description of what this means.public final void setOutgoingMessageHandler(DocumentViewerMessageHandler handler)
getOutgoingMessageHandler()
to send outgoing messages.
See DocumentViewerMessageHandler
for a description of what this means.handler - - viewer may send messages using handler.handleMessage()public DocumentViewerMessageHandler getOutgoingMessageHandler()
DocumentViewerMessageHandler.handleMessage(org.jdom.Element, String, boolean)
to send a message to all other viewers.
See DocumentViewerMessageHandler
for a description of what this means.public void setEditingEnabled(boolean isEditingEnabled,
String reasonDisabled)
isEditingEnabled - false to prevent the user editing in the viewerreasonDisabled - a message describing why editing has been disabled. Will be displayed to the user if they
try to edit. Can be an HTML fragment. May only be null if isEditingEnabled is true.public void setInSplitLayout(DocumentViewer.ViewerLocation location)
isBesideAnotherViewer is true then the side options panel should be collapsed.layoutPositionIdentifier can be used as a preference prefix for this purpose.
location - contains information about the location of the viewer in the split layout.public String getName()
DocumentViewerFactory.getName()DocumentViewerFactory.getName()