diff --git a/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java b/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java index c267bc2d1..dc5bd15c2 100644 --- a/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java @@ -16,8 +16,6 @@ */ package com.jpexs.decompiler.flash.easygui; -import com.jpexs.decompiler.flash.easygui.properties.IntegerPropertyField; -import com.jpexs.decompiler.flash.easygui.properties.FloatPropertyField; import com.jpexs.decompiler.flash.DefineBeforeUsageFixer; import com.jpexs.decompiler.flash.ReadOnlyTagList; import com.jpexs.decompiler.flash.SWF; @@ -101,9 +99,9 @@ public class EasySwfPanel extends JPanel { private JPanel propertiesPanel; private static final String PROPERTIES_DOCUMENT = "Document"; - private static final String PROPERTIES_GENERAL = "General"; + private static final String PROPERTIES_INSTANCE = "Instance"; private DocumentPropertiesPanel documentPropertiesPanel; - private InstancePropertiesPanel generalPropertiesPanel; + private InstancePropertiesPanel instancePropertiesPanel; public EasySwfPanel() { setLayout(new BorderLayout()); @@ -434,9 +432,9 @@ public class EasySwfPanel extends JPanel { documentPropertiesPanel = new DocumentPropertiesPanel(undoManager); propertiesPanel.setLayout(new CardLayout()); - generalPropertiesPanel = new InstancePropertiesPanel(this, undoManager); + instancePropertiesPanel = new InstancePropertiesPanel(this, undoManager); propertiesPanel.add(documentPropertiesPanel, PROPERTIES_DOCUMENT); - propertiesPanel.add(generalPropertiesPanel, PROPERTIES_GENERAL); + propertiesPanel.add(instancePropertiesPanel, PROPERTIES_INSTANCE); rightTabbedPane.addTab(EasyStrings.translate("properties"), propertiesPanel); @@ -521,8 +519,8 @@ public class EasySwfPanel extends JPanel { cl.show(propertiesPanel, PROPERTIES_DOCUMENT); return; } - generalPropertiesPanel.update(); - cl.show(propertiesPanel, PROPERTIES_GENERAL); + instancePropertiesPanel.update(); + cl.show(propertiesPanel, PROPERTIES_INSTANCE); } private boolean transformEnabled() { @@ -542,7 +540,7 @@ public class EasySwfPanel extends JPanel { closeTimelineButton.setVisible(false); timelineLabel.setText(""); documentPropertiesPanel.setSwf(null); - generalPropertiesPanel.update(); + instancePropertiesPanel.update(); } else { SWF swf = timelined.getSwf(); documentPropertiesPanel.setSwf(swf); @@ -560,7 +558,7 @@ public class EasySwfPanel extends JPanel { timelineLabel.setText(EasyStrings.translate("timeline.item").replace("%item%", nameResolver.getTagName((Tag) timelined))); closeTimelineButton.setVisible(true); } - generalPropertiesPanel.update(); + instancePropertiesPanel.update(); } updateUndos(); } diff --git a/src/com/jpexs/decompiler/flash/easygui/properties/FloatPropertyField.java b/src/com/jpexs/decompiler/flash/easygui/properties/FloatPropertyField.java index f012af5f5..49c8aa5b6 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/FloatPropertyField.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/FloatPropertyField.java @@ -72,6 +72,10 @@ public class FloatPropertyField extends AbstractPropertyField { @Override protected String valueToText(Float value) { - return "" + value; + String ret = "" + value; + if (ret.endsWith(".0")) { + ret = ret.substring(0, ret.length() - 2); + } + return ret; } } diff --git a/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java b/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java index ac7fa699e..ab9534827 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java @@ -105,7 +105,7 @@ public abstract class AbstractPropertiesPanel extends JPanel { return cardContents.get(id).isVisible(); } - private void setCardOpened(String id, boolean opened) { + protected void setCardOpened(String id, boolean opened) { JPanel contents = cardContents.get(id); contents.setVisible(opened); contents.setMaximumSize(new Dimension(Integer.MAX_VALUE, contents.getPreferredSize().height)); diff --git a/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java b/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java index d18e7f4fa..abaf9ec41 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java @@ -196,6 +196,9 @@ public class InstancePropertiesPanel extends AbstractPropertiesPanel { propertiesPanel.setLayout(new BoxLayout(propertiesPanel, BoxLayout.Y_AXIS)); propertiesPanel.add(makeCard("positionSize", null, positionSizePanel)); + + setCardOpened("positionSize", true); + propertiesPanel.add(makeCard("colorEffect", null, colorEffectPanel)); this.swfPanel = swfPanel;