Gridarta Editor
net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Reference
+ Collaboration diagram for net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

 GridartaEditor (@NotNull final String tipOfTheDayPackage)
 
void run (@NotNull final String actionBuilderPackage, @NotNull final String editorJarName, @NotNull final EditorFactory< G, A, R > editorFactory, @Nullable final String defaultConfig, @NotNull final String... args)
 

Private Member Functions

int runNormal (@NotNull final List< File > args, @NotNull final EditorFactory< G, A, R > editorFactory, @NotNull final ErrorView errorView, @NotNull final ResourceIcons resourceIcons, @NotNull final ConfigSourceFactory configSourceFactory, @NotNull final ProjectModel< G, A, R > projectModel, @NotNull final EditorSettings editorSettings)
 
int runPlugin (@NotNull final String plugin, final ErrorView errorView, final Iterable< String > args, @NotNull final EditorFactory< G, A, R > editorFactory, @NotNull final ProjectModel< G, A, R > projectModel, @NotNull final ResourceIcons resourceIcons, @NotNull final EditorSettings editorSettings)
 

Static Private Member Functions

static void checkForErrors (@NotNull final ErrorView errorView)
 
static void usage (@NotNull final String editorJarName, @Nullable final String defaultConfig)
 
static void waitDialog (final ErrorView errorView)
 

Static Private Attributes

static final Category LOG = Logger.getLogger(GridartaEditor.class)
 

Detailed Description

Main class of the editor; parses command-line arguments, initializes and starts the editor.

Author
Michael Toennies
Christian Hujer
Andreas Kirschbaum

Definition at line 83 of file GridartaEditor.java.

Constructor & Destructor Documentation

◆ GridartaEditor()

net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.GridartaEditor ( @NotNull final String  tipOfTheDayPackage)

Creates a new instance.

Parameters
tipOfTheDayPackagethe package name for tip of the day messages

Definition at line 95 of file GridartaEditor.java.

Member Function Documentation

◆ checkForErrors()

static void net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.checkForErrors ( @NotNull final ErrorView  errorView)
staticprivate

Checks whether a ErrorView instance contains at least one error. Quits the application if an error exists.

Parameters
errorViewthe error view to check

Definition at line 295 of file GridartaEditor.java.

References net.sf.gridarta.mainactions.DefaultExiter.callExit().

+ Here is the call graph for this function:

◆ run()

void net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.run ( @NotNull final String  actionBuilderPackage,
@NotNull final String  editorJarName,
@NotNull final EditorFactory< G, A, R >  editorFactory,
@Nullable final String  defaultConfig,
@NotNull final String...  args 
)

Runs the editor.

Parameters
actionBuilderPackagethe package name for creating an action builder
editorJarNamethe name of the .jar file containing the executable
editorFactorythe editor factory to use
defaultConfigthe default config file or
null
to use Java's preferences
argsthe command line parameters given to the level editor

Definition at line 116 of file GridartaEditor.java.

References net.sf.gridarta.maincontrol.GridartaRunMode.BATCH_PNG, net.sf.gridarta.maincontrol.GridartaRunMode.COLLECT_ARCHES, net.sf.gridarta.commands.CollectArchesCommand.execute(), net.sf.gridarta.commands.BatchPngCommand.execute(), net.sf.gridarta.commands.SinglePngCommand.execute(), net.sf.gridarta.model.configsource.ConfigSourceFactory.getConfigSource(), net.sf.gridarta.model.settings.ProjectSettings.getConfigSourceName(), net.sf.gridarta.utils.ConfigFileUtils.getHomeFile(), net.sf.gridarta.model.settings.ProjectSettings.getMapsDirectory(), net.sf.gridarta.preferences.FilePreferencesFactory.initialize(), net.sf.gridarta.maincontrol.GridartaRunMode.isConsoleMode(), net.sf.gridarta.maincontrol.GridartaRunMode.NORMAL, net.sf.gridarta.gui.dialog.prefs.GUIPreferences.PREFERENCES_LANGUAGE, and net.sf.gridarta.maincontrol.GridartaRunMode.SINGLE_PNG.

Referenced by net.sf.gridarta.var.atrinik.maincontrol.AtrinikEditor.main(), net.sf.gridarta.var.daimonin.maincontrol.DaimoninEditor.main(), and net.sf.gridarta.var.crossfire.maincontrol.CrossfireEditor.main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ runNormal()

int net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.runNormal ( @NotNull final List< File >  args,
@NotNull final EditorFactory< G, A, R >  editorFactory,
@NotNull final ErrorView  errorView,
@NotNull final ResourceIcons  resourceIcons,
@NotNull final ConfigSourceFactory  configSourceFactory,
@NotNull final ProjectModel< G, A, R >  projectModel,
@NotNull final EditorSettings  editorSettings 
)
private

Run in normal mode.

Parameters
argsthe files to open
editorFactorythe editor factory to use
errorViewthe error view to add errors to
resourceIconsthe gui utils to use
configSourceFactorythe config source factory to use
projectModelthe project model to use
editorSettingsthe editor settings
Returns
return code suitable for passing to System#exit(int)

Definition at line 328 of file GridartaEditor.java.

References net.sf.gridarta.maincontrol.GUIMainControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.run().

+ Here is the call graph for this function:

◆ runPlugin()

int net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.runPlugin ( @NotNull final String  plugin,
final ErrorView  errorView,
final Iterable< String >  args,
@NotNull final EditorFactory< G, A, R >  editorFactory,
@NotNull final ProjectModel< G, A, R >  projectModel,
@NotNull final ResourceIcons  resourceIcons,
@NotNull final EditorSettings  editorSettings 
)
private

Executes a plugin.

Parameters
pluginthe name of the plugin to run
errorViewthe error view to add errors to
argsthe arguments for the plugin
editorFactorythe editor factory to use
projectModelthe project model to use
resourceIconsthe gui utils to use
editorSettingsthe global editor settings instance
Returns
return code suitable for passing to System#exit(int)

Definition at line 280 of file GridartaEditor.java.

References net.sf.gridarta.plugin.PluginExecutor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.executePlugin().

+ Here is the call graph for this function:

◆ usage()

static void net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.usage ( @NotNull final String  editorJarName,
@Nullable final String  defaultConfig 
)
staticprivate

Prints the editor's command-line options to System#out.

Parameters
editorJarNamethe name of the editor's .jar file
defaultConfigthe default config file or
null
for Java preferences

Definition at line 390 of file GridartaEditor.java.

◆ waitDialog()

static void net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.waitDialog ( final ErrorView  errorView)
staticprivate

Waits until the error dialog has been dismissed.

Parameters
errorViewthe error view instance

Definition at line 307 of file GridartaEditor.java.

References net.sf.gridarta.mainactions.DefaultExiter.callExit(), and net.sf.gridarta.model.errorview.ErrorView.waitDialog().

+ Here is the call graph for this function:

Member Data Documentation

◆ LOG

final Category net.sf.gridarta.maincontrol.GridartaEditor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.LOG = Logger.getLogger(GridartaEditor.class)
staticprivate

The Logger for printing log messages.

Definition at line 89 of file GridartaEditor.java.


The documentation for this class was generated from the following file: