![]() |
Gridarta Editor
|
Public Member Functions | |
void | importSpells (@NotNull final File dir, @NotNull final Component parent) |
Opens a file chooser to select the spell list file, then import spells. More... | |
SpellsUtils (@NotNull final String spellFile) | |
Creates a new instance. More... | |
Private Member Functions | |
int | importSpells (@NotNull final File spellFile, @NotNull final File dir) |
Reads all spells from a Crossfire or Daimonin spell list file and write an alphabetical list into "spells.def". More... | |
Static Private Member Functions | |
static String | readUntil (@NotNull final Reader stream, @NotNull final CharSequence tag) throws IOException |
Reads characters from the BufferedReader stream till 'tag' is found. More... | |
static void | readUntil (@NotNull final Reader stream, @NotNull final CharSequence tag, @Nullable final CharSequence abort) throws IOException |
Reads characters from the BufferedReader stream till 'tag' is found. More... | |
Private Attributes | |
final String | spellFile |
The spell file name. More... | |
Static Private Attributes | |
static final ActionBuilder | ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta") |
Action Builder. More... | |
static final Category | LOG = Logger.getLogger(SpellsUtils.class) |
The Logger for printing log messages. More... | |
static final long | READ_MAX = 10000L |
Maximum number of characters to read in readUntil. More... | |
static final FileFilter | SPELL_LIST_H_FILE_FILTER = new FilenameFileFilter(true, "spellist.h", "spellist.h") |
File filter for filtering spellist.h files. More... | |
Definition at line 54 of file SpellsUtils.java.
net.sf.gridarta.gui.spells.SpellsUtils.SpellsUtils | ( | @NotNull final String | spellFile | ) |
Creates a new instance.
spellFile | the spell file name |
Definition at line 89 of file SpellsUtils.java.
References net.sf.gridarta.gui.spells.SpellsUtils.spellFile.
void net.sf.gridarta.gui.spells.SpellsUtils.importSpells | ( | @NotNull final File | dir, |
@NotNull final Component | parent | ||
) |
Opens a file chooser to select the spell list file, then import spells.
dir | the directory to use |
parent | the parent component for dialog boxes |
Definition at line 98 of file SpellsUtils.java.
References net.sf.gridarta.gui.spells.SpellsUtils.ACTION_BUILDER, net.sf.gridarta.utils.FileChooserUtils.setCurrentDirectory(), and net.sf.gridarta.gui.spells.SpellsUtils.SPELL_LIST_H_FILE_FILTER.
Referenced by net.sf.gridarta.action.CollectSpellsAction.collectSpells().
|
private |
Reads all spells from a Crossfire or Daimonin spell list file and write an alphabetical list into "spells.def".
spellFile | spell file to read |
dir | the base directory to load the spells file from |
Definition at line 132 of file SpellsUtils.java.
References net.sf.gridarta.gui.spells.SpellsUtils.LOG, name, net.sf.gridarta.gui.spells.SpellsUtils.readUntil(), spaces, and net.sf.gridarta.gui.spells.SpellsUtils.spellFile.
|
staticprivate |
Reads characters from the BufferedReader stream till 'tag' is found.
Similar to readUntil(), except that the read String is returned. 'tag' is not included in the returned String.
stream | ascii input stream to read from |
tag | stop reading at the string 'tag' |
IOException | an I/O-error occurred while reading the file |
EOFException | the end of file was reached |
Definition at line 275 of file SpellsUtils.java.
References net.sf.gridarta.gui.spells.SpellsUtils.READ_MAX.
|
staticprivate |
Reads characters from the BufferedReader stream till 'tag' is found.
If found, the method returns with stream pointing right after the appearance of 'tag'.
stream | ascii input stream to read from |
tag | stop reading at the string 'tag' |
abort | throw EOFException
|
IOException | an I/O-error occurred while reading the file |
EOFException | the end of file was reached, or the 'abort' string has been encountered |
Definition at line 221 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.importSpells().
|
staticprivate |
Action Builder.
Definition at line 71 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.importSpells().
|
staticprivate |
The Logger for printing log messages.
Definition at line 65 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.importSpells().
|
staticprivate |
Maximum number of characters to read in readUntil.
Definition at line 59 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.readUntil().
|
staticprivate |
File filter for filtering spellist.h files.
Definition at line 77 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.importSpells().
|
private |
The spell file name.
Definition at line 83 of file SpellsUtils.java.
Referenced by net.sf.gridarta.gui.spells.SpellsUtils.importSpells(), and net.sf.gridarta.gui.spells.SpellsUtils.SpellsUtils().