diff --git a/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java b/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java index 7ff5752da..c267bc2d1 100644 --- a/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/EasySwfPanel.java @@ -23,7 +23,7 @@ import com.jpexs.decompiler.flash.ReadOnlyTagList; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.configuration.Configuration; import com.jpexs.decompiler.flash.easygui.properties.panels.DocumentPropertiesPanel; -import com.jpexs.decompiler.flash.easygui.properties.panels.GeneralPropertiesPanel; +import com.jpexs.decompiler.flash.easygui.properties.panels.InstancePropertiesPanel; import com.jpexs.decompiler.flash.exporters.commonshape.Matrix; import com.jpexs.decompiler.flash.gui.FasterScrollPane; import com.jpexs.decompiler.flash.gui.ImagePanel; @@ -103,7 +103,7 @@ public class EasySwfPanel extends JPanel { private static final String PROPERTIES_DOCUMENT = "Document"; private static final String PROPERTIES_GENERAL = "General"; private DocumentPropertiesPanel documentPropertiesPanel; - private GeneralPropertiesPanel generalPropertiesPanel; + private InstancePropertiesPanel generalPropertiesPanel; public EasySwfPanel() { setLayout(new BorderLayout()); @@ -434,7 +434,7 @@ public class EasySwfPanel extends JPanel { documentPropertiesPanel = new DocumentPropertiesPanel(undoManager); propertiesPanel.setLayout(new CardLayout()); - generalPropertiesPanel = new GeneralPropertiesPanel(this, undoManager); + generalPropertiesPanel = new InstancePropertiesPanel(this, undoManager); propertiesPanel.add(documentPropertiesPanel, PROPERTIES_DOCUMENT); propertiesPanel.add(generalPropertiesPanel, PROPERTIES_GENERAL); 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 973e2d65d..ac7fa699e 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/panels/AbstractPropertiesPanel.java @@ -47,13 +47,9 @@ public abstract class AbstractPropertiesPanel extends JPanel { private final Map cardContents = new LinkedHashMap<>(); private final Map cardPlusMinusLabels = new LinkedHashMap<>(); - + public AbstractPropertiesPanel(String titleIdentifier) { - setLayout(new BorderLayout()); - - JLabel documentLabel = new JLabel(EasyStrings.translate("properties." + titleIdentifier)); - add(documentLabel, BorderLayout.NORTH); - this.titleIdentifier = titleIdentifier; + this.titleIdentifier = titleIdentifier; } protected String formatPropertyName(String id) { diff --git a/src/com/jpexs/decompiler/flash/easygui/properties/panels/DocumentPropertiesPanel.java b/src/com/jpexs/decompiler/flash/easygui/properties/panels/DocumentPropertiesPanel.java index 72f2f73de..72ebcc802 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/panels/DocumentPropertiesPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/panels/DocumentPropertiesPanel.java @@ -45,6 +45,7 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.List; +import javax.swing.BorderFactory; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JLabel; @@ -94,6 +95,11 @@ public class DocumentPropertiesPanel extends AbstractPropertiesPanel { public DocumentPropertiesPanel(UndoManager undoManager) { super("document"); + setLayout(new BorderLayout()); + + JLabel documentLabel = new JLabel(EasyStrings.translate("properties.document")); + documentLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + add(documentLabel, BorderLayout.NORTH); FlowLayout layout = new FlowLayout(SwingConstants.WEST); layout.setHgap(0); diff --git a/src/com/jpexs/decompiler/flash/easygui/properties/panels/GeneralPropertiesPanel.java b/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java similarity index 95% rename from src/com/jpexs/decompiler/flash/easygui/properties/panels/GeneralPropertiesPanel.java rename to src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java index 4be2c1437..d18e7f4fa 100644 --- a/src/com/jpexs/decompiler/flash/easygui/properties/panels/GeneralPropertiesPanel.java +++ b/src/com/jpexs/decompiler/flash/easygui/properties/panels/InstancePropertiesPanel.java @@ -19,14 +19,13 @@ package com.jpexs.decompiler.flash.easygui.properties.panels; import com.jpexs.decompiler.flash.easygui.ChangeDoableOperation; import com.jpexs.decompiler.flash.easygui.EasyStrings; import com.jpexs.decompiler.flash.easygui.EasySwfPanel; +import com.jpexs.decompiler.flash.easygui.EasyTagNameResolver; import com.jpexs.decompiler.flash.easygui.UndoManager; import com.jpexs.decompiler.flash.easygui.properties.FloatPropertyField; import com.jpexs.decompiler.flash.easygui.properties.IntegerPropertyField; import com.jpexs.decompiler.flash.easygui.properties.PropertyValidationInteface; import com.jpexs.decompiler.flash.exporters.commonshape.Matrix; -import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.BoundsChangeListener; -import com.jpexs.decompiler.flash.gui.ImagePanel; import com.jpexs.decompiler.flash.gui.RegistrationPointPosition; import com.jpexs.decompiler.flash.tags.base.PlaceObjectTypeTag; import com.jpexs.decompiler.flash.tags.converters.PlaceObjectTypeConverter; @@ -44,6 +43,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; +import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JLabel; import javax.swing.JPanel; @@ -54,7 +54,7 @@ import javax.swing.event.ChangeListener; * * @author JPEXS */ -public class GeneralPropertiesPanel extends AbstractPropertiesPanel { +public class InstancePropertiesPanel extends AbstractPropertiesPanel { private final FloatPropertyField xPropertyField = new FloatPropertyField(0, -8192, 8192); private final FloatPropertyField yPropertyField = new FloatPropertyField(0, -8192, 8192); @@ -75,8 +75,16 @@ public class GeneralPropertiesPanel extends AbstractPropertiesPanel { private Rectangle2D lastBounds = null; - public GeneralPropertiesPanel(EasySwfPanel swfPanel, UndoManager undoManager) { - super("general"); + private JLabel instanceLabel; + + public InstancePropertiesPanel(EasySwfPanel swfPanel, UndoManager undoManager) { + super("instance"); + setLayout(new BorderLayout()); + + instanceLabel = new JLabel(EasyStrings.translate("properties.instance.none")); + instanceLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + add(instanceLabel, BorderLayout.NORTH); + GridBagLayout gridBag; GridBagConstraints gbc; @@ -387,11 +395,19 @@ public class GeneralPropertiesPanel extends AbstractPropertiesPanel { public void update() { List dss = swfPanel.getSelectedDepthStates(); if (dss == null || dss.isEmpty()) { + instanceLabel.setText(EasyStrings.translate("properties.instance.none")); propertiesPanel.setVisible(false); return; } propertiesPanel.setVisible(true); + if (dss.size() == 1) { + EasyTagNameResolver resolver = new EasyTagNameResolver(); + instanceLabel.setText(EasyStrings.translate("properties.instance.single").replace("%item%", resolver.getTagName(dss.get(0).getCharacter()))); + } else { + instanceLabel.setText(EasyStrings.translate("properties.instance.multiple").replace("%count%", "" + dss.size())); + } + //swfPanel.getStagePanel().gett Set alphaPercent = new HashSet<>(); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/EasyPanel.properties b/src/com/jpexs/decompiler/flash/gui/locales/EasyPanel.properties index 9b78cbebb..d3e7a48cd 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/EasyPanel.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/EasyPanel.properties @@ -73,21 +73,23 @@ timeline.item.cancel = Cancel - Click to go to main timeline properties = Properties properties.document = Document -properties.general = General +properties.instance.single = Instance of %item% +properties.instance.multiple = %count% instances +properties.instance.none = No instance -properties.general.header.positionSize = Position and size -properties.general.header.colorEffect = Color effect +properties.instance.header.positionSize = Position and size +properties.instance.header.colorEffect = Color effect property.label = %item%: -property.general.item = Item -property.general.colorEffect.alpha = Alpha -property.general.colorEffect.red = Red -property.general.colorEffect.green = Green -property.general.colorEffect.blue = Blue -property.general.positionSize.x = X -property.general.positionSize.y = Y -property.general.positionSize.width = W -property.general.positionSize.height = H +property.instance.item = Item +property.instance.colorEffect.alpha = Alpha +property.instance.colorEffect.red = Red +property.instance.colorEffect.green = Green +property.instance.colorEffect.blue = Blue +property.instance.positionSize.x = X +property.instance.positionSize.y = Y +property.instance.positionSize.width = W +property.instance.positionSize.height = H