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

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

+ 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)
 Creates a new instance. More...
 
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)
 Runs the editor. More...
 

Private Member Functions

int runNormal (@NotNull final Iterable< String > 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)
 Run in normal mode. More...
 
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)
 Executes a plugin. More...
 

Static Private Member Functions

static void checkForErrors (@NotNull final ErrorView errorView)
 Checks whether a ErrorView instance contains at least one error. More...
 
static void usage (@NotNull final String editorJarName, @Nullable final String defaultConfig)
 Prints the editor's command-line options to System#out. More...
 
static void waitDialog (final ErrorView errorView)
 Waits until the error dialog has been dismissed. More...
 

Static Private Attributes

static final Category LOG = Logger.getLogger(GridartaEditor.class)
 The Logger for printing log messages. More...
 

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 81 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 93 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 272 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 
)

◆ 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 Iterable< String >  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 305 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 257 of file GridartaEditor.java.

◆ 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 370 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 284 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 87 of file GridartaEditor.java.


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