examples.random
Class RandomDataPlugin

java.lang.Object
  extended by jsynoptic.base.Plugin
      extended by examples.random.RandomDataPlugin
All Implemented Interfaces:
DataSourceProvider

public class RandomDataPlugin
extends Plugin
implements DataSourceProvider

This example class can serves as the basis to create your own plugin It creates a random data source collection. See this class The following optional interfaces are implemented as an example. - DataSourceProvider : allows the collection to be serialized correctly.


Field Summary
 
Fields inherited from class jsynoptic.base.Plugin
EXPORT, IMPORT, OPEN, SAVE
 
Constructor Summary
RandomDataPlugin()
          When this plugin is loaded, it adds a random source collection to the application
 
Method Summary
 java.lang.String about()
          Enter your plugin information here.
 java.lang.Object getOptionalInformation(DataSource ds, DataSourceCollection dsc)
          Asks this provider some optional information about a datasource and possibly its collection.
 DataSource provide(java.lang.String id, java.lang.String dscId, java.lang.Object optionalInformation, DataSourcePool pool)
          Asks this provider to resolve a symbolic datasource reference.
 
Methods inherited from class jsynoptic.base.Plugin
addPluginHashMap, createShape, createSource, exit, getDataSourceIcons, getFileFilters, getHelp, getOptionPanelForFilter, getShapeName, getShapes, getShapesMap, getSources, getTemplates, load, newComponent, newDesktopComponent, newSourceComponent, newSourceComponent, processDataSourceCollection, processFile, processSynoptic, setMenu, setMenu, setToolBarItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomDataPlugin

public RandomDataPlugin()
When this plugin is loaded, it adds a random source collection to the application

Method Detail

about

public java.lang.String about()
Enter your plugin information here. This will appear in the about box. Warning : uses HTML... @see jsynoptic.base.Plugin#about()

Overrides:
about in class Plugin
Returns:
the information about this plugin, including authors, license, etc..

getOptionalInformation

public java.lang.Object getOptionalInformation(DataSource ds,
                                               DataSourceCollection dsc)
Asks this provider some optional information about a datasource and possibly its collection.

Specified by:
getOptionalInformation in interface DataSourceProvider
Parameters:
ds - The datasource
dsc - The datasource collection, or null.
Returns:
null if this provider cannot provide optional information, an arbitrary object otherwise.

provide

public DataSource provide(java.lang.String id,
                          java.lang.String dscId,
                          java.lang.Object optionalInformation,
                          DataSourcePool pool)
Asks this provider to resolve a symbolic datasource reference.

Specified by:
provide in interface DataSourceProvider
Parameters:
id - The symbolic id of a datasource
dscId - The symbolic id of a datasourceCollection. May be null
optionalInformation - Can be set to help this provider. May be null
pool - DataSourcePool in which to add the source and collection if they can be provided. May be null.
Returns:
The desired datasource if it can be provided, or null.