diff --git a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java index e842da313..03358a51c 100644 --- a/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/PreviewPanel.java @@ -249,6 +249,10 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel private FasterScrollPane imageTransformScrollPane; + private JPersistentSplitPane placeTransformSplitPane; + + private JPersistentSplitPane imageTransformSplitPane; + public void setReadOnly(boolean readOnly) { this.readOnly = readOnly; setDividerSize(this.readOnly ? 0 : dividerSize); @@ -507,7 +511,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel imagePanel.setLoop(Configuration.loopMedia.get()); imageTransformPanel = new TransformPanel(imagePanel); - previewCnt.add(new JPersistentSplitPane(JPersistentSplitPane.HORIZONTAL_SPLIT, imagePanel, + previewCnt.add(imageTransformSplitPane = new JPersistentSplitPane(JPersistentSplitPane.HORIZONTAL_SPLIT, imagePanel, imageTransformScrollPane = new FasterScrollPane(imageTransformPanel), Configuration.guiSplitPaneTransform2DividerLocationPercent) ); @@ -677,7 +681,7 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel placeTransformPanel = new TransformPanel(placeImagePanel); //imagePanel.setLoop(Configuration.loopMedia.get()); - previewCnt.add(new JPersistentSplitPane( + previewCnt.add(placeTransformSplitPane = new JPersistentSplitPane( JPersistentSplitPane.HORIZONTAL_SPLIT, placeImagePanel, placeTransformScrollPane = new FasterScrollPane(placeTransformPanel), @@ -1240,19 +1244,26 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel placeImagePanel.selectDepth(-1); placeTransformScrollPane.setVisible(true); + placeEditButton.setVisible(false); placeTransformButton.setVisible(false); placeSaveButton.setVisible(true); placeCancelButton.setVisible(true); Timer t = new Timer(); - t.schedule(new TimerTask() { + t.schedule(new TimerTask(){ @Override public void run() { + placeTransformSplitPane.setDividerLocation(getWidth() - 450); + } + }, 20); + t.schedule(new TimerTask() { + @Override + public void run() { placeImagePanel.freeTransformDepth(placeTag.getDepth()); placeTransformPanel.load(); } - }, 10); //add some delay before controls are hidden + }, 40); //add some delay before controls are hidden } private void saveImageTransformButtonActionPerformed(ActionEvent evt) { @@ -1355,15 +1366,22 @@ public class PreviewPanel extends JPersistentSplitPane implements TagEditorPanel imageTransformSaveButton.setVisible(true); imageTransformCancelButton.setVisible(true); imageTransformScrollPane.setVisible(true); + Timer t = new Timer(); + t.schedule(new TimerTask() { + @Override + public void run() { + imageTransformSplitPane.setDividerLocation(getWidth() - 450); + } + }, 20); t.schedule(new TimerTask() { @Override public void run() { imagePanel.freeTransformDepth(placeTag2.getDepth()); imageTransformPanel.load(); } - }, 10); //add some delay before controls are hidden + }, 40); //add some delay before controls are hidden } diff --git a/src/com/jpexs/decompiler/flash/gui/TransformPanel.java b/src/com/jpexs/decompiler/flash/gui/TransformPanel.java index f92f99e56..f2ff8ce74 100644 --- a/src/com/jpexs/decompiler/flash/gui/TransformPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/TransformPanel.java @@ -70,31 +70,33 @@ import javax.swing.border.BevelBorder; */ public class TransformPanel extends JPanel { - private JTextField moveHorizontalTextField = new JTextField(8); - private JTextField moveVerticalTextField = new JTextField(8); + private static final int NUMBER_COLS = 7; + + private JTextField moveHorizontalTextField = new JTextField(NUMBER_COLS); + private JTextField moveVerticalTextField = new JTextField(NUMBER_COLS); private JComboBox moveUnitComboBox = new JComboBox<>(); private JCheckBox moveRelativeCheckBox = new JCheckBox(AppStrings.translate("transform.move.relative")); - private JTextField scaleWidthTextField = new JTextField(formatDouble(100), 8); - private JTextField scaleHeightTextField = new JTextField(formatDouble(100), 8); + private JTextField scaleWidthTextField = new JTextField(formatDouble(100),NUMBER_COLS); + private JTextField scaleHeightTextField = new JTextField(formatDouble(100), NUMBER_COLS); private JComboBox scaleUnitComboBox = new JComboBox<>(); private JCheckBox scaleProportionallyCheckBox = new JCheckBox(AppStrings.translate("transform.scale.proportionally")); - private JTextField rotateTextField = new JTextField(formatDouble(0), 8); + private JTextField rotateTextField = new JTextField(formatDouble(0), NUMBER_COLS); private JComboBox rotateUnitComboBox = new JComboBox<>(); private JToggleButton rotateAntiClockwiseToggleButton = new JToggleButton(View.getIcon("rotateanticlockwise16")); private JToggleButton rotateClockwiseToggleButton = new JToggleButton(View.getIcon("rotateclockwise16")); - private JTextField skewHorizontalTextField = new JTextField(formatDouble(0), 8); - private JTextField skewVerticalTextField = new JTextField(formatDouble(0), 8); + private JTextField skewHorizontalTextField = new JTextField(formatDouble(0), NUMBER_COLS); + private JTextField skewVerticalTextField = new JTextField(formatDouble(0), NUMBER_COLS); private JComboBox skewUnitComboBox = new JComboBox<>(); - private JTextField matrixATextField = new JTextField(formatDouble(1), 8); - private JTextField matrixBTextField = new JTextField(formatDouble(0), 8); - private JTextField matrixCTextField = new JTextField(formatDouble(0), 8); - private JTextField matrixDTextField = new JTextField(formatDouble(1), 8); - private JTextField matrixETextField = new JTextField(formatDouble(0), 8); - private JTextField matrixFTextField = new JTextField(formatDouble(0), 8); + private JTextField matrixATextField = new JTextField(formatDouble(1), NUMBER_COLS); + private JTextField matrixBTextField = new JTextField(formatDouble(0), NUMBER_COLS); + private JTextField matrixCTextField = new JTextField(formatDouble(0), NUMBER_COLS); + private JTextField matrixDTextField = new JTextField(formatDouble(1), NUMBER_COLS); + private JTextField matrixETextField = new JTextField(formatDouble(0), NUMBER_COLS); + private JTextField matrixFTextField = new JTextField(formatDouble(0), NUMBER_COLS); private JCheckBox matrixEditCurrentCheckBox = new JCheckBox(AppStrings.translate("transform.matrix.editCurrent")); private ImagePanel imagePanel; @@ -713,9 +715,9 @@ public class TransformPanel extends JPanel { private JPanel makeClearApplyPanel(ActionListener onApply, ActionListener onClear) { JPanel buttonsPanel = new JPanel(new FlowLayout()); - JButton clearButton = new JButton("Clear"); + JButton clearButton = new JButton(AppStrings.translate("transform.clear")); clearButton.addActionListener(onClear); - JButton applyButton = new JButton("Apply"); + JButton applyButton = new JButton(AppStrings.translate("transform.apply")); applyButton.addActionListener(onApply); buttonsPanel.add(clearButton); buttonsPanel.add(applyButton); diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties index 011bcb22c..ea8c93474 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame.properties @@ -1037,4 +1037,7 @@ transform.matrix.c = C transform.matrix.d = D transform.matrix.e = E transform.matrix.f = F -transform.matrix.editCurrent = Edit current matrix \ No newline at end of file +transform.matrix.editCurrent = Edit current matrix + +transform.apply = Apply +transform.clear = Clear \ No newline at end of file diff --git a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties index 5692433ef..55133c5fa 100644 --- a/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties +++ b/src/com/jpexs/decompiler/flash/gui/locales/MainFrame_cs.properties @@ -1022,4 +1022,7 @@ transform.matrix.c = C transform.matrix.d = D transform.matrix.e = E transform.matrix.f = F -transform.matrix.editCurrent = Upravit sou\u010dasnou matici \ No newline at end of file +transform.matrix.editCurrent = Upravit sou\u010dasnou matici + +transform.apply = Pou\u017e\u00edt +transform.clear = Vy\u010distit \ No newline at end of file