|
Gridarta Editor
|
Model for plugins. More...
Inheritance diagram for net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| void | addParameter (@NotNull final PluginParameter< G, A, R, ?> pluginParameter) |
| Adds a plugin parameter to this plugin. More... | |
| void | addPluginListener (@NotNull final PluginListener listener) |
| Adds a PluginListener to be notified about changes. More... | |
| Plugin< G, A, R > | clonePlugin () |
| Returns a clone copy of this plugin. More... | |
| void | convertType (@NotNull final PluginParameter< G, A, R, ?> pluginParameter, @NotNull final String newType) throws NoSuchParameterException |
| Changes the type of a plugin parameter. More... | |
| String | getCode () |
| Returns the executable code of this plugin. More... | |
| File | getFile () |
| Returns the location to save this plugin to. More... | |
| String | getName () |
| Returns the name of this plugin. More... | |
| int | getParameter (@NotNull final String parameterName) |
| Returns the index for a plugin parameter name. More... | |
| PluginParameter< G, A, R, ?> | getParameter (final int index) throws NoSuchParameterException |
| Returns the PluginParameter at a given index. More... | |
| Filter<?, ?> | getPluginAsFilter (@NotNull final PluginParameters pluginParameters) |
| boolean | hasParameters () |
| Returns whether this plugin has at least one parameter. More... | |
| boolean | isAutoBoot () |
| Returns whether this plugin is run whenever the editor starts. More... | |
| boolean | isFilter () |
| Returns whether this plugin is a filter. More... | |
| boolean | isModified () |
| Returns whether the plugin contents have been modified since last save. More... | |
| boolean | isScript () |
| Returns whether this plugin is a stand-alone plugin. More... | |
| Iterator< PluginParameter< G, A, R, ?> > | iterator () |
| void | newParameter () |
| Creates a new plugin parameter. More... | |
| Plugin (@NotNull final String name, @NotNull final PluginParameterFactory< G, A, R > pluginParameterFactory) | |
| Creates a new instance. More... | |
| void | removeParameter (final int index) |
| Removes a plugin parameter. More... | |
| void | removePluginListener (@NotNull final PluginListener listener) |
| Removes a PluginListener to be notified about changes. More... | |
| void | resetModified () |
| Marks the plugin as unmodified since last save. More... | |
| void | runPlugin (@NotNull final PluginParameters pluginParameters) |
| void | setAutoBoot (final boolean autoBoot) |
| Sets whether this plugin is run whenever the editor starts. More... | |
| void | setCode (@NotNull final String code) |
| Sets the executable code of this plugin. More... | |
| void | setFile (@Nullable final File file) |
| Sets the location to save this plugin to. More... | |
| void | setFilter (final boolean filter) |
| Sets whether this plugin is a filter. More... | |
| void | setScript (final boolean script) |
| Sets whether this plugin is a stand-alone plugin. More... | |
| String | toString () |
| Node | toXML (@NotNull final PluginParameter< G, A, R, ?> pluginParameter) |
| Returns XML representation for a PluginParameter. More... | |
Private Member Functions | |
| void | notifyParametersChangedListeners () |
| Notifies all registered PluginListeners that the parameters have changed. More... | |
| void | setModified () |
| Marks this plugin a modified since last save. More... | |
Private Attributes | |
| boolean | autoBoot |
| Whether this plugin is run whenever the editor starts. More... | |
| String | code = "" |
| The executable code. More... | |
| final PluginParameterCodec< G, A, R > | codec = new PluginParameterCodec<>() |
| The PluginParameterCodec for converting PluginParameters to or from XML representation. More... | |
| File | file |
| The location to save this plugin to; set to. More... | |
| boolean | filter |
| Whether this plugin is a filter. More... | |
| final EventListenerList2< PluginListener > | listeners = new EventListenerList2<>(PluginListener.class) |
| The PluginListeners to inform about changes. More... | |
| boolean | modified |
| Whether the plugin contents has been modified since last save. More... | |
| final String | name |
| The plugin name. More... | |
| final List< PluginParameter< G, A, R, ?> > | parameters = new ArrayList<>() |
| The PluginParameters for this plugin. More... | |
| final PluginParameterFactory< G, A, R > | pluginParameterFactory |
| The PluginParameterFactory for creating plugin parameters. More... | |
| final PluginParameterListener | pluginParameterListener = this::setModified |
| The PluginParameterListener that is attached to all plugin parameters to detect changes. More... | |
| boolean | script |
| Whether this plugin is a stand-alone plugin. More... | |
Static Private Attributes | |
| static final Category | LOG = Logger.getLogger(Plugin.class) |
| The Logger for printing log messages. More... | |
Model for plugins.
Definition at line 52 of file Plugin.java.
| net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.Plugin | ( | @NotNull final String | name, |
| @NotNull final PluginParameterFactory< G, A, R > | pluginParameterFactory | ||
| ) |
Creates a new instance.
| name | the plugin name |
| pluginParameterFactory | the plugin parameter factory for creating plugin parameters |
Definition at line 137 of file Plugin.java.
| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addParameter | ( | @NotNull final PluginParameter< G, A, R, ?> | pluginParameter | ) |
Adds a plugin parameter to this plugin.
| pluginParameter | the plugin parameter to add |
Definition at line 288 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), and net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addPluginListener | ( | @NotNull final PluginListener | listener | ) |
Adds a PluginListener to be notified about changes.
| listener | the change listener |
Definition at line 234 of file Plugin.java.
Here is the caller graph for this function:| Plugin<G, A, R> net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.clonePlugin | ( | ) |
Returns a clone copy of this plugin.
The copy include name, executable code, type and a clone of each parameter. The change listeners are not copied.
Definition at line 263 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginExecutor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.executePlugin(), and net.sf.gridarta.gui.dialog.plugin.PluginController<?, ?, ?>.runPlugin().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.convertType | ( | @NotNull final PluginParameter< G, A, R, ?> | pluginParameter, |
| @NotNull final String | newType | ||
| ) | throws NoSuchParameterException |
Changes the type of a plugin parameter.
| pluginParameter | the plugin parameter |
| newType | the new type |
| NoSuchParameterException | if the index is invalid |
Definition at line 377 of file Plugin.java.
| String net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getCode | ( | ) |
Returns the executable code of this plugin.
Definition at line 156 of file Plugin.java.
Referenced by net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createCode(), and net.sf.gridarta.plugin.BshThread< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.run().
Here is the caller graph for this function:| File net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getFile | ( | ) |
Returns the location to save this plugin to.
Definition at line 418 of file Plugin.java.
| String net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getName | ( | ) |
Returns the name of this plugin.
Definition at line 147 of file Plugin.java.
Referenced by net.sf.gridarta.gui.dialog.plugin.PluginManager< G, A, R >.pluginManagerRemoveScript(), and net.sf.gridarta.gui.dialog.plugin.PluginController<?, ?, ?>.runPlugin().
Here is the caller graph for this function:| int net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getParameter | ( | @NotNull final String | parameterName | ) |
Returns the index for a plugin parameter name.
| parameterName | the plugin parameter name |
Definition at line 186 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginExecutor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.executePlugin(), and net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.pluginEditorRemoveParameter().
Here is the caller graph for this function:| PluginParameter<G, A, R, ?> net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getParameter | ( | final int | index | ) | throws NoSuchParameterException |
Returns the PluginParameter at a given index.
| index | the index of parameter to return; must be between 0 getParametersCount() |
| NoSuchParameterException | if the index is invalid |
Definition at line 302 of file Plugin.java.
| Filter<?, ?> net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getPluginAsFilter | ( | @NotNull final PluginParameters | pluginParameters | ) |
Definition at line 447 of file Plugin.java.
| boolean net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.hasParameters | ( | ) |
Returns whether this plugin has at least one parameter.
Definition at line 177 of file Plugin.java.
| boolean net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isAutoBoot | ( | ) |
Returns whether this plugin is run whenever the editor starts.
Definition at line 315 of file Plugin.java.
Here is the caller graph for this function:| boolean net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isFilter | ( | ) |
Returns whether this plugin is a filter.
Definition at line 331 of file Plugin.java.
Here is the caller graph for this function:| boolean net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isModified | ( | ) |
Returns whether the plugin contents have been modified since last save.
Definition at line 394 of file Plugin.java.
| boolean net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isScript | ( | ) |
Returns whether this plugin is a stand-alone plugin.
Definition at line 323 of file Plugin.java.
Here is the caller graph for this function:| Iterator<PluginParameter<G, A, R, ?> > net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.iterator | ( | ) |
Definition at line 432 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginModel< G, A, R >.getPlugin().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.newParameter | ( | ) |
Creates a new plugin parameter.
Definition at line 206 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.convertType(), and net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.pluginEditorAddParameter().
Here is the caller graph for this function:
|
private |
Notifies all registered PluginListeners that the parameters have changed.
Definition at line 250 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.addParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.convertType(), net.sf.gridarta.plugin.Plugin< G, A, R >.newParameter(), and net.sf.gridarta.plugin.Plugin< G, A, R >.removeParameter().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeParameter | ( | final int | index | ) |
Removes a plugin parameter.
| index | the plugin parameter's index |
Definition at line 224 of file Plugin.java.
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removePluginListener | ( | @NotNull final PluginListener | listener | ) |
Removes a PluginListener to be notified about changes.
| listener | the change listener |
Definition at line 242 of file Plugin.java.
| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resetModified | ( | ) |
Marks the plugin as unmodified since last save.
Definition at line 401 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.runPlugin | ( | @NotNull final PluginParameters | pluginParameters | ) |
Definition at line 436 of file Plugin.java.
| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setAutoBoot | ( | final boolean | autoBoot | ) |
Sets whether this plugin is run whenever the editor starts.
| autoBoot | whether this plugin is run whenever the editor starts |
Definition at line 339 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML(), and net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setPluginEditorIsAutoRun().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setCode | ( | @NotNull final String | code | ) |
Sets the executable code of this plugin.
| code | the executable code of this plugin |
Definition at line 164 of file Plugin.java.
Referenced by net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createCode(), net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML(), and net.sf.gridarta.plugin.PluginModel< G, A, R >.newPlugin().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setFile | ( | @Nullable final File | file | ) |
Sets the location to save this plugin to.
| file | the save location or null |
Definition at line 426 of file Plugin.java.
| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setFilter | ( | final boolean | filter | ) |
Sets whether this plugin is a filter.
| filter | whether this plugin is a filter |
Definition at line 363 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML(), and net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setPluginIsEditorFilter().
Here is the caller graph for this function:
|
private |
Marks this plugin a modified since last save.
Definition at line 408 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.addParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.convertType(), net.sf.gridarta.plugin.Plugin< G, A, R >.newParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.removeParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.setAutoBoot(), net.sf.gridarta.plugin.Plugin< G, A, R >.setCode(), net.sf.gridarta.plugin.Plugin< G, A, R >.setFilter(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setScript().
Here is the caller graph for this function:| void net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setScript | ( | final boolean | script | ) |
Sets whether this plugin is a stand-alone plugin.
| script | whether this plugin is a stand-alone plugin |
Definition at line 351 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.PluginModelParser< G, A, R >.fromXML(), and net.sf.gridarta.gui.dialog.plugin.PluginEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setPluginIsScript().
Here is the caller graph for this function:| String net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.toString | ( | ) |
Definition at line 199 of file Plugin.java.
| Node net.sf.gridarta.plugin.Plugin< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.toXML | ( | @NotNull final PluginParameter< G, A, R, ?> | pluginParameter | ) |
Returns XML representation for a PluginParameter.
| pluginParameter | the plugin parameter |
Definition at line 466 of file Plugin.java.
|
private |
Whether this plugin is run whenever the editor starts.
Definition at line 94 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.isAutoBoot(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setAutoBoot().
|
private |
The executable code.
Definition at line 64 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.getCode(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setCode().
|
private |
The PluginParameterCodec for converting PluginParameters to or from XML representation.
Definition at line 89 of file Plugin.java.
|
private |
The location to save this plugin to; set to.
if the plugin has no associated location.
Definition at line 117 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.getFile(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setFile().
|
private |
Whether this plugin is a filter.
Definition at line 99 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.isFilter(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setFilter().
|
private |
The PluginListeners to inform about changes.
Definition at line 110 of file Plugin.java.
|
staticprivate |
The Logger for printing log messages.
Definition at line 58 of file Plugin.java.
|
private |
Whether the plugin contents has been modified since last save.
Definition at line 122 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.isModified().
|
private |
The plugin name.
Definition at line 76 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.getName(), net.sf.gridarta.plugin.Plugin< G, A, R >.Plugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.toString().
|
private |
The PluginParameters for this plugin.
Definition at line 70 of file Plugin.java.
|
private |
The PluginParameterFactory for creating plugin parameters.
Definition at line 82 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.Plugin().
|
private |
The PluginParameterListener that is attached to all plugin parameters to detect changes.
Definition at line 129 of file Plugin.java.
|
private |
Whether this plugin is a stand-alone plugin.
Definition at line 104 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.isScript(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setScript().