 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.collectable;
22 import java.io.BufferedWriter;
24 import java.io.FileOutputStream;
25 import java.io.IOException;
26 import java.io.OutputStreamWriter;
27 import java.io.Writer;
33 import net.
sf.japi.swing.action.ActionBuilder;
34 import net.
sf.japi.swing.action.ActionBuilderFactory;
35 import net.
sf.japi.swing.misc.Progress;
36 import org.jetbrains.annotations.NotNull;
50 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
80 public void collect(@NotNull
final Progress progress, @NotNull
final File collectedDirectory)
throws IOException {
91 private void collectAnimations(@NotNull
final Progress progress, @NotNull
final File collectedDirectory)
throws IOException {
93 try (Writer animations =
new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(
new File(collectedDirectory,
"animations")),
IOUtils.
MAP_ENCODING))) {
96 animations.append(
"anim ").append(anim.getAnimName()).append(
'\n').append(anim.getAnimList()).append(
"mina\n");
97 if (counter++ % 128 == 0) {
98 progress.setValue(counter);
111 private void collectAnimTree(@NotNull
final Progress progress, @NotNull
final File collectedDirectory)
throws IOException {
113 try (Writer animtree =
new BufferedWriter(
new OutputStreamWriter(
new FileOutputStream(
new File(collectedDirectory,
animTreeFile)),
IOUtils.
MAP_ENCODING))) {
116 animtree.append(anim.getPath()).append(
'\n');
117 if (counter++ % 128 == 0) {
118 progress.setValue(counter);
Base package of all Gridarta classes.
A Collectable has information that can be collected.
AnimationObjects is a container for AnimationObjects.
void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory)
Collects the animation data into the file "animations".
int size()
Get the number of objects.
void collectAnimations(@NotNull final Progress progress, @NotNull final File collectedDirectory)
Collects the animation data into the file "animations".
void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory)
Collects information.the progress to report progress to the destination directory to collect data to ...
Classes for handling data that is organized in a tree.
static String getString(@NotNull final ActionBuilder actionBuilder, @NotNull final String key, @NotNull final String defaultValue)
Returns the value of a key.
AnimationObjectsCollectable(@NotNull final AnimationObjects animationObjects, @NotNull final String animTreeFile)
Creates a new instance.
final String animTreeFile
The collected animation tree file.
Utility-class for Gridarta's I/O.
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
Utility class for ActionBuilder related functions.
An AnimationObject reflects the animation ("@code anim\n @endcode " ...
a Collectable that creates the "animations" file.
final AnimationObjects animationObjects
The AnimationObjects being collected.
static final String MAP_ENCODING
Encoding to use for maps and other data.
static final ActionBuilder ACTION_BUILDER
The ActionBuilder instance.