Gridarta Editor
net.sf.gridarta.model.io.AnimationObjectsReader Class Reference

Utility class for reading AnimationObjects from files. More...

+ Collaboration diagram for net.sf.gridarta.model.io.AnimationObjectsReader:

Static Public Member Functions

static void loadAnimations (@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws IOException, AnimationParseException
 Loads animations from a file. More...
 
static void loadAnimations (@NotNull final AnimationObjects animationObjects, @NotNull final ErrorViewCollector errorViewCollector, final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path, @Nullable final Map< String, String > animations) throws AnimationParseException, IOException
 Loads any number of animations from a reader. More...
 

Private Member Functions

 AnimationObjectsReader ()
 Private constructor to prevent instantiation. 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...
 

Detailed Description

Utility class for reading AnimationObjects from files.

Author
Christian Hujer
Andreas Kirschbaum

Definition at line 44 of file AnimationObjectsReader.java.

Constructor & Destructor Documentation

◆ AnimationObjectsReader()

net.sf.gridarta.model.io.AnimationObjectsReader.AnimationObjectsReader ( )
private

Private constructor to prevent instantiation.

Definition at line 49 of file AnimationObjectsReader.java.

Member Function Documentation

◆ loadAnimations() [1/2]

static void net.sf.gridarta.model.io.AnimationObjectsReader.loadAnimations ( @NotNull final AnimationObjects  animationObjects,
@NotNull final ErrorViewCollector  errorViewCollector,
@NotNull final String  path,
@NotNull final File  animFile,
@NotNull final String  startKey,
final boolean  ignoreOtherText 
) throws IOException, AnimationParseException
static

Loads animations from a file.

Parameters
animationObjectsthe animation objects to update
errorViewCollectorthe error view collector for reporting errors
paththe animation path
animFilefile to load animations from
startKeythe key that begins an animation block; it must end with a space character
ignoreOtherTextif set, ignore all text outside animation definitions
Exceptions
IOExceptionin case of I/O errors
java.io.FileNotFoundExceptionin case the file couldn't be opened
AnimationParseExceptionin case parsing the animation reveals errors

Definition at line 68 of file AnimationObjectsReader.java.

References net.sf.gridarta.utils.IOUtils.MAP_ENCODING.

Referenced by net.sf.gridarta.model.resource.AbstractResourcesReader< G >.loadAnimationsFromCollect(), net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadAnimationsFromFiles(), and net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.parseDefFace().

+ Here is the caller graph for this function:

◆ loadAnimations() [2/2]

static void net.sf.gridarta.model.io.AnimationObjectsReader.loadAnimations ( @NotNull final AnimationObjects  animationObjects,
@NotNull final ErrorViewCollector  errorViewCollector,
final Reader  reader,
@NotNull final String  startKey,
final boolean  ignoreOtherText,
@Nullable final String  path,
@Nullable final Map< String, String >  animations 
) throws AnimationParseException, IOException
static

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

reader

with a BufferedReader if the supplied reader isn't already a BufferedReader itself.

Parameters
animationObjectsthe animation objects to update
errorViewCollectorthe error view collector for reporting errors
readerthe reader to load animations from
startKeythe key that begins an animation block; it must end with a space character
ignoreOtherTextif set, ignore all text outside animation definitions
paththe path relative to the arch directory, used to create tree information; either
animations
or this parameter must be non-
null
animationsmaps animation name to animation path; either
path
or this parameter must be non-
null
Exceptions
AnimationParseExceptionin case parsing the animation reveals errors
IOExceptionin case of I/O errors

Definition at line 97 of file AnimationObjectsReader.java.

References net.sf.gridarta.model.io.AnimationObjectsReader.processAnimation().

+ Here is the call graph for this function:

◆ processAnimation()

static int net.sf.gridarta.model.io.AnimationObjectsReader.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
staticprivate

Processes an anim..mina block.

Parameters
animNamethe name of this animation
startLineNumberthe line number of the anim line
inthe reader to read from
startKeythe "anim" tag name
animationObjectsthe animation objects to update
errorViewCollectorthe error view collector for reporting errors
paththe path relative to the arch directory, used to create tree information; either
animations
or this parameter must be non-
null
animationsmaps animation name to animation path; either
path
or this parameter must be non-
null
Returns
the number of processed lines
Exceptions
AnimationParseExceptionin case parsing the animation reveals errors
IOExceptionin case of I/O errors

Definition at line 143 of file AnimationObjectsReader.java.

References net.sf.gridarta.model.io.AnimationObjectsReader.processAnimationLine().

Referenced by net.sf.gridarta.model.io.AnimationObjectsReader.loadAnimations().

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

◆ processAnimationLine()

static void net.sf.gridarta.model.io.AnimationObjectsReader.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 
)
staticprivate

Processes a complete anim..mina block.

Parameters
animationObjectsthe animation objects to update
errorViewCollectorthe error view collector for reporting errors
paththe path relative to the arch directory, used to create tree information; either
animations
or this parameter must be non-
null
animationsmaps animation name to animation path; either
path
or this parameter must be non-
null
animNamethe name of this animation
animTextthe contents of the anim..mina block without comments

Definition at line 179 of file AnimationObjectsReader.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.AnimationObjectsReader.processAnimation().

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

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