mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-31 11:44:36 +00:00
#805 Autosave
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class BigObject {
|
||||
|
||||
private byte[] dummy = new byte[512 * 1024 * 1024];
|
||||
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
super.finalize();
|
||||
System.out.println("swf finalized");
|
||||
}
|
||||
}
|
||||
@@ -182,6 +182,8 @@ import org.monte.media.avi.AVIWriter;
|
||||
*/
|
||||
public final class SWF implements SWFContainerItem, Timelined {
|
||||
|
||||
// big object for testing cleanup
|
||||
//BigObject bigObj = new BigObject();
|
||||
/**
|
||||
* Default version of SWF file format
|
||||
*/
|
||||
|
||||
@@ -409,6 +409,10 @@ public class Configuration {
|
||||
@ConfigurationCategory("ui")
|
||||
public static final ConfigurationItem<Boolean> editorMode = null;
|
||||
|
||||
@ConfigurationDefaultBoolean(false)
|
||||
@ConfigurationCategory("ui")
|
||||
public static final ConfigurationItem<Boolean> autoSaveTagModifications = null;
|
||||
|
||||
private enum OSId {
|
||||
|
||||
WINDOWS, OSX, UNIX
|
||||
|
||||
@@ -660,6 +660,10 @@ public class DefineEditTextTag extends TextTag {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTextBounds() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alignText(TextAlign textAlign) {
|
||||
return true;
|
||||
|
||||
@@ -436,10 +436,15 @@ public class DefineText2Tag extends TextTag {
|
||||
throw ex;
|
||||
}
|
||||
|
||||
updateTextBounds(textBounds);
|
||||
updateTextBounds();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTextBounds() {
|
||||
updateTextBounds(textBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alignText(TextAlign textAlign) {
|
||||
alignText(swf, textRecords, textAlign);
|
||||
@@ -450,6 +455,7 @@ public class DefineText2Tag extends TextTag {
|
||||
@Override
|
||||
public boolean translateText(int diff) {
|
||||
textMatrix.translateX += diff;
|
||||
updateTextBounds();
|
||||
setModified(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -444,10 +444,15 @@ public class DefineTextTag extends TextTag {
|
||||
throw ex;
|
||||
}
|
||||
|
||||
updateTextBounds(textBounds);
|
||||
updateTextBounds();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTextBounds() {
|
||||
updateTextBounds(textBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean alignText(TextAlign textAlign) {
|
||||
alignText(swf, textRecords, textAlign);
|
||||
@@ -458,6 +463,7 @@ public class DefineTextTag extends TextTag {
|
||||
@Override
|
||||
public boolean translateText(int diff) {
|
||||
textMatrix.translateX += diff;
|
||||
updateTextBounds();
|
||||
setModified(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -85,6 +85,8 @@ public abstract class TextTag extends CharacterTag implements DrawableTag {
|
||||
// use the texts from the "texts" argument when it is not null
|
||||
public abstract boolean setFormattedText(MissingCharacterHandler missingCharHandler, String formattedText, String[] texts) throws TextParseException;
|
||||
|
||||
public abstract void updateTextBounds();
|
||||
|
||||
public abstract boolean alignText(TextAlign textAlign);
|
||||
|
||||
public abstract boolean translateText(int diff);
|
||||
@@ -500,7 +502,7 @@ public abstract class TextTag extends CharacterTag implements DrawableTag {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void updateTextBounds(RECT textBounds) {
|
||||
protected void updateTextBounds(RECT textBounds) {
|
||||
TextImportResizeTextBoundsMode resizeMode = Configuration.textImportResizeTextBoundsMode.get();
|
||||
if (resizeMode != null && (resizeMode.equals(TextImportResizeTextBoundsMode.GROW_ONLY) || resizeMode.equals(TextImportResizeTextBoundsMode.GROW_AND_SHRINK))) {
|
||||
ExportRectangle newBounds = calculateTextBounds();
|
||||
|
||||
Reference in New Issue
Block a user