 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.resource;
22 import java.io.BufferedReader;
24 import java.io.IOException;
25 import java.io.InputStream;
26 import java.io.InputStreamReader;
27 import java.io.Reader;
29 import java.util.Collections;
30 import java.util.List;
45 import org.apache.log4j.Category;
46 import org.apache.log4j.Logger;
47 import org.jetbrains.annotations.NotNull;
48 import org.jetbrains.annotations.Nullable;
117 protected AbstractCollectedResourcesReader(@NotNull
final File
collectedDirectory, @Nullable
final String
imageSet, @NotNull
final ArchetypeSet<G, A, R> archetypeSet, @NotNull
final AbstractArchetypeParser<G, A, R, ?> archetypeParser, @NotNull
final AnimationObjects animationObjects, @NotNull
final FaceObjects faceObjects, @NotNull
final String
animTreeFile, @NotNull
final String
archetypesFile, @NotNull
final AbstractAnimationObjectsReader animationObjectsReader) {
133 Map<String, String> animations =
null;
138 }
catch (
final IOException ex) {
141 }
catch (
final IOException ex) {
159 try (InputStream inputStream = url.openStream()) {
161 try (BufferedReader bufferedReader =
new BufferedReader(reader)) {
166 }
catch (
final IOException ex) {
170 if (
LOG.isInfoEnabled()) {
173 }
catch (
final IOException ex) {
static URL getResource(@NotNull final File dir, @NotNull final String fileName)
Get the URL of a resource.
This interface represents a lazy loader that provides images on demand.
AbstractCollectedResourcesReader(@NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final ArchetypeSet< G, A, R > archetypeSet, @NotNull final AbstractArchetypeParser< G, A, R, ?> archetypeParser, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects, @NotNull final String animTreeFile, @NotNull final String archetypesFile, @NotNull final AbstractAnimationObjectsReader animationObjectsReader)
Creates a new instance.
final File collectedDirectory
The collected directory.
final AbstractArchetypeParser< G, A, R, ?> archetypeParser
The AbstractArchetypeParser to use.
void loadAnimationsFromCollect( @NotNull final ErrorView errorView, @NotNull final Map< String, String > animations, @NotNull final AbstractAnimationObjectsReader animationObjectsReader)
Loads all animations from the big collected animations file.
Base package of all Gridarta classes.
Abstract base implementation of ArchetypeParser.
AnimationObjects is a container for AnimationObjects.
Abstract base class for archetype set loader classes.
void setLoadedFromArchive(boolean loadedFromArchive)
Sets whether Archetypes were loaded from an archive.
final AnimationObjects animationObjects
The animation objects instance.
Utility class for reading AnimationObjects from files.
Interface for classes displaying error messages.
final ArchetypeSet< G, A, R > archetypeSet
The ArchetypeSet to update.
Reflects a game object (object on a map).
void loadAnimations(@NotNull final ErrorView errorView)
Loads all animations.
GameObjects are the objects based on Archetypes found on maps.
void loadArchetypes(@NotNull final ErrorView errorView, @NotNull final List< G > invObjects)
Loads all archetypes.
int getArchetypeCount()
Returns the number of Archetypes available.
Convenience class for adding messages to a ErrorView instance using a fixed category name.
final String animTreeFile
The name of the animation tree information file.
Defines possible error categories for ErrorView instances.
Interface for MapArchObjects.
final String imageSet
The current image set.
static final Category LOG
The logger for printing log messages.
FaceObjects is a container for FaceObjects.
final String archetypesFile
The name of the collected archetypes file.
Interface that captures similarities between different ArchetypeSet implementations.
Abstract base class for AbstractResourcesReaders that read from collected files.
FaceProvider loadFacesCollection(@NotNull final ErrorView errorView)
Loads all faces.
Reading and writing of maps, handling of paths.
Utility-class for Gridarta's I/O.
The face is the appearance of an object.
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
final AbstractAnimationObjectsReader animationObjectsReader
The animation objects reader to use.
final FaceObjects faceObjects
The FaceObjects instance.
FaceProvider loadFacesCollection(@NotNull ErrorView errorView, @NotNull File collectedDirectory)
Loads all faces from a png collection file.
void parseArchetypeFromStream(@NotNull final BufferedReader in, @Nullable final R prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, @NotNull final String archPath, @NotNull final List< G > invObjects, @NotNull final ErrorViewCollector errorViewCollector)
static Map< String, String > loadAnimTree( @NotNull final URL url)
Loads animations from a file.
static final String MAP_ENCODING
Encoding to use for maps and other data.