Gridarta Editor
net.sf.gridarta.model.scripts.ScriptUtils Class Reference
+ Collaboration diagram for net.sf.gridarta.model.scripts.ScriptUtils:

Static Public Member Functions

static String chooseDefaultScriptName (@NotNull final File baseDir, final String archetypeName, final String scriptEnding, @NotNull final PathManager pathManager)
 Try to create a reasonable default script name for lazy users. More...
 
static String localizeEventPath (@NotNull final File localMapDir, final File f, @NotNull final File mapDir)
 This method is called when the user selects a new event to be created. More...
 

Private Member Functions

 ScriptUtils ()
 Private constructor to prevent instantiation. More...
 

Static Private Attributes

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

Detailed Description

Definition at line 29 of file ScriptUtils.java.

Constructor & Destructor Documentation

◆ ScriptUtils()

net.sf.gridarta.model.scripts.ScriptUtils.ScriptUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 39 of file ScriptUtils.java.

Member Function Documentation

◆ chooseDefaultScriptName()

static String net.sf.gridarta.model.scripts.ScriptUtils.chooseDefaultScriptName ( @NotNull final File  baseDir,
final String  archetypeName,
final String  scriptEnding,
@NotNull final PathManager  pathManager 
)
static

Try to create a reasonable default script name for lazy users.

Parameters
baseDirthe base dir for the default script name
archetypeNamethe best suitable name for the archetype (see GameObject.getBestName())
scriptEndingthe ending for scripts
pathManagerthe path manager for converting path names
Returns
a nice default script name without whitespaces

Definition at line 101 of file ScriptUtils.java.

Referenced by net.sf.gridarta.gui.scripts.ScriptArchEditor< G, A, R >.addEventScript().

+ Here is the caller graph for this function:

◆ localizeEventPath()

static String net.sf.gridarta.model.scripts.ScriptUtils.localizeEventPath ( @NotNull final File  localMapDir,
final File  f,
@NotNull final File  mapDir 
)
static

This method is called when the user selects a new event to be created.

The path relative to the map dir is calculated, and if reasonable, a relative path is created (relative to the map the event is on).

Parameters
localMapDirthe base directory
fscript file
mapDirthe map directory
Returns
local event path

Definition at line 51 of file ScriptUtils.java.

Referenced by net.sf.gridarta.gui.scripts.ScriptArchEditor< G, A, R >.addEventScript().

+ Here is the caller graph for this function:

Member Data Documentation

◆ LOG

final Category net.sf.gridarta.model.scripts.ScriptUtils.LOG = Logger.getLogger(ScriptUtils.class)
staticprivate

The Logger for printing log messages.

Definition at line 34 of file ScriptUtils.java.


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