Gridarta Editor
|
Public Member Functions | |
void | addParameter (@NotNull final PluginParameter< G, A, R, ?> pluginParameter) |
void | addPluginListener (@NotNull final PluginListener listener) |
Plugin< G, A, R > | clonePlugin () |
void | convertType (@NotNull final PluginParameter< G, A, R, ?> pluginParameter, @NotNull final String newType) throws NoSuchParameterException |
String | getCode () |
File | getFile () |
String | getName () |
int | getParameter (@NotNull final String parameterName) |
PluginParameter< G, A, R, ?> | getParameter (final int index) throws NoSuchParameterException |
Filter<?, ?> | getPluginAsFilter (@NotNull final PluginParameters pluginParameters) |
boolean | hasParameters () |
boolean | isAutoBoot () |
boolean | isFilter () |
boolean | isModified () |
boolean | isScript () |
Iterator< PluginParameter< G, A, R, ?> > | iterator () |
void | newParameter () |
Plugin (@NotNull final String name, @NotNull final PluginParameterFactory< G, A, R > pluginParameterFactory) | |
void | removeParameter (final int index) |
void | removePluginListener (@NotNull final PluginListener listener) |
void | resetModified () |
void | runPlugin (@NotNull final PluginParameters pluginParameters) |
void | setAutoBoot (final boolean autoBoot) |
void | setCode (@NotNull final String code) |
void | setFile (@Nullable final File file) |
void | setFilter (final boolean filter) |
void | setScript (final boolean script) |
String | toString () |
Node | toXML (@NotNull final PluginParameter< G, A, R, ?> pluginParameter) |
Private Member Functions | |
void | notifyParametersChangedListeners () |
void | setModified () |
Private Attributes | |
boolean | autoBoot |
String | code = "" |
final PluginParameterCodec< G, A, R > | codec = new PluginParameterCodec<>() |
File | file |
boolean | filter |
final Collection< PluginListener > | listeners = new CopyOnWriteArrayList<>() |
boolean | modified |
final String | name |
final List< PluginParameter< G, A, R, ?> > | parameters = new ArrayList<>() |
final PluginParameterFactory< G, A, R > | pluginParameterFactory |
final PluginParameterListener | pluginParameterListener = this::setModified |
boolean | script |
Static Private Attributes | |
static final Category | LOG = Logger.getLogger(Plugin.class) |
Model for plugins.
Definition at line 53 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 138 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 289 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().
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 235 of file Plugin.java.
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 264 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().
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 157 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.BshRunnable< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.run().
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 148 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().
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 187 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().
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 303 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 178 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.
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.
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.
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.
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 207 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().
|
private |
Notifies all registered PluginListeners that the parameters have changed.
Definition at line 251 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().
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 225 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 >.removePluginListener | ( | @NotNull final PluginListener | listener | ) |
Removes a PluginListener to be notified about changes.
listener | the change listener |
Definition at line 243 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().
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().
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 165 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().
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().
|
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().
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().
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 200 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 95 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 65 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.getCode(), net.sf.gridarta.plugin.Plugin< G, A, R >.getPluginAsFilter(), net.sf.gridarta.plugin.Plugin< G, A, R >.runPlugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setCode().
|
private |
The PluginParameterCodec for converting PluginParameters to or from XML representation.
Definition at line 90 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.toXML().
|
private |
The location to save this plugin to; set to
if the plugin has no associated location.
Definition at line 118 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 100 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 111 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.addPluginListener(), net.sf.gridarta.plugin.Plugin< G, A, R >.notifyParametersChangedListeners(), and net.sf.gridarta.plugin.Plugin< G, A, R >.removePluginListener().
|
staticprivate |
The Logger for printing log messages.
Definition at line 59 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.getPluginAsFilter(), net.sf.gridarta.plugin.Plugin< G, A, R >.newParameter(), and net.sf.gridarta.plugin.Plugin< G, A, R >.runPlugin().
|
private |
Whether the plugin contents has been modified since last save.
Definition at line 123 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.isModified(), net.sf.gridarta.plugin.Plugin< G, A, R >.resetModified(), and net.sf.gridarta.plugin.Plugin< G, A, R >.setModified().
|
private |
The plugin name.
Definition at line 77 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 >.getPluginAsFilter(), net.sf.gridarta.plugin.Plugin< G, A, R >.Plugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.runPlugin(), and net.sf.gridarta.plugin.Plugin< G, A, R >.toString().
|
private |
The PluginParameters for this plugin.
Definition at line 71 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.addParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), net.sf.gridarta.plugin.Plugin< G, A, R >.convertType(), net.sf.gridarta.plugin.Plugin< G, A, R >.getParameter(), net.sf.gridarta.plugin.Plugin< G, A, R >.hasParameters(), net.sf.gridarta.plugin.Plugin< G, A, R >.iterator(), net.sf.gridarta.plugin.Plugin< G, A, R >.newParameter(), and net.sf.gridarta.plugin.Plugin< G, A, R >.removeParameter().
|
private |
The PluginParameterFactory for creating plugin parameters.
Definition at line 83 of file Plugin.java.
Referenced by net.sf.gridarta.plugin.Plugin< G, A, R >.clonePlugin(), 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 >.Plugin().
|
private |
The PluginParameterListener that is attached to all {plugin parameters} to detect changes.
Definition at line 130 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().
|
private |
Whether this plugin is a stand-alone plugin.
Definition at line 105 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().