export folder names moved to constants

This commit is contained in:
honfika@gmail.com
2015-05-12 09:42:08 +02:00
parent 5c97ef211a
commit e1f1a16f8a
14 changed files with 122 additions and 91 deletions

View File

@@ -25,9 +25,9 @@ import com.jpexs.decompiler.flash.configuration.Configuration;
import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
import com.jpexs.decompiler.flash.exporters.modes.FramesExportMode;
import com.jpexs.decompiler.flash.exporters.modes.FrameExportMode;
import com.jpexs.decompiler.flash.exporters.settings.ButtonExportSettings;
import com.jpexs.decompiler.flash.exporters.settings.FramesExportSettings;
import com.jpexs.decompiler.flash.exporters.settings.FrameExportSettings;
import com.jpexs.decompiler.flash.exporters.shape.CanvasShapeExporter;
import com.jpexs.decompiler.flash.helpers.BMPFile;
import com.jpexs.decompiler.flash.helpers.ImageHelper;
@@ -90,26 +90,26 @@ public class FrameExporter {
private static final Logger logger = Logger.getLogger(FrameExporter.class.getName());
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, SWF swf, int containerId, List<Integer> frames, ButtonExportSettings settings, EventListener evl) throws IOException {
FramesExportMode fem;
FrameExportMode fem;
switch (settings.mode) {
case BMP:
fem = FramesExportMode.BMP;
fem = FrameExportMode.BMP;
break;
case PNG:
fem = FramesExportMode.PNG;
fem = FrameExportMode.PNG;
break;
case SVG:
fem = FramesExportMode.SVG;
fem = FrameExportMode.SVG;
break;
default:
throw new Error("Unsupported button export mode");
}
FramesExportSettings fes = new FramesExportSettings(fem, settings.zoom);
FrameExportSettings fes = new FrameExportSettings(fem, settings.zoom);
return exportFrames(handler, outdir, swf, containerId, frames, fes, evl);
}
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, final SWF swf, int containerId, List<Integer> frames, final FramesExportSettings settings, final EventListener evl) throws IOException {
public List<File> exportFrames(AbortRetryIgnoreHandler handler, String outdir, final SWF swf, int containerId, List<Integer> frames, final FrameExportSettings settings, final EventListener evl) throws IOException {
final List<File> ret = new ArrayList<>();
if (swf.tags.isEmpty()) {
return ret;
@@ -139,7 +139,7 @@ public class FrameExporter {
final List<Integer> fframes = frames;
Color backgroundColor = null;
if (settings.mode == FramesExportMode.AVI) {
if (settings.mode == FrameExportMode.AVI) {
for (Tag t : swf.tags) {
if (t instanceof SetBackgroundColorTag) {
SetBackgroundColorTag sb = (SetBackgroundColorTag) t;
@@ -148,7 +148,7 @@ public class FrameExporter {
}
}
if (settings.mode == FramesExportMode.SVG) {
if (settings.mode == FrameExportMode.SVG) {
for (int i = 0; i < frames.size(); i++) {
if (evl != null) {
evl.handleExportingEvent("frame", i + 1, frames.size(), tim.parentTag == null ? "" : tim.parentTag.getName());
@@ -183,7 +183,7 @@ public class FrameExporter {
return ret;
}
if (settings.mode == FramesExportMode.CANVAS) {
if (settings.mode == FrameExportMode.CANVAS) {
if (evl != null) {
evl.handleExportingEvent("canvas", 1, 1, tim.parentTag == null ? "" : tim.parentTag.getName());
}

View File

@@ -1,25 +1,26 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. */
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.modes;
/**
*
* @author JPEXS
*/
public enum FramesExportMode {
public enum FrameExportMode {
PNG,
GIF,

View File

@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode;
@@ -23,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.BinaryDataExportMode;
*/
public class BinaryDataExportSettings {
public static final String EXPORT_FOLDER_NAME = "binaryData";
public BinaryDataExportMode mode;
public BinaryDataExportSettings(BinaryDataExportMode mode) {

View File

@@ -24,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.ButtonExportMode;
*/
public class ButtonExportSettings {
public static final String EXPORT_FOLDER_NAME = "buttons";
public ButtonExportMode mode;
public double zoom;

View File

@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.FontExportMode;
@@ -23,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.FontExportMode;
*/
public class FontExportSettings {
public static final String EXPORT_FOLDER_NAME = "fonts";
public FontExportMode mode;
public FontExportSettings(FontExportMode mode) {

View File

@@ -16,19 +16,23 @@
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.FramesExportMode;
import com.jpexs.decompiler.flash.exporters.modes.FrameExportMode;
/**
*
* @author JPEXS
*/
public class FramesExportSettings {
public class FrameExportSettings {
public FramesExportMode mode;
public static final String EXPORT_FOLDER_NAME = "frames";
public static final String EXPORT_FOLDER_NAME_SPRITE = "sprites";
public FrameExportMode mode;
public double zoom;
public FramesExportSettings(FramesExportMode mode, double zoom) {
public FrameExportSettings(FrameExportMode mode, double zoom) {
this.mode = mode;
this.zoom = zoom;
}

View File

@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.ImageExportMode;
@@ -23,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.ImageExportMode;
*/
public class ImageExportSettings {
public static final String EXPORT_FOLDER_NAME = "images";
public ImageExportMode mode;
public ImageExportSettings(ImageExportMode mode) {

View File

@@ -24,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.MorphShapeExportMode;
*/
public class MorphShapeExportSettings {
public static final String EXPORT_FOLDER_NAME = "morphshapes";
public MorphShapeExportMode mode;
public double zoom;

View File

@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.MovieExportMode;
@@ -23,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.MovieExportMode;
*/
public class MovieExportSettings {
public static final String EXPORT_FOLDER_NAME = "movies";
public MovieExportMode mode;
public MovieExportSettings(MovieExportMode mode) {

View File

@@ -24,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.ShapeExportMode;
*/
public class ShapeExportSettings {
public static final String EXPORT_FOLDER_NAME = "shapes";
public ShapeExportMode mode;
public double zoom;

View File

@@ -1,18 +1,19 @@
/*
* Copyright (C) 2010-2015 JPEXS, All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.exporters.settings;
import com.jpexs.decompiler.flash.exporters.modes.SoundExportMode;
@@ -23,6 +24,8 @@ import com.jpexs.decompiler.flash.exporters.modes.SoundExportMode;
*/
public class SoundExportSettings {
public static final String EXPORT_FOLDER_NAME = "sounds";
public SoundExportMode mode;
public SoundExportSettings(SoundExportMode mode) {