mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 05:10:52 +00:00
Fixed code style
This commit is contained in:
@@ -79,7 +79,7 @@ public class DepthState {
|
||||
private final SWF swf;
|
||||
|
||||
public Frame frame;
|
||||
|
||||
|
||||
public Frame placeFrame;
|
||||
|
||||
public PlaceObjectTypeTag placeObjectTag;
|
||||
@@ -253,6 +253,6 @@ public class DepthState {
|
||||
if (!Objects.equals(this.clipActions, other.clipActions)) {
|
||||
return false;
|
||||
}
|
||||
return Arrays.equals(this.amfData, other.amfData);
|
||||
}
|
||||
return Arrays.equals(this.amfData, other.amfData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,10 +26,11 @@ import java.util.Objects;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class Scene implements TreeItem {
|
||||
|
||||
private SWF swf;
|
||||
public int startFrame;
|
||||
public int endFrame;
|
||||
public String name;
|
||||
public String name;
|
||||
|
||||
public Scene(SWF swf, int startFrame, int endFrame, String name) {
|
||||
this.swf = swf;
|
||||
@@ -37,11 +38,11 @@ public class Scene implements TreeItem {
|
||||
this.endFrame = endFrame;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
public int getSceneFrameCount() {
|
||||
return endFrame - startFrame + 1;
|
||||
return endFrame - startFrame + 1;
|
||||
}
|
||||
|
||||
|
||||
public SceneFrame getSceneFrame(int sceneFrameIndex) {
|
||||
if (sceneFrameIndex >= getSceneFrameCount()) {
|
||||
throw new IndexOutOfBoundsException("Invalid sceneframe index");
|
||||
@@ -57,7 +58,7 @@ public class Scene implements TreeItem {
|
||||
@Override
|
||||
public boolean isModified() {
|
||||
return false; //??
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@@ -88,5 +89,5 @@ public class Scene implements TreeItem {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Objects;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SceneFrame implements TreeItem {
|
||||
|
||||
private final SWF swf;
|
||||
private final Scene scene;
|
||||
private final int realFrameIndex;
|
||||
@@ -34,12 +35,12 @@ public class SceneFrame implements TreeItem {
|
||||
this.swf = swf;
|
||||
this.scene = scene;
|
||||
this.realFrameIndex = realFrameIndex;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int getSceneFrameIndex() {
|
||||
return realFrameIndex - scene.startFrame;
|
||||
}
|
||||
|
||||
|
||||
public Frame getFrame() {
|
||||
return swf.getTimeline().getFrame(realFrameIndex);
|
||||
}
|
||||
@@ -83,5 +84,5 @@ public class SceneFrame implements TreeItem {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(this.scene, other.scene);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-9
@@ -32,15 +32,16 @@ import java.util.List;
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class SoundStreamFrameRange implements TreeItem, SoundTag {
|
||||
|
||||
public int startFrame;
|
||||
public int endFrame;
|
||||
public List<SoundStreamBlockTag> blocks = new ArrayList<>();
|
||||
|
||||
public List<SoundStreamBlockTag> blocks = new ArrayList<>();
|
||||
|
||||
private final SoundStreamHeadTypeTag head;
|
||||
|
||||
|
||||
public SoundStreamFrameRange(SoundStreamHeadTypeTag head) {
|
||||
this.head = head;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Openable getOpenable() {
|
||||
@@ -105,7 +106,7 @@ public class SoundStreamFrameRange implements TreeItem, SoundTag {
|
||||
public String getCharacterExportFileName() {
|
||||
return head.getCharacterExportFileName() + "_" + (startFrame + 1) + "-" + (endFrame + 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "SoundStreamBlocks";
|
||||
@@ -153,18 +154,18 @@ public class SoundStreamFrameRange implements TreeItem, SoundTag {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SoundStreamBlocks (frame " + (startFrame + 1) + " - " + (endFrame + 1) + ")";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return head.isReadOnly();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlaExportName() {
|
||||
return head.getFlaExportName() + "_" + (startFrame + 1) + "-" + (endFrame + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInitialLatency() {
|
||||
return 0;
|
||||
|
||||
@@ -128,8 +128,8 @@ public class Timeline {
|
||||
private boolean initialized = false;
|
||||
|
||||
private Map<String, Integer> labelToFrame = new HashMap<>();
|
||||
|
||||
private List<Scene> scenes = new ArrayList<>();
|
||||
|
||||
private List<Scene> scenes = new ArrayList<>();
|
||||
|
||||
public static final int DRAW_MODE_ALL = 0;
|
||||
public static final int DRAW_MODE_SHAPES = 1;
|
||||
@@ -148,9 +148,9 @@ public class Timeline {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param index 0-based frame index
|
||||
* @return
|
||||
* @return
|
||||
*/
|
||||
public synchronized Frame getFrame(int index) {
|
||||
ensureInitialized();
|
||||
@@ -285,7 +285,7 @@ public class Timeline {
|
||||
frame.layersChanged = true;
|
||||
boolean newFrameNeeded = false;
|
||||
scenes = new ArrayList<>();
|
||||
Scene prevScene = null;
|
||||
Scene prevScene = null;
|
||||
for (Tag t : timelined.getTags()) {
|
||||
newFrameNeeded = true;
|
||||
boolean isNested = ShowFrameTag.isNestedTagType(t.getId());
|
||||
@@ -305,9 +305,9 @@ public class Timeline {
|
||||
prevScene.endFrame = ioffset - 1;
|
||||
}
|
||||
prevScene = currentScene;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (t instanceof ASMSourceContainer) {
|
||||
ASMSourceContainer asmSourceContainer = (ASMSourceContainer) t;
|
||||
if (!asmSourceContainer.getSubItems().isEmpty()) {
|
||||
@@ -382,7 +382,7 @@ public class Timeline {
|
||||
} else {
|
||||
fl.key = characterId != -1 || className != null;
|
||||
}
|
||||
|
||||
|
||||
if (po.flagMove()) {
|
||||
MATRIX matrix2 = po.getMatrix();
|
||||
if (matrix2 != null) {
|
||||
@@ -439,7 +439,7 @@ public class Timeline {
|
||||
fl.clipDepth = po.getClipDepth();
|
||||
fl.isVisible = po.isVisible();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (t instanceof RemoveTag) {
|
||||
RemoveTag r = (RemoveTag) t;
|
||||
@@ -463,7 +463,7 @@ public class Timeline {
|
||||
if (newFrameNeeded) {
|
||||
frames.add(frame);
|
||||
}
|
||||
|
||||
|
||||
if (prevScene != null) {
|
||||
prevScene.endFrame = frames.size() - 1;
|
||||
}
|
||||
@@ -620,7 +620,7 @@ public class Timeline {
|
||||
ranges = new ArrayList<>();
|
||||
range = new SoundStreamFrameRange(head);
|
||||
range.startFrame = -1;
|
||||
range.endFrame = -1;
|
||||
range.endFrame = -1;
|
||||
numFramesNoSound = MIN_NUM_FRAMES_NO_SOUND;
|
||||
soundStreamRanges.put(containerId, ranges);
|
||||
continue;
|
||||
@@ -635,13 +635,13 @@ public class Timeline {
|
||||
DefineSpriteTag sprite = (DefineSpriteTag) t;
|
||||
populateSoundStreamBlocks(sprite.getCharacterId(), sprite.getTags());
|
||||
}
|
||||
|
||||
|
||||
if (t instanceof ShowFrameTag) {
|
||||
frame++;
|
||||
if (frameHasSound) {
|
||||
numFramesNoSound = 0;
|
||||
} else {
|
||||
numFramesNoSound++;
|
||||
numFramesNoSound++;
|
||||
}
|
||||
frameHasSound = false;
|
||||
if (sceneOffsets.contains(frame) && range != null) {
|
||||
@@ -661,20 +661,20 @@ public class Timeline {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t instanceof SoundStreamBlockTag) {
|
||||
if (t instanceof SoundStreamBlockTag) {
|
||||
if (numFramesNoSound >= MIN_NUM_FRAMES_NO_SOUND && range.endFrame > -1) {
|
||||
ranges.add(range);
|
||||
range = new SoundStreamFrameRange(head);
|
||||
range.startFrame = -1;
|
||||
range.endFrame = -1;
|
||||
}
|
||||
range.endFrame = -1;
|
||||
}
|
||||
range.blocks.add((SoundStreamBlockTag) t);
|
||||
if (range.startFrame == -1) {
|
||||
range.startFrame = frame;
|
||||
}
|
||||
range.endFrame = frame;
|
||||
frameHasSound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (range != null && ranges != null && range.endFrame > -1) {
|
||||
ranges.add(range);
|
||||
@@ -850,7 +850,7 @@ public class Timeline {
|
||||
|
||||
double deltaXMax = 0;
|
||||
double deltaYMax = 0;
|
||||
|
||||
|
||||
if (filters != null && filters.size() > 0) {
|
||||
// calculate size after applying the filters
|
||||
for (FILTER filter : filters) {
|
||||
@@ -949,7 +949,7 @@ public class Timeline {
|
||||
if (blendMode > 1) {
|
||||
clrTrans2 = null;
|
||||
}
|
||||
|
||||
|
||||
if (filters != null && !filters.isEmpty()) {
|
||||
clrTrans2 = null;
|
||||
}
|
||||
@@ -1133,7 +1133,7 @@ public class Timeline {
|
||||
}
|
||||
|
||||
if (clipChanged) {
|
||||
if (clips.size() > 0) {
|
||||
if (clips.size() > 0) {
|
||||
Area clip = null;
|
||||
if (prevClip != null) {
|
||||
clip = new Area(prevClip);
|
||||
@@ -1543,7 +1543,7 @@ public class Timeline {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public List<Scene> getScenes() {
|
||||
ensureInitialized();
|
||||
return new ArrayList<>(scenes);
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.jpexs.decompiler.flash.tags.base.BoundedTag;
|
||||
public interface Timelined extends BoundedTag {
|
||||
|
||||
public SWF getSwf();
|
||||
|
||||
|
||||
public Timeline getTimeline();
|
||||
|
||||
public void resetTimeline();
|
||||
|
||||
Reference in New Issue
Block a user