small cleanup

This commit is contained in:
Honfika
2014-02-24 00:05:33 +01:00
parent a64504d610
commit 742e6fe1c0
6 changed files with 4 additions and 13 deletions
@@ -65,15 +65,8 @@ public class BitmapExporter extends ShapeExporterBase implements IShapeExporter
private Color lineColor;
private Stroke lineStroke;
private Stroke defaultStroke;
private Matrix transform;
private double unitDivisor;
public static SerializableImage export(SWF swf, SHAPE shape) {
BitmapExporter exporter = new BitmapExporter(swf, shape, null);
exporter.export();
return exporter.getImage();
}
public static SerializableImage export(SWF swf, SHAPE shape, Color defaultColor) {
BitmapExporter exporter = new BitmapExporter(swf, shape, defaultColor);
exporter.export();
@@ -122,7 +115,6 @@ public class BitmapExporter extends ShapeExporterBase implements IShapeExporter
private void exportTo(SerializableImage image, Matrix transformation) {
this.image = image;
this.transform = transformation;
graphics = (Graphics2D) image.getGraphics();
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
@@ -138,7 +138,6 @@ public final class ImagePanel extends JPanel implements ActionListener, FlashDis
m.translate(-rect.Xmin, -rect.Ymin);
drawable.toImage(0, swf.tags, characters, new Stack<Integer>(), image, m);
img = image;
} else {
img = drawable.toImage(0, swf.tags, characters, new Stack<Integer>(), Matrix.getScaleInstance(1 / SWF.unitDivisor));
}
@@ -668,7 +668,7 @@ public class DefineEditTextTag extends TextTag implements DrawableTag {
tr.glyphEntries[i].glyphAdvance = advance;
}
textRecords.add(tr);
staticTextToImage(swf, characters, textRecords, bounds, 1, image, getTextMatrix(), transformation);
staticTextToImage(swf, characters, textRecords, 1, image, getTextMatrix(), transformation);
}
}
@@ -498,7 +498,7 @@ public class DefineText2Tag extends TextTag implements DrawableTag {
@Override
public void toImage(int frame, List<Tag> tags, Map<Integer, CharacterTag> characters, Stack<Integer> visited, SerializableImage image, Matrix transformation) {
staticTextToImage(swf, characters, textRecords, textBounds, 2, image, getTextMatrix(), transformation);
staticTextToImage(swf, characters, textRecords, 2, image, getTextMatrix(), transformation);
}
@Override
@@ -514,7 +514,7 @@ public class DefineTextTag extends TextTag implements DrawableTag {
@Override
public void toImage(int frame, List<Tag> tags, Map<Integer, CharacterTag> characters, Stack<Integer> visited, SerializableImage image, Matrix transformation) {
staticTextToImage(swf, characters, textRecords, textBounds, 1, image, getTextMatrix(), transformation);
staticTextToImage(swf, characters, textRecords, 1, image, getTextMatrix(), transformation);
}
@Override
@@ -192,7 +192,7 @@ public abstract class TextTag extends CharacterTag implements BoundedTag {
return att;
}
public static void staticTextToImage(SWF swf, Map<Integer, CharacterTag> characters, List<TEXTRECORD> textRecords, RECT textBounds, int numText, SerializableImage image, MATRIX textMatrix, Matrix transformation) {
public static void staticTextToImage(SWF swf, Map<Integer, CharacterTag> characters, List<TEXTRECORD> textRecords, int numText, SerializableImage image, MATRIX textMatrix, Matrix transformation) {
Color textColor = new Color(0, 0, 0);
FontTag font = null;
int textHeight = 12;