public class PlotterPlugin extends org.freehep.application.studio.Plugin implements PlotFactory, PlotterProvider, XMLPluginIO
PlotFactory
and provides plotting service in Jas3.
When the PlotFactory
implemented by this plugin is asked to create a Plotter
,
it looks through all PlotterProvider
s registered with the Jas3 lookup until it
finds a compatible one. This plugin itself registers a provider that can create plotters
(instances of DefaultPlotter
for objects of type JAS3DataSource
.
This plugin also creates an instance of PlotterAdapterLookup
and adds it to the
Jas3 lookup. Registering an adapter with this PlotFactory
adds it to that adapter
lookup. The adapter will not be used directly by this PlotFactory
.
However, it will be accessible to instances of DefaultPlotter
created by it.
Modifier and Type | Class and Description |
---|---|
class |
PlotterPlugin.PlotterCommands |
RESTORE_DATA, RESTORE_DONE, RESTORE_FINALIZE, RESTORE_PAGES, RESTORE_PLOT_DATA_SOURCES, RESTORE_PLOTS_IN_PAGES, RESTORE_TREE_OBJECTS, RESTORE_TREE_STRUCTURE
Constructor and Description |
---|
PlotterPlugin() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCreatePlotterFor(Class dataType)
Tests if can create a plotter for the given data type.
|
boolean |
canCreatePlotterFor(Class[] dataType)
Tests if can create a plotter for the given data types.
|
Plotter |
create()
Creates a plot.
|
PlotPage |
createPage(String name)
Create a page which can be used to display plots.
|
Plotter |
createPlotterFor(Class dataType)
Returns a plotter which is able to plot the given class of data.
|
Plotter |
createPlotterFor(Class[] dataType)
Returns a plotter which is able to plot all of the given classes of data.
|
PlotPage |
currentPage()
Returns the currently selected plot page, or null if no plot page is currently selected.
|
void |
init() |
List<PlotPage> |
pages()
Returns a list of all plot pages that are showing.
|
protected PlotterAdapterLookup |
plotterAdapterLookup() |
void |
registerAdapter(PlotterAdapter adapter,
Class from,
Class to)
Registers the specified adapter with the
PlotterAdapterLookup maintained
by this plugin. |
int |
restore(int level,
org.freehep.xml.io.XMLIOManager manager,
org.jdom.Element el)
level is the level at which the restore should be performed.
|
void |
save(org.freehep.xml.io.XMLIOManager manager,
org.jdom.Element el) |
boolean |
supports(Class klass)
Returns true if the specified type is supported by plots created by this provider.
|
public void init() throws SAXException, IOException
init
in class org.freehep.application.studio.Plugin
SAXException
IOException
protected PlotterAdapterLookup plotterAdapterLookup()
public PlotPage createPage(String name)
PlotFactory
createPage
in interface PlotFactory
name
- The name of the page, or null for a default name.public Plotter createPlotterFor(Class dataType)
PlotFactory
createPlotterFor
in interface PlotFactory
public Plotter createPlotterFor(Class[] dataType)
PlotFactory
createPlotterFor
in interface PlotFactory
public boolean canCreatePlotterFor(Class dataType)
PlotFactory
canCreatePlotterFor
in interface PlotFactory
public boolean canCreatePlotterFor(Class[] dataType)
PlotFactory
canCreatePlotterFor
in interface PlotFactory
public PlotPage currentPage()
PlotFactory
currentPage
in interface PlotFactory
public void registerAdapter(PlotterAdapter adapter, Class from, Class to)
PlotterAdapterLookup
maintained
by this plugin. The adapter will not be used directly by the PlotFactory
implemented by this plugin. However, it will be accessible to instances of
DefaultPlotter
created by it.registerAdapter
in interface PlotFactory
adapter
- The PlotterAdapter.from
- The class of the objects that can be converted.to
- The class to which the objects can be converted.public List<PlotPage> pages()
PlotFactory
pages
in interface PlotFactory
public Plotter create()
PlotterProvider
create
in interface PlotterProvider
public boolean supports(Class klass)
PlotterProvider
supports
in interface PlotterProvider
public int restore(int level, org.freehep.xml.io.XMLIOManager manager, org.jdom.Element el)
XMLPluginIO
restore
in interface XMLPluginIO
public void save(org.freehep.xml.io.XMLIOManager manager, org.jdom.Element el)
save
in interface XMLPluginIO
Copyright © 2016. All rights reserved.