|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsynoptic.base.Plugin
public class Plugin
This is the base class for JSynoptic plugins
Field Summary | |
---|---|
static int |
EXPORT
|
static int |
IMPORT
|
static int |
OPEN
|
static int |
SAVE
|
Constructor Summary | |
---|---|
Plugin()
|
Method Summary | |
---|---|
java.lang.String |
about()
The information returned here will be displayed in the about box. |
static void |
addPluginHashMap(java.util.HashMap pluginHashMap)
|
AbstractShape |
createShape(java.lang.String name,
DiagramComponent diagram)
The plugin is asked to create a new shape for one of the name it provided with getShapes(). |
DataSource |
createSource(java.lang.String name,
java.lang.String instanceName)
The plugin is asked to create a new source from one of the templates it declared with getSources(). |
void |
exit()
Some plugins need a particular treatment during Jsynoptic closing For instance when an external process was created in a plugin, it needs to be destroyed |
java.lang.Object[][] |
getDataSourceIcons()
Source factory: this plugin may bring its own data sources with its own icons to display them in the source panel |
javax.swing.filechooser.FileFilter[] |
getFileFilters(int action)
Give the plugin an occasion to add its file filters. |
HelpNode |
getHelp()
Help factory: this plugin may bring its own help which will be displayed into JSynoptic help contents. |
javax.swing.JComponent |
getOptionPanelForFilter(javax.swing.filechooser.FileFilter filter)
Enables a plugin to show an option panel when the user selects a file using one of the plugin file filters. |
static java.lang.String |
getShapeName(java.lang.Class c)
|
java.lang.String[] |
getShapes()
Shape factory: this plugin may bring its own shapes to put in the shape list. |
java.util.HashMap |
getShapesMap()
Get a map that links the plugin shapes classes with the corresponding shapes names. |
java.lang.String[] |
getSources()
Source factory: this plugin may bring its own source templates to put in the predefined sources list. |
Template[] |
getTemplates()
Template factory: this plugin may bring templates to put in the template list. |
static Plugin |
load(java.lang.String className)
|
void |
newComponent(java.awt.Component c)
Deprecated. replaced by getTemplates() |
void |
newDesktopComponent(DesktopCardPanel c)
Give the plugin an occasion to work at desktop initialisation |
void |
newSourceComponent(javax.swing.JTabbedPane c)
Deprecated. replaced by newSourceComponent(NamedElementContainer) |
void |
newSourceComponent(NamedElementContainer c)
Give the plugin an occasion to work at source panel initialisation |
boolean |
processDataSourceCollection(DataSourceCollection dsc,
java.lang.String actionType)
Given the plugin the possibility to apply some changes on all loaded data sources |
boolean |
processFile(java.io.File f,
int action)
See getFileFilters for usage description. |
boolean |
processSynoptic(ShapesContainer sc,
java.lang.String actionType,
boolean background)
Given the plugin the possibility to apply some changes on a given synoptic |
void |
setMenu(javax.swing.JMenuBar mb)
Give the plugin an occasion to add its menus |
void |
setMenu(java.lang.Object mb)
Give the plugin an occasion to add its menus |
void |
setToolBarItem(javax.swing.JToolBar tb)
Give the plugin an occasion to add its toolbar items |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int OPEN
public static final int SAVE
public static final int IMPORT
public static final int EXPORT
Constructor Detail |
---|
public Plugin()
Method Detail |
---|
public static Plugin load(java.lang.String className)
public static void addPluginHashMap(java.util.HashMap pluginHashMap)
public static java.lang.String getShapeName(java.lang.Class c)
public void setMenu(javax.swing.JMenuBar mb)
mb
- The menubar in which to add menus. Typically, the plugin is
expected to call tb.add on each of its menus, and should add
MenuListeners on them too.public void setMenu(java.lang.Object mb)
mb
- The menubar in which to add menus. Typically, the plugin is
expected to call tb.add on each of its menus, and should add
MenuListeners on them too.public void setToolBarItem(javax.swing.JToolBar tb)
tb
- The toolbar in which to add items. Typically, the plugin is
expected to call tb.add on each of its items, and should add
ActionListeners on them too.public void newComponent(java.awt.Component c)
c
- he new Componentpublic void newDesktopComponent(DesktopCardPanel c)
c
- The desktoppublic void newSourceComponent(NamedElementContainer c)
c
- The sources containerpublic void newSourceComponent(javax.swing.JTabbedPane c)
c
- The sources containerpublic javax.swing.filechooser.FileFilter[] getFileFilters(int action)
action
- What to do with the file. Currently OPEN or SAVE.
public boolean processFile(java.io.File f, int action)
f
- The file to processaction
- What to do with the file. Currently OPEN or SAVE.
public boolean processSynoptic(ShapesContainer sc, java.lang.String actionType, boolean background)
sc
- The synoptic to processactionType
- Kind of action to apply to the synopticbackground
- If true, run transformation in another thread
public boolean processDataSourceCollection(DataSourceCollection dsc, java.lang.String actionType)
dsc
- The data source collection to processactionType
- Kind of action to apply to data source collection
public java.lang.String[] getShapes()
public Template[] getTemplates()
public java.util.HashMap getShapesMap()
public AbstractShape createShape(java.lang.String name, DiagramComponent diagram)
name
- The name of the shape to create.diagram
- The diagram this shape will be inserted into.public javax.swing.JComponent getOptionPanelForFilter(javax.swing.filechooser.FileFilter filter)
filter
-
public java.lang.String about()
public java.lang.String[] getSources()
getShapes()
public DataSource createSource(java.lang.String name, java.lang.String instanceName)
name
- The name of the source template.instanceName
- The desired name of the source created from this template.
public java.lang.Object[][] getDataSourceIcons()
public void exit()
public HelpNode getHelp()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |