From 602ce1cf4ad221b52f0543a1dcf49c0f39f52cfa Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 23 Aug 2017 14:05:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-3815=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=A0=B7=E5=BC=8F=E7=BC=A9=E8=BF=9B=E7=AD=89=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=95=B0=E5=AD=97=E6=AF=8F=E6=AC=A1=E5=8F=AA=E8=83=BD?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E4=B8=80=E4=BD=8D=20REPORT-4025=20[9.0?= =?UTF-8?q?=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92]=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=88=86=E9=A1=B5=E4=B8=AD=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8B=BE=E9=80=89=E9=A1=B9=E6=97=A0=E6=B3=95=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=8B=BE=E7=BA=BF=20REPORT-4022=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E9=80=89=E4=B8=AD=E4=B8=80=E7=89=87?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=97=B6=E5=AF=B9=E9=BD=90=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E7=BD=AE=E5=BC=82=E5=B8=B8=E5=A6=82=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=9B=BE=E7=89=87=20=E6=A0=B9=E6=8D=AE=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E8=A6=81=E6=B1=82=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E6=9D=A1=E8=BE=93=E5=85=A5=E6=A1=86=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E9=99=90=E5=88=B60-400=E7=9A=84=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellElementPropertyPane.java | 3 +-- .../cell/settingpane/CellOtherSetPane.java | 14 +++++++------- .../com/fr/design/mainframe/JSliderPane.java | 17 ++++++++++++++--- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index a607538d6..9e22680cf 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -134,8 +134,7 @@ public class CellElementPropertyPane extends DockingView { } public void reInit(ElementCasePane ePane) { - if (titlePane.getParent() == null) { // 如果处于隐藏状态,则让其显示 -// this.add(titlePane, BorderLayout.NORTH); + if (cellElementEditPane.getParent() == null) { // 如果处于隐藏状态,则让其显示 this.add(cellElementEditPane, BorderLayout.CENTER); } cellElementEditPane.populate(ePane); diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 53aa5e3dc..6be46f1c5 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -10,7 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; @@ -48,9 +48,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private UIComboBox showContent; - private UIPropertyTextField tooltipTextField; + private UITextField tooltipTextField; - private UIPropertyTextField fileNameTextField; + private UITextField fileNameTextField; // 分页 private UICheckBox pageBeforeRowCheckBox; @@ -229,8 +229,8 @@ public class CellOtherSetPane extends AbstractCellAttrPane { final JPanel fileNamePane = new JPanel(fileNameLayout); JPanel fileNameCCPane = new JPanel(new BorderLayout(4, 0)); fileNameCCPane.add(new UILabel(Inter.getLocText("FR-Designer_File_Name_For_Download")), BorderLayout.WEST); - fileNameTextField = new UIPropertyTextField(); - tooltipTextField = new UIPropertyTextField(); + fileNameTextField = new UITextField(); + tooltipTextField = new UITextField(); tooltipTextField.getUI(); fileNamePane.add(new JPanel(), "none"); fileNamePane.add(fileNameCCPane, "content"); @@ -452,10 +452,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Page_After_Column"))) { cellPageAttr.setPageAfterColumn(this.pageAfterColumnCheckBox.isSelected()); } - if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Can_Break_On_Paginate"))) { + if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Can_Break_On_Paginate"))) { cellPageAttr.setCanBreakOnPaginate(canBreakOnPaginateCheckBox.isSelected()); } - if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellWrite_Repeat_Content_When_Paging"))) { + if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_CellPage_Repeat_Content_When_Paging"))) { cellPageAttr.setRepeat(this.repeatCheckBox.isSelected()); } diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 7f3ad51f4..9d23ecf5e 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -17,6 +17,8 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.plaf.basic.BasicSliderUI; +import javax.swing.text.DefaultFormatterFactory; +import javax.swing.text.NumberFormatter; import java.awt.*; import java.awt.event.*; import java.math.BigDecimal; @@ -77,6 +79,15 @@ public class JSliderPane extends JPanel { this.setLayout(new BorderLayout()); initSlider(); initShowValSpinner(); + //MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧 + JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); + showValSpinner.setEditor(editor); + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.setEditable(true); + DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory(); + NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); + formatter.setAllowsInvalid(false); + initDownUpButton(); initShowValButton(); initUIRadioButton(); @@ -114,7 +125,7 @@ public class JSliderPane extends JPanel { } private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)) { + showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 10, FOUR_HUNDRED, 1)) { public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } @@ -221,7 +232,7 @@ public class JSliderPane extends JPanel { new Component[]{fiveTenButton, null}, new Component[]{twoFiveButton, null}, new Component[]{selfAdaptButton, null}, - new Component[]{customButton, createSpinnerPanel()} + new Component[]{createSpinnerPanel(), customButton} }; dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); dialogContentPanel.setBackground(BACK_COLOR); @@ -464,7 +475,7 @@ class JSliderPaneUI extends BasicSliderUI { class PopupPane extends JPopupMenu { private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 192; + private static final int DIALOG_HEIGHT = 292; PopupPane(JButton b, JPanel dialogContentPanel) { this.add(dialogContentPanel, BorderLayout.CENTER); From c655df1ccb49fb2263715eb3bd3e2629949334dd Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 23 Aug 2017 14:51:55 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E8=A6=81=E6=B1=82=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BC=A9=E6=94=BE?= =?UTF-8?q?=E6=9D=A1=E8=BE=93=E5=85=A5=E6=A1=86=E6=9D=A1=E4=BB=B6=E9=99=90?= =?UTF-8?q?=E5=88=B60-400=E7=9A=84=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JFormSliderPane.java | 13 ++++++++++++- .../src/com/fr/design/mainframe/JSliderPane.java | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 3a9e5e6dd..9509e23b6 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -16,6 +16,8 @@ import com.fr.general.Inter; import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.text.DefaultFormatterFactory; +import javax.swing.text.NumberFormatter; import java.awt.*; import java.awt.event.*; import java.math.BigDecimal; @@ -75,6 +77,15 @@ public class JFormSliderPane extends JPanel { this.setLayout(new BorderLayout()); initSlider(); initShowValSpinner(); + //MoMeak:控制只能输入10-400 + JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); + showValSpinner.setEditor(editor); + JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); + textField.setEditable(true); + DefaultFormatterFactory factory = (DefaultFormatterFactory) textField .getFormatterFactory(); + NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); + formatter.setAllowsInvalid(false); + initDownUpButton(); initShowValButton(); initUIRadioButton(); @@ -111,7 +122,7 @@ public class JFormSliderPane extends JPanel { } private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, TEN, FOUR_HUNDRED, 1)){ + showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)){ public Point getToolTipLocation(MouseEvent event){ return new Point(event.getX(), event.getY() - TOOLTIP_Y); } diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 9d23ecf5e..7de271d6e 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -79,7 +79,7 @@ public class JSliderPane extends JPanel { this.setLayout(new BorderLayout()); initSlider(); initShowValSpinner(); - //MoMeak:控制只能输入10-400,但是用起来感觉不舒服,先注释掉吧 + //MoMeak:控制只能输入10-400 JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); showValSpinner.setEditor(editor); JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); @@ -125,7 +125,7 @@ public class JSliderPane extends JPanel { } private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 10, FOUR_HUNDRED, 1)) { + showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) { public Point getToolTipLocation(MouseEvent event) { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } @@ -232,7 +232,7 @@ public class JSliderPane extends JPanel { new Component[]{fiveTenButton, null}, new Component[]{twoFiveButton, null}, new Component[]{selfAdaptButton, null}, - new Component[]{createSpinnerPanel(), customButton} + new Component[]{customButton, createSpinnerPanel()} }; dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); dialogContentPanel.setBackground(BACK_COLOR); @@ -475,7 +475,7 @@ class JSliderPaneUI extends BasicSliderUI { class PopupPane extends JPopupMenu { private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 292; + private static final int DIALOG_HEIGHT = 192; PopupPane(JButton b, JPanel dialogContentPanel) { this.add(dialogContentPanel, BorderLayout.CENTER); From 4afd2d8ffa9c34d51f03e2507850cbf5d983cd54 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 23 Aug 2017 15:26:12 +0800 Subject: [PATCH 3/3] PMD --- .../src/com/fr/design/mainframe/CellElementPropertyPane.java | 4 ++-- .../src/com/fr/design/mainframe/JFormSliderPane.java | 4 ++-- designer_base/src/com/fr/design/mainframe/JSliderPane.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java index 9e22680cf..dbf166048 100644 --- a/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellElementPropertyPane.java @@ -79,7 +79,7 @@ public class CellElementPropertyPane extends DockingView { @Override public void fireTitleChange(String addName) { - title.setText(Inter.getLocText("CellElement-Property_Table") + '-' + addName); + title.setText(Inter.getLocText("FR-Designer_CellElement_Property_Table") + '-' + addName); } }; @@ -150,7 +150,7 @@ public class CellElementPropertyPane extends DockingView { @Override public String getViewTitle() { - return Inter.getLocText("CellElement-Property_Table"); + return Inter.getLocText("FR-Designer_CellElement_Property_Table"); } @Override diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 9509e23b6..c796baa6c 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -336,7 +336,7 @@ public class JFormSliderPane extends JPanel { public void actionPerformed(ActionEvent e) { showValue = (int) showValSpinner.getValue(); isButtonOrIsTxt = true; - if (e.getActionCommand().equals("less")) { + if ("less".equals(e.getActionCommand())) { int newDownVal = showValue - TEN; if (newDownVal >= TEN) { showValue = newDownVal; @@ -346,7 +346,7 @@ public class JFormSliderPane extends JPanel { showValSpinner.setValue(TEN); } } - if (e.getActionCommand().equals("more")) { + if ("more".equals(e.getActionCommand())) { int newUpVal = showValue + TEN; if (newUpVal <= FOUR_HUNDRED) { showValue = newUpVal; diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index 7de271d6e..006a38ce4 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -342,7 +342,7 @@ public class JSliderPane extends JPanel { public void actionPerformed(ActionEvent e) { showValue = (int) showValSpinner.getValue(); isButtonOrIsTxt = true; - if (e.getActionCommand().equals("less")) { + if ("less".equals(e.getActionCommand())) { int newDownVal = showValue - TEN; if (newDownVal >= TEN) { showValue = newDownVal; @@ -352,7 +352,7 @@ public class JSliderPane extends JPanel { showValSpinner.setValue(TEN); } } - if (e.getActionCommand().equals("more")) { + if ("more".equals(e.getActionCommand())) { int newUpVal = showValue + TEN; if (newUpVal <= FOUR_HUNDRED) { showValue = newUpVal;