public abstract class SequenceViewerExtension extends Object
getComponent()) which can be positioned below or adjacent to the main sequence viewer display or within annotation or statistics controlsgetStatistics)getToolbarActions())SequenceViewerExtension.Factory#createSequenceViewerExtension(DocumentViewer, com.biomatters.geneious.publicapi.documents.AnnotatedPluginDocument[], PropertyRetrieverAndEditor)| Modifier and Type | Class and Description |
|---|---|
static class |
SequenceViewerExtension.ComponentLocation
A location in the sequence viewer for the component returned from
createComponent() specified
by getComponentLocation() |
static class |
SequenceViewerExtension.Factory
A type of plugin for creating extensions to the sequence viewer returned from
GeneiousPlugin.getSequenceViewerExtensionFactories() |
static class |
SequenceViewerExtension.PropertyRetrieverAndEditor
Provides methods for querying the sequence viewer about the status of various things and
for requesting that the sequence viewer change its state.
|
static class |
SequenceViewerExtension.SequenceAnnotationWrapper
Wraps a
SequenceAnnotation and provides extra information about the location (sequence, track) of the annotation. |
static class |
SequenceViewerExtension.StatisticsFactory
A convenience Factory for creating statistics.
|
static class |
SequenceViewerExtension.StatisticsSection
One or more lines of statistics that show up in the statistics section of the sequence viewer.
|
| Constructor and Description |
|---|
SequenceViewerExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentLocationChangedListener(SimpleListener listener)
Adds a listener to be notified when the value returned from
getComponentLocation() changes |
void |
addComponentPositionActions(GeneiousActionToolbar toolbar,
SequenceViewerExtension.ComponentLocation... locations)
Adds little buttons to a toolbar to control the location (see
getComponentLocation()) of the component (see getComponent()) in the sequence viewer. |
void |
addComponentPositionPopInOrOutAction(GeneiousActionToolbar toolbar,
SequenceViewerExtension.ComponentLocation inLocation,
SequenceViewerExtension.ComponentLocation outLocation)
Adds a little button to the toolbar to control the location (see
getComponentLocation()) of the component (see getComponent()) in the sequence viewer. |
protected JComponent |
createComponent() |
JComponent |
getComponent() |
boolean |
getComponentFillAvailableSpace() |
SequenceViewerExtension.ComponentLocation |
getComponentLocation() |
SequenceViewerExtension.ComponentLocation |
getDefaultComponentLocation() |
ExtendedPrintable |
getExtendedPrintable()
Returns an ExtendedPrintable which describes how this extension should be printed.
|
abstract String |
getName() |
List<SequenceViewerExtension.StatisticsSection> |
getStatistics(SequenceViewerExtension.PropertyRetrieverAndEditor propertyRetriever,
ProgressListener progressListener)
Generates one or more sections of statistics to be displayed in the statistics controls section.
|
List<GeneiousAction> |
getToolbarActions()
Get a list of other actions associated with extension which will be displayed in the sequence viewer toolbar.
|
String |
getUniqueId() |
void |
setComponentLocation(SequenceViewerExtension.ComponentLocation location)
Sets the current location for this component.
|
public abstract String getName()
public List<SequenceViewerExtension.StatisticsSection> getStatistics(SequenceViewerExtension.PropertyRetrieverAndEditor propertyRetriever, ProgressListener progressListener)
SequenceViewerExtension.StatisticsFactory which is a simpler API
for plugins which just provide statistics.propertyRetriever - for obtaining properties about the current state of the sequence viewer. The implementation should take the selection (available via getSelectionForStatistics) into accountprogressListener - for reporting progress and checking if statistics should be cancelled. It is important that an implementation cancel promptly or it can hang the sequence viewer when the user tries to edit.public SequenceViewerExtension.ComponentLocation getDefaultComponentLocation()
createComponent() will be displayed at. The user can choose to customize the location if
addComponentPositionActions
or
addComponentPositionPopInOrOutAction
is used.public boolean getComponentFillAvailableSpace()
getComponent() should expand to fill all available spacepublic final SequenceViewerExtension.ComponentLocation getComponentLocation()
createComponent() will be displayed at.
The user can choose to customize the location if
addComponentPositionActions
or
addComponentPositionPopInOrOutAction
is used. Alternatively the extension can create its own controls to manage this itselfpublic void addComponentLocationChangedListener(SimpleListener listener)
getComponentLocation() changeslistener - the listener to be notifiedpublic void setComponentLocation(SequenceViewerExtension.ComponentLocation location)
location - the current location for this component.public void addComponentPositionActions(GeneiousActionToolbar toolbar, SequenceViewerExtension.ComponentLocation... locations)
getComponentLocation()) of the component (see getComponent()) in the sequence viewer.
Consider using addComponentPositionPopInOrOutAction
instead if you want your component to have only 2 possible locations.toolbar - the toolbar to add buttons tolocations - possible locations for this component.addComponentPositionPopInOrOutAction(com.biomatters.geneious.publicapi.components.GeneiousActionToolbar, com.biomatters.geneious.publicapi.plugin.SequenceViewerExtension.ComponentLocation, com.biomatters.geneious.publicapi.plugin.SequenceViewerExtension.ComponentLocation)public void addComponentPositionPopInOrOutAction(GeneiousActionToolbar toolbar, SequenceViewerExtension.ComponentLocation inLocation, SequenceViewerExtension.ComponentLocation outLocation)
getComponentLocation()) of the component (see getComponent()) in the sequence viewer.toolbar - the toolbar to add buttons toinLocation - the location of this component when it is popped in. Either SequenceViewerExtension.ComponentLocation.AnnotationControls or SequenceViewerExtension.ComponentLocation.StatisticsControlsoutLocation - the location of this component with it is popped out. Either SequenceViewerExtension.ComponentLocation.AdjacentToControls or SequenceViewerExtension.ComponentLocation.BelowSequenceVieweraddComponentPositionActions(com.biomatters.geneious.publicapi.components.GeneiousActionToolbar, com.biomatters.geneious.publicapi.plugin.SequenceViewerExtension.ComponentLocation...)public List<GeneiousAction> getToolbarActions()
GeneiousActionOptions.setToolbarPosition(double)
The default implementation returns an empty list.ActionProvider.getOtherActions()public String getUniqueId()
protected JComponent createComponent()
getComponentLocation(). May be null for no component.public final JComponent getComponent()
createComponent(), caching it so that createComponent() is only called once.public ExtendedPrintable getExtendedPrintable()
getComponent() in an ExtendedPrintable using ExtendedPrintable.Factory.createExtendedPrintable(javax.swing.JComponent)