From 3383ba5eae761458ae4251625c1e46c3b844a754 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 30 Aug 2017 16:13:07 +0800 Subject: [PATCH 01/11] =?UTF-8?q?REPORT-3928=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=A8=A1=E6=9D=BF=E6=96=B0=E5=BB=BA6?= =?UTF-8?q?=E4=B8=AAsheet=EF=BC=8C=E6=92=A4=E9=94=80=E4=B8=89=E6=AC=A1?= =?UTF-8?q?=E5=90=8E=E5=86=8D=E7=82=B9=E5=87=BB=E6=96=B0=E5=BB=BAsheet?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=97=A0=E6=95=88=20REPORT-3989=20[9.0?= =?UTF-8?q?=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92]=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7=E8=A1=A8=E6=A0=B7=E5=BC=8F=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=99=BE=E5=88=86=E6=AF=94=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=BC=82=E5=B8=B8=20REPORT-4047=20[9.0?= =?UTF-8?q?=E4=B8=80=E8=BD=AE=E5=9B=9E=E5=BD=92]=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=86=8D=E5=AF=B9=E5=8C=85=E5=90=AB=E6=AD=A4?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E7=9A=84=E4=B8=80=E7=89=87=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=EF=BC=8C?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/settingpane/CellOtherSetPane.java | 7 ++- .../com/fr/design/gui/style/BorderPane.java | 57 +++++++++++++++++-- .../fr/design/mainframe/JFormSliderPane.java | 8 +-- .../com/fr/design/mainframe/JSliderPane.java | 8 +-- .../design/style/color/NewColorSelectBox.java | 19 ++++++- 5 files changed, 81 insertions(+), 18 deletions(-) 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 b6826a861..951333895 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -82,7 +82,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { JPanel downPane = new JPanel(new BorderLayout()); downPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), HEAD_WDITH, HEAD_HEIGTH, seniorPane()), BorderLayout.NORTH); downPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Pagination"), HEAD_WDITH, HEAD_HEIGTH, pagePane()), BorderLayout.CENTER); - JPanel contentPane = new JPanel(new BorderLayout(0, 10)); + JPanel contentPane = new JPanel(new BorderLayout(0, 0)); contentPane.add(new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), HEAD_WDITH, HEAD_HEIGTH, basicPane()), BorderLayout.NORTH); contentPane.add(downPane, BorderLayout.CENTER); initAllNames(); @@ -96,13 +96,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane { autoHeightCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); autoWidthCheckBox.setBorder(UIConstants.CELL_ATTR_ZEROBORDER); double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p}; double[] columnSize = {p}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ new Component[]{null}, new Component[]{autoHeightCheckBox}, new Component[]{autoWidthCheckBox}, + new Component[]{null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_LARGE); diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index 1390ee9cb..59eecbbb1 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -8,6 +8,8 @@ import com.fr.base.BaseUtils; import com.fr.base.CellBorderStyle; import com.fr.base.Style; import com.fr.design.constants.LayoutConstants; +import com.fr.design.event.GlobalNameListener; +import com.fr.design.event.GlobalNameObserver; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; @@ -16,6 +18,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.Constants; import com.fr.stable.CoreConstants; @@ -29,7 +32,7 @@ import java.awt.*; * @author zhou * @since 2012-5-28下午6:22:04 */ -public class BorderPane extends AbstractBasicStylePane { +public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { private boolean insideMode = false; private UIToggleButton topToggleButton; @@ -48,6 +51,7 @@ public class BorderPane extends AbstractBasicStylePane { private JPanel borderPanel; private JPanel backgroundPanel; private BackgroundPane backgroundPane; + private GlobalNameListener globalNameListener = null; public BorderPane() { this.initComponents(); @@ -55,7 +59,7 @@ public class BorderPane extends AbstractBasicStylePane { protected void initComponents() { initButtonsWithIcon(); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(0, 0)); JPanel externalPane = new JPanel(new GridLayout(0, 4)); externalPane.add(topToggleButton); externalPane.add(leftToggleButton); @@ -89,7 +93,7 @@ public class BorderPane extends AbstractBasicStylePane { backgroundPane = new BackgroundPane(); backgroundPanel = new UIExpandablePane(Inter.getLocText("FR-Designer_Background"), 280, 24, backgroundPane); this.add(backgroundPanel, BorderLayout.CENTER); - + initAllNames(); outerToggleButton.addChangeListener(outerToggleButtonChangeListener); innerToggleButton.addChangeListener(innerToggleButtonChangeListener); } @@ -125,6 +129,19 @@ public class BorderPane extends AbstractBasicStylePane { this.currentLineColorPane = new NewColorSelectBox(100); } + private void initAllNames() { + currentLineCombo.setGlobalName("currentLineCombo"); + currentLineColorPane.setGlobalName("currentLineColorPane"); + outerToggleButton.setGlobalName("outerToggleButton"); + topToggleButton.setGlobalName("topToggleButton"); + leftToggleButton.setGlobalName("leftToggleButton"); + bottomToggleButton.setGlobalName("bottomToggleButton"); + rightToggleButton.setGlobalName("rightToggleButton"); + innerToggleButton.setGlobalName("innerToggleButton"); + horizontalToggleButton.setGlobalName("horizontalToggleButton"); + verticalToggleButton.setGlobalName("verticalToggleButton"); + } + @Override public String title4PopupWindow() { return Inter.getLocText("FR-Designer_Cell"); @@ -180,9 +197,22 @@ public class BorderPane extends AbstractBasicStylePane { CellBorderStyle cellBorderStyle = this.update(); - style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), - cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); - style = style.deriveBackground(backgroundPane.update()); + if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineCombo") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineColorPane") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "outerToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "topToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "leftToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "bottomToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "rightToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "innerToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "horizontalToggleButton") + || ComparatorUtils.equals(globalNameListener.getGlobalName(), "verticalToggleButton") + ) { + style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), + cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); + } else { + style = style.deriveBackground(backgroundPane.update()); + } return style; } @@ -204,4 +234,19 @@ public class BorderPane extends AbstractBasicStylePane { cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); return cellBorderStyle; } + + @Override + public void registerNameListener(GlobalNameListener listener) { + globalNameListener = listener; + } + + @Override + public boolean shouldResponseNameListener() { + return false; + } + + @Override + public void setGlobalName(String name) { + + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java index 347bed685..81a916637 100644 --- a/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JFormSliderPane.java @@ -91,7 +91,7 @@ public class JFormSliderPane extends JPanel { initShowValButton(); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); @@ -392,14 +392,14 @@ public class JFormSliderPane extends JPanel { dialog = new FormPopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } } diff --git a/designer_base/src/com/fr/design/mainframe/JSliderPane.java b/designer_base/src/com/fr/design/mainframe/JSliderPane.java index dd0e0f7d9..74745c0ed 100644 --- a/designer_base/src/com/fr/design/mainframe/JSliderPane.java +++ b/designer_base/src/com/fr/design/mainframe/JSliderPane.java @@ -94,7 +94,7 @@ public class JSliderPane extends JPanel { initShowValButton(); initUIRadioButton(); initPane(); - JPanel panel = new JPanel(new FlowLayout(1, 5, 0)); + JPanel panel = new JPanel(new FlowLayout(1, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); @@ -399,14 +399,14 @@ public class JSliderPane extends JPanel { dialog = new PopupPane(upButton, dialogContentPanel); if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } else { if (upButtonX == 0) { upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH + SLIDER_GAP * 2, -DIALOG_HEIGHT); + GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); } } } diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java index a895daefb..978e7e1bc 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java @@ -7,6 +7,8 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import com.fr.base.background.ColorBackground; +import com.fr.design.event.GlobalNameListener; +import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.style.AbstractSelectBox; @@ -14,7 +16,7 @@ import com.fr.design.style.AbstractSelectBox; /** * Color select pane. */ -public class NewColorSelectBox extends AbstractSelectBox implements UIObserver { +public class NewColorSelectBox extends AbstractSelectBox implements UIObserver, GlobalNameObserver { private static final long serialVersionUID = 2782150678943960557L; private Color color; @@ -93,4 +95,19 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs public boolean shouldResponseChangeListener() { return true; } + + @Override + public void registerNameListener(GlobalNameListener listener) { + + } + + @Override + public boolean shouldResponseNameListener() { + return false; + } + + @Override + public void setGlobalName(String name) { + + } } \ No newline at end of file From d4a4bfdee6925ab13ea40cd241f85ba4dd08fb87 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 30 Aug 2017 16:41:56 +0800 Subject: [PATCH 02/11] =?UTF-8?q?REPORT-4047=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E5=8D=95=E4=B8=AA=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E8=AE=BE=E7=BD=AE=E8=BE=B9=E6=A1=86=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E5=86=8D=E5=AF=B9=E5=8C=85=E5=90=AB=E6=AD=A4=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E4=B8=80=E7=89=87=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=83=8C=E6=99=AF=EF=BC=8C=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/style/color/NewColorSelectBox.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java index 978e7e1bc..ce76fe72d 100644 --- a/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer_base/src/com/fr/design/style/color/NewColorSelectBox.java @@ -18,10 +18,12 @@ import com.fr.design.style.AbstractSelectBox; */ public class NewColorSelectBox extends AbstractSelectBox implements UIObserver, GlobalNameObserver { private static final long serialVersionUID = 2782150678943960557L; - + private Color color; private NewColorSelectPane colorPane = new NewColorSelectPane(); private UIObserverListener uiObserverListener; + private String newColorSelectBoxName = ""; + private GlobalNameListener globalNameListener = null; public NewColorSelectBox(int preferredWidth) { initBox(preferredWidth); @@ -36,6 +38,9 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs if(uiObserverListener == null){ return; } + if (globalNameListener != null && shouldResponseNameListener()){ + globalNameListener.setGlobalName(newColorSelectBoxName); + } uiObserverListener.doChange(); } }); @@ -98,16 +103,16 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs @Override public void registerNameListener(GlobalNameListener listener) { - + globalNameListener = listener; } @Override public boolean shouldResponseNameListener() { - return false; + return true; } @Override public void setGlobalName(String name) { - + newColorSelectBoxName = name; } } \ No newline at end of file From 6e314b7f61978df42be4688ef70572da7d018c69 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 30 Aug 2017 16:53:50 +0800 Subject: [PATCH 03/11] =?UTF-8?q?REPORT-4271=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E6=97=A0=E6=B3=95=E6=8F=92=E5=85=A5?= =?UTF-8?q?=E5=AD=90=E6=8A=A5=E8=A1=A8=EF=BC=8C=E5=BC=B9=E5=87=BA=E7=9A=84?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E4=B8=AD=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=A2=84=E8=A7=88=E6=B2=A1=E6=9C=89=E5=93=8D?= =?UTF-8?q?=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/file/FILEChooserPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/file/FILEChooserPane.java b/designer_base/src/com/fr/file/FILEChooserPane.java index cdc0c2c0f..02c92f646 100644 --- a/designer_base/src/com/fr/file/FILEChooserPane.java +++ b/designer_base/src/com/fr/file/FILEChooserPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.itextfield.UIAutoCompletionField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.filetree.FileNode; @@ -475,7 +476,7 @@ public class FILEChooserPane extends BasicPane { this.suffix = suffix; - dialog = showWindow((Window) parent, false); + dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); JPanel contentPane = (JPanel) dialog.getContentPane(); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); contentPane.add(this, BorderLayout.CENTER); From f35239d53e4bd537c3b85385dbc5979adf3bbdcf Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 30 Aug 2017 16:55:31 +0800 Subject: [PATCH 04/11] PMD --- .../com/fr/design/gui/style/BorderPane.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index 59eecbbb1..dd1e885bf 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -197,17 +197,16 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse CellBorderStyle cellBorderStyle = this.update(); - if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineCombo") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineColorPane") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "outerToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "topToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "leftToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "bottomToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "rightToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "innerToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "horizontalToggleButton") - || ComparatorUtils.equals(globalNameListener.getGlobalName(), "verticalToggleButton") - ) { + if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineCombo") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineColorPane") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "outerToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "topToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "leftToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "bottomToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "rightToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "innerToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "horizontalToggleButton") || + ComparatorUtils.equals(globalNameListener.getGlobalName(), "verticalToggleButton")) { style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); } else { From 75e626136264a1a6c64da027e2937cdde0bad0e6 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 30 Aug 2017 18:34:16 +0800 Subject: [PATCH 05/11] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=3D>=E5=88=87=E6=8D=A2sheet=E6=97=B6=E5=BA=94=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E5=88=B7=E6=96=B0=E5=8F=B3=E4=BE=A7=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/mainframe/SheetNameTabPane.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java index 173bd9cd4..8e63aa815 100644 --- a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java @@ -554,10 +554,12 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse for (int i = scrollIndex; i <= lastOneIndex; i++) { int textWidth = widthArray[i]; if (evtX >= textX && evtX < textX + textWidth) { - if (getSelectedIndex() != i) { + boolean needRefreshPropertiesPane = getSelectedIndex() != i; + setSelectedIndex(i); + if (needRefreshPropertiesPane) { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane(); } - setSelectedIndex(i); + isBlank = false; reportComposite.setComposite(); if (isAuthorityEditing) { From 63f86eea253794a845effcd4040be71f4aa8dedb Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 09:39:25 +0800 Subject: [PATCH 06/11] PMD --- .../com/fr/design/gui/style/BorderPane.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index dd1e885bf..cd969de4f 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -27,12 +27,26 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; +import java.util.HashSet; /** * @author zhou * @since 2012-5-28下午6:22:04 */ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { + + public static final HashSet BORDERSET = new HashSet() {{ + add("currentLineCombo"); + add("currentLineColorPane"); + add("outerToggleButton"); + add("topToggleButton"); + add("leftToggleButton"); + add("bottomToggleButton"); + add("rightToggleButton"); + add("innerToggleButton"); + add("horizontalToggleButton"); + add("verticalToggleButton"); + }}; private boolean insideMode = false; private UIToggleButton topToggleButton; @@ -197,16 +211,7 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse CellBorderStyle cellBorderStyle = this.update(); - if (ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineCombo") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "currentLineColorPane") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "outerToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "topToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "leftToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "bottomToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "rightToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "innerToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "horizontalToggleButton") || - ComparatorUtils.equals(globalNameListener.getGlobalName(), "verticalToggleButton")) { + if (BORDERSET.contains(globalNameListener.getGlobalName())) { style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); } else { From 6b506d434629cdc1b19d64cbbd81ebc3758c14c4 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 09:44:36 +0800 Subject: [PATCH 07/11] PMD --- designer_base/src/com/fr/design/gui/style/BorderPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index cd969de4f..1e1a8b935 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -35,7 +35,7 @@ import java.util.HashSet; */ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { - public static final HashSet BORDERSET = new HashSet() {{ + private static final HashSet BORDERSET = new HashSet() {{ add("currentLineCombo"); add("currentLineColorPane"); add("outerToggleButton"); From 6b2fced807f125ea639b5601235ff59070c54274 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 10:09:25 +0800 Subject: [PATCH 08/11] PMD --- .../com/fr/design/gui/style/BorderPane.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index 1e1a8b935..ee2445884 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -27,6 +27,7 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; +import java.util.Arrays; import java.util.HashSet; /** @@ -35,18 +36,7 @@ import java.util.HashSet; */ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { - private static final HashSet BORDERSET = new HashSet() {{ - add("currentLineCombo"); - add("currentLineColorPane"); - add("outerToggleButton"); - add("topToggleButton"); - add("leftToggleButton"); - add("bottomToggleButton"); - add("rightToggleButton"); - add("innerToggleButton"); - add("horizontalToggleButton"); - add("verticalToggleButton"); - }}; + private static String[] BORDERARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton", "leftToggleButton", "bottomToggleButton", "rightToggleButton", "innerToggleButton", "horizontalToggleButton", "verticalToggleButton"}; private boolean insideMode = false; private UIToggleButton topToggleButton; @@ -210,8 +200,8 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse } CellBorderStyle cellBorderStyle = this.update(); - - if (BORDERSET.contains(globalNameListener.getGlobalName())) { + HashSet borderSet = new HashSet(Arrays.asList(BORDERARRAY)); + if (borderSet.contains(globalNameListener.getGlobalName())) { style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); } else { From 7df3d789159caf0a18674ca456682ca3a537d58e Mon Sep 17 00:00:00 2001 From: vito Date: Thu, 31 Aug 2017 10:20:59 +0800 Subject: [PATCH 09/11] =?UTF-8?q?REPORT-4254=20=E4=B9=8B=E5=89=8D=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E6=98=BE=E7=A4=BA=E7=8E=AF=E5=A2=83=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=EF=BC=8C=E4=BD=86=E6=98=AF=E6=B2=A1=E6=9C=89=E9=80=82=E9=85=8D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=88=B0=E8=B7=AF=E5=BE=84=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/file/export/AbstractExportAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java index 74e8fbdf3..13a836c92 100644 --- a/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java +++ b/designer/src/com/fr/design/actions/file/export/AbstractExportAction.java @@ -72,7 +72,7 @@ public abstract class AbstractExportAction extends JWorkBookAction { } // Choose a file name.... - FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(true, true); + FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(false, true); fileChooserPane.setFILEFilter(this.getChooseFileFilter()); // 打开文件后输出文件名修改,eg:w.cpt.doc / w.svg.doc,去掉中间的后缀名~~ w.doc From 081d2ab03bcd0518af816755e36b728ad1f1c624 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 11:17:03 +0800 Subject: [PATCH 10/11] =?UTF-8?q?final=20=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/gui/style/BorderPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index ee2445884..861df6aaa 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -36,7 +36,8 @@ import java.util.HashSet; */ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObserver { - private static String[] BORDERARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton", "leftToggleButton", "bottomToggleButton", "rightToggleButton", "innerToggleButton", "horizontalToggleButton", "verticalToggleButton"}; + private static final String[] BORDERARRAY = {"currentLineCombo", "currentLineColorPane", "outerToggleButton", "topToggleButton", + "leftToggleButton", "bottomToggleButton", "rightToggleButton", "innerToggleButton", "horizontalToggleButton", "verticalToggleButton"}; private boolean insideMode = false; private UIToggleButton topToggleButton; From 345d060aecbca084ba5bf41cb6f966688d1ea25a Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 31 Aug 2017 16:33:09 +0800 Subject: [PATCH 11/11] =?UTF-8?q?REPORT-4142=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E5=88=86=E9=A1=B5=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=A1=B5=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java | 1 - .../src/com/fr/design/present/ConditionAttributesGroupPane.java | 1 - 2 files changed, 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java index 60f45450c..14e5fdc03 100644 --- a/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer/src/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -97,7 +97,6 @@ public class CellWidgetPropertyPane extends BasicPane { TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); - tplEC.addCellElement(editCellElement); } this.cellElement = editCellElement; this.populate(editCellElement); diff --git a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java index 961c88d10..6eac1c571 100644 --- a/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java +++ b/designer/src/com/fr/design/present/ConditionAttributesGroupPane.java @@ -80,7 +80,6 @@ public class ConditionAttributesGroupPane extends UIListControlPane { editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow()); if (editCellElement == null) { editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow()); - tplEC.addCellElement(editCellElement); } SheetUtils.calculateDefaultParent(tplEC); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里