![]() |
Gridarta Editor
|
Utility class for reading AnimationObjects from files. More...
Public Member Functions | |
void | loadAnimations (@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey) throws IOException, AnimationParseException |
Loads animations from a file. More... | |
void | loadAnimations (@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, @Nullable final String path, @Nullable final Map< String, String > animations) throws AnimationParseException, IOException |
Loads any number of animations from a reader. More... | |
Protected Member Functions | |
AbstractAnimationObjectsReader () | |
Creates a new instance. More... | |
abstract int | parseLine (@NotNull String line, int startLineNumber, @NotNull BufferedReader in, @NotNull ErrorViewCollector errorViewCollector) throws AnimationParseException, IOException |
Parses a line. More... | |
Static Private Member Functions | |
static int | processAnimation (@NotNull final String animName, final int startLineNumber, @NotNull final BufferedReader in, @NotNull final String startKey, @NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map< String, String > animations) throws AnimationParseException, IOException |
Processes an anim..mina block. More... | |
static void | processAnimationLine (@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @Nullable final String path, @Nullable final Map< String, String > animations, @NotNull final String animName, @NotNull final String animText) |
Processes a complete anim..mina block. More... | |
Utility class for reading AnimationObjects from files.
Definition at line 44 of file AbstractAnimationObjectsReader.java.
|
protected |
Creates a new instance.
Definition at line 49 of file AbstractAnimationObjectsReader.java.
void net.sf.gridarta.model.io.AbstractAnimationObjectsReader.loadAnimations | ( | @NotNull final AnimationObjects | animationObjects, |
@NotNull final ErrorViewCollector | errorViewCollector, | ||
@NotNull final String | path, | ||
@NotNull final File | animFile, | ||
@NotNull final String | startKey | ||
) | throws IOException, AnimationParseException |
Loads animations from a file.
animationObjects | the animation objects to update |
errorViewCollector | the error view collector for reporting errors |
path | the animation path |
animFile | file to load animations from |
startKey | the key that begins an animation block; it must end with a space character |
IOException | in case of I/O errors |
java.io.FileNotFoundException | in case the file couldn't be opened |
AnimationParseException | in case parsing the animation reveals errors |
Definition at line 66 of file AbstractAnimationObjectsReader.java.
References net.sf.gridarta.utils.IOUtils.MAP_ENCODING.
Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadAnimationsFromFiles(), and net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.parseDefFace().
void net.sf.gridarta.model.io.AbstractAnimationObjectsReader.loadAnimations | ( | @NotNull final AnimationObjects | animationObjects, |
@NotNull final ErrorViewCollector | errorViewCollector, | ||
final Reader | reader, | ||
@NotNull final String | startKey, | ||
@Nullable final String | path, | ||
@Nullable final Map< String, String > | animations | ||
) | throws AnimationParseException, IOException |
Loads any number of animations from a reader.
It is not necessary to provide a BufferedReader for buffering. This method will always wrap the supplied
with a BufferedReader if the supplied reader isn't already a BufferedReader itself.
animationObjects | the animation objects to update |
errorViewCollector | the error view collector for reporting errors |
reader | the reader to load animations from |
startKey | the key that begins an animation block; it must end with a space character |
path | the path relative to the arch directory, used to create tree information; either animations
null
|
animations | maps animation name to animation path; either path
null
|
AnimationParseException | in case parsing the animation reveals errors |
IOException | in case of I/O errors |
Definition at line 93 of file AbstractAnimationObjectsReader.java.
References net.sf.gridarta.model.io.AbstractAnimationObjectsReader.parseLine(), and net.sf.gridarta.model.io.AbstractAnimationObjectsReader.processAnimation().
|
abstractprotected |
Parses a line.
line | the current line |
startLineNumber | the current line number |
in | the reader to read from |
errorViewCollector | the error view collector for reporting errors |
AnimationParseException | in case parsing the animation reveals errors |
IOException | in case of I/O errors |
Reimplemented in net.sf.gridarta.model.io.TestAnimationObjectsReader, net.sf.gridarta.var.crossfire.model.io.CrossfireAnimationObjectsReader, net.sf.gridarta.var.atrinik.model.io.AtrinikAnimationObjectsReader, and net.sf.gridarta.var.daimonin.model.io.DaimoninAnimationObjectsReader.
Referenced by net.sf.gridarta.model.io.AbstractAnimationObjectsReader.loadAnimations().
|
staticprivate |
Processes an anim..mina block.
animName | the name of this animation |
startLineNumber | the line number of the anim line |
in | the reader to read from |
startKey | the "anim" tag name |
animationObjects | the animation objects to update |
errorViewCollector | the error view collector for reporting errors |
path | the path relative to the arch directory, used to create tree information; either animations
null
|
animations | maps animation name to animation path; either path
null
|
AnimationParseException | in case parsing the animation reveals errors |
IOException | in case of I/O errors |
Definition at line 158 of file AbstractAnimationObjectsReader.java.
References net.sf.gridarta.model.io.AbstractAnimationObjectsReader.processAnimationLine().
Referenced by net.sf.gridarta.model.io.AbstractAnimationObjectsReader.loadAnimations().
|
staticprivate |
Processes a complete anim..mina block.
animationObjects | the animation objects to update |
errorViewCollector | the error view collector for reporting errors |
path | the path relative to the arch directory, used to create tree information; either animations
null
|
animations | maps animation name to animation path; either path
null
|
animName | the name of this animation |
animText | the contents of the anim..mina block without comments |
Definition at line 194 of file AbstractAnimationObjectsReader.java.
References net.sf.gridarta.model.errorview.ErrorViewCategory.ANIMATIONS_ENTRY_INVALID, net.sf.gridarta.model.anim.IllegalAnimationException.getAnimationObject(), and net.sf.gridarta.model.data.NamedObject.getPath().
Referenced by net.sf.gridarta.model.io.AbstractAnimationObjectsReader.processAnimation().