From 3383ba5eae761458ae4251625c1e46c3b844a754 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 30 Aug 2017 16:13:07 +0800 Subject: [PATCH 01/17] =?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 b6826a8612..951333895f 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 1390ee9cba..59eecbbb17 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 347bed6859..81a916637b 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 dd0e0f7d9e..74745c0eda 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 a895daefbf..978e7e1bc0 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/17] =?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 978e7e1bc0..ce76fe72db 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/17] =?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 cdc0c2c0f9..02c92f646b 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/17] 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 59eecbbb17..dd1e885bf2 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/17] =?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 173bd9cd4f..8e63aa815b 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 9b86c579b3cfb254fe56512a3a77672513feda7a Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Wed, 30 Aug 2017 20:03:15 +0800 Subject: [PATCH 06/17] =?UTF-8?q?9.0=E6=96=B0=E5=9B=BE=E8=A1=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=95=8C=E9=9D=A2=E4=BF=AE=E6=94=B9=E3=80=82=20?= =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=9C=80=E6=96=B0=E8=AE=BE=E8=AE=A1=E7=A8=BF?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A5=BC=E5=9B=BE=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E9=97=AE=E9=A2=98=20=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E4=B8=8D=E8=83=BD=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=9D=A1=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../report/AbstractReportDataContentPane.java | 8 +++++++ .../BubblePlotReportDataContentPane.java | 3 ++- ...goryPlotMoreCateReportDataContentPane.java | 3 ++- .../CategoryPlotReportDataContentPane.java | 3 ++- .../MeterPlotReportDataContentPane.java | 3 ++- .../data/table/SeriesTypeUseComboxPane.java | 3 ++- .../gui/style/series/UIColorPickerPane.java | 15 +++++++------ .../chart/area/VanChartAreaSeriesPane.java | 1 - .../bubble/VanChartBubbleSeriesPane.java | 1 - ...anChartBubblePlotTableDataContentPane.java | 3 ++- .../background/VanChartBackgroundPane.java | 2 +- ...BackgroundWithOutShadowWithRadiusPane.java | 4 ++-- .../VanChartConditionAttrContentPane.java | 8 +++---- .../VanChartAbstractPlotSeriesPane.java | 6 ++++-- .../style/VanChartFunnelSeriesPane.java | 1 - .../style/series/VanChartGanttSeriesPane.java | 6 ------ .../chart/gauge/VanChartGaugeSeriesPane.java | 6 ------ .../chart/line/VanChartLineSeriesPane.java | 6 ------ .../chart/map/VanChartMapSeriesPane.java | 21 +++++-------------- .../style/VanChartMultiPieSeriesPane.java | 6 ------ .../chart/radar/VanChartRadarSeriesPane.java | 6 +----- .../SectionIntervalConfigPaneWithOutNum.java | 13 +++++++++++- .../scatter/VanChartScatterSeriesPane.java | 1 - .../style/VanChartStructureSeriesPane.java | 7 ------- .../style/VanChartWordCloudSeriesPane.java | 6 ------ 25 files changed, 57 insertions(+), 85 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java index 2612ae7425..9ee06b76cc 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java @@ -16,6 +16,7 @@ import com.fr.design.layout.TableLayout; import com.fr.stable.StableUtils; import javax.swing.*; +import javax.swing.border.Border; import javax.swing.event.ChangeEvent; import java.awt.*; import java.util.ArrayList; @@ -200,4 +201,11 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane { this.add(cardPane, BorderLayout.CENTER); dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); this.add(panel, BorderLayout.SOUTH); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 37c2f26b51..b5cdb0b74a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -94,14 +94,9 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { } }; - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - Component[][] components = createComponents(); - upControlPane = TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize); - + upControlPane = getUpControlPane (components); this.textFieldList = this.getTextFieldList(); this.textGroup = new TextFieldGroupPane(); this.colorGroup = new ColorGroupPane(); @@ -113,6 +108,14 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { refreshGroupPane(colors, getValueArray(number)); } + protected JPanel getUpControlPane (Component[][] components) { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + return TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize); + } + + protected double[] getRowSIze () { double p = TableLayout.PREFERRED; return new double[]{p, p, p}; diff --git a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java index 3caa85b4e8..d590de46c5 100644 --- a/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java @@ -42,7 +42,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{ //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); panel.add(createStylePane(), BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java index 41c672e144..2991b1c829 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java @@ -50,7 +50,6 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane { //设置色彩面板内容 @Override protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); panel.add(createAlphaPane(), BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java index 756f31ca91..19a2cbc807 100644 --- a/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java @@ -64,7 +64,8 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north); north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); + filterPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); this.setLayout(new BorderLayout()); diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java index a1526b6a40..1c1cb8211d 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundPane.java @@ -98,7 +98,7 @@ public class VanChartBackgroundPane extends BasicPane { new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, new Component[]{null, centerPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Alpha")), transparent}, + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java index f1d1c9ca48..96dfca8be3 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java @@ -25,8 +25,8 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg new Component[]{null, null}, new Component[]{new UILabel(Inter.getLocText("FR-Chart-Shape_Fill")), typeComboBox}, new Component[]{null, centerPane}, - new Component[]{new UILabel(Inter.getLocText("Plugin-Chart_Alpha")), transparent}, - new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")+":"),radius} + new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Alpha")), transparent}, + new Component[]{new UILabel(Inter.getLocText("plugin-ChartF_Radius")),radius} }; } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java index 9baf215081..c65c6a5791 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java @@ -5,7 +5,6 @@ import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.controlpane.UIListControlPane; -import com.fr.design.gui.imenutable.UIMenuNameableCreator; import com.fr.general.NameObject; import com.fr.stable.Nameable; @@ -58,10 +57,9 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte Nameable[] nameables = conditionPane.update(); cc.clearConditionAttr(); for (int i = 0; i < nameables.length; i++) { - if (nameables[i] instanceof UIMenuNameableCreator) { - UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) nameables[i]; - ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj(); - ca.setName(uiMenuNameableCreator.getName()); + if (nameables[i] instanceof NameObject) { + ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject(); + ca.setName(nameables[i].getName()); cc.addConditionAttr(ca); } } diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index c7d9837f5e..abb629af99 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -83,7 +83,10 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP scrollPane.setViewportView(getContentInPlotType()); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } - return getContentInPlotType(); + JPanel panel = new JPanel(new BorderLayout()); + panel.add(fillStylePane, BorderLayout.NORTH); + panel.add(getContentInPlotType(), BorderLayout.CENTER); + return panel; } @Override @@ -115,7 +118,6 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); panel.add(createStylePane(), BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java index cd3ab93078..e8beea2fbf 100644 --- a/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/funnel/designer/style/VanChartFunnelSeriesPane.java @@ -42,7 +42,6 @@ public class VanChartFunnelSeriesPane extends VanChartAbstractPlotSeriesPane { //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); panel.add(createStylePane(), BorderLayout.CENTER); panel.add(createAlphaPane(), BorderLayout.SOUTH); } diff --git a/designer_chart/src/com/fr/plugin/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index cecf05e6c0..57505188e2 100644 --- a/designer_chart/src/com/fr/plugin/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -41,7 +41,6 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createGanntStylePane()}, new Component[]{createLinkLinePane()}, new Component[]{createMarkerPane()} @@ -51,11 +50,6 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { return contentPane; } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - private JPanel createGanntStylePane(){ seriesNewLine = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Open"), Inter.getLocText("Plugin-ChartF_Close")}); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_Series_New_Line"),seriesNewLine); diff --git a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java index 4ba982d573..9e5238d892 100644 --- a/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/gauge/VanChartGaugeSeriesPane.java @@ -57,7 +57,6 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { double[] columnSize = {f}; double[] rowSize = {p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createGaugeLayoutPane()}, new Component[]{createGaugeStylePane(rowSize, new double[]{f,e})}, new Component[]{createGaugeBandsPane()} @@ -66,11 +65,6 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - private JPanel createGaugeLayoutPane() { gaugeLayout = new UIButtonGroup(new String[]{Inter.getLocText("FR-Chart-Direction_Horizontal"), Inter.getLocText("FR-Chart-Direction_Vertical")}); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("PageSetup-Orientation"),gaugeLayout); diff --git a/designer_chart/src/com/fr/plugin/chart/line/VanChartLineSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/line/VanChartLineSeriesPane.java index 003a313e4f..dd54e7e770 100644 --- a/designer_chart/src/com/fr/plugin/chart/line/VanChartLineSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/line/VanChartLineSeriesPane.java @@ -26,7 +26,6 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane{ double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createLineTypePane()}, new Component[]{createMarkerPane()}, new Component[]{createStackedAndAxisPane()}, @@ -38,9 +37,4 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane{ return contentPane; } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - } \ No newline at end of file diff --git a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java index 29a34a3ac6..cb0be77135 100644 --- a/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/map/VanChartMapSeriesPane.java @@ -152,20 +152,10 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { } //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - if (getFillStylePane() != null){ - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - mapType = ((VanChartMapPlot) plot).getAllLayersMapType(); - switch (mapType) { - case AREA: - panel.add(createNullValueColorPane(), BorderLayout.CENTER); - panel.add(createAlphaPane(), BorderLayout.SOUTH); - break; - case POINT: - panel.add(createPointAlphaPane(), BorderLayout.CENTER); - break; - } + protected void setColorPaneContent(JPanel panel) { + panel.add(createNullValueColorPane(), BorderLayout.CENTER); + panel.add(createAlphaPane(), BorderLayout.SOUTH); + } @@ -199,7 +189,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { double[] col = {f}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, + new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((Inter.getLocText("Plugin-ChartF_Color")), createPointAlphaPane())}, new Component[]{createMarkerComPane()}, new Component[]{createLargeDataModelPane()}, new Component[]{createPointEffectPane()}, @@ -217,7 +207,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane { curvePane = new VanChartCurvePane(); Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createCurvePane()}, new Component[]{createLineMapLargeDataModelPane()}, new Component[]{createAnimationPane()} diff --git a/designer_chart/src/com/fr/plugin/chart/multilayer/style/VanChartMultiPieSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/multilayer/style/VanChartMultiPieSeriesPane.java index cd7739a698..6a9ce50ae2 100644 --- a/designer_chart/src/com/fr/plugin/chart/multilayer/style/VanChartMultiPieSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/multilayer/style/VanChartMultiPieSeriesPane.java @@ -34,7 +34,6 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { double[] columnSize = {f}; double[] rowSize = {p,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createSeriesStylePane(rowSize, new double[]{p,f})}, new Component[]{createBorderPane()}, }; @@ -67,11 +66,6 @@ public class VanChartMultiPieSeriesPane extends VanChartPieSeriesPane { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), panel); } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - protected void populatePieAttr() { if(plot.accept(VanChartMultiPiePlot.class)){ VanChartMultiPiePlot multiPiePlot = (VanChartMultiPiePlot)plot; diff --git a/designer_chart/src/com/fr/plugin/chart/radar/VanChartRadarSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/radar/VanChartRadarSeriesPane.java index 1facdf2d13..ec08b139ad 100644 --- a/designer_chart/src/com/fr/plugin/chart/radar/VanChartRadarSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/radar/VanChartRadarSeriesPane.java @@ -49,7 +49,6 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane { } return new Component[][] { - new Component[]{getColorPane()}, new Component[]{createRadarTypePane()}, new Component[]{createLineTypePane()}, new Component[]{createMarkerPane()}, @@ -59,10 +58,7 @@ public class VanChartRadarSeriesPane extends VanChartAbstractPlotSeriesPane { //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - if(((VanChartRadarPlot)plot).isStackChart()) { - panel.add(createAlphaPane(), BorderLayout.CENTER); - } + panel.add(createAlphaPane(), BorderLayout.CENTER); } private JPanel createRadarTypePane() { diff --git a/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index 7937b61f67..899b283e51 100644 --- a/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer_chart/src/com/fr/plugin/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -3,7 +3,9 @@ package com.fr.plugin.chart.range.component; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; @@ -28,6 +30,15 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF }); } + protected JPanel getUpControlPane (Component[][] components) { + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + double[] columnSize = {d, e}; + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze (), columnSize); + panel.setPreferredSize(new Dimension(230, (int)panel.getPreferredSize().getHeight())); + return panel; + } + private void setRegionVisible(boolean visible){ getRegionNumPane().setVisible(visible); numLabel.setVisible(visible); @@ -40,7 +51,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF setRegionVisible(false); return new Component[][]{ - new Component[]{new BoldFontTextLabel(""),getDesignTypeButtonGroup()}, + new Component[]{new BoldFontTextLabel(Inter.getLocText("Plugin-ChartF_RangeNum")),getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; } diff --git a/designer_chart/src/com/fr/plugin/chart/scatter/VanChartScatterSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/scatter/VanChartScatterSeriesPane.java index 90617b6cd8..980b3ed226 100644 --- a/designer_chart/src/com/fr/plugin/chart/scatter/VanChartScatterSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/scatter/VanChartScatterSeriesPane.java @@ -48,7 +48,6 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{ //设置色彩面板内容 protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); panel.add(createAlphaPane(), BorderLayout.CENTER); } diff --git a/designer_chart/src/com/fr/plugin/chart/structure/desinger/style/VanChartStructureSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/structure/desinger/style/VanChartStructureSeriesPane.java index f4f0f2a072..ec85e3e30a 100644 --- a/designer_chart/src/com/fr/plugin/chart/structure/desinger/style/VanChartStructureSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/structure/desinger/style/VanChartStructureSeriesPane.java @@ -44,7 +44,6 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane double[] columnSize = {f}; double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createLinkPane()}, new Component[]{createNodePane()} }; @@ -54,12 +53,6 @@ public class VanChartStructureSeriesPane extends VanChartAbstractPlotSeriesPane return contentPane; } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - - private JPanel createLinkPane() { linkColor = new ColorSelectBox(100); diff --git a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index 2346b62f32..1f524001f8 100644 --- a/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -60,7 +60,6 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane double[] columnSize = {f}; double[] rowSize = {p,p,p}; Component[][] components = new Component[][]{ - new Component[]{getColorPane()}, new Component[]{createWordCloudStylePane()}, }; @@ -69,11 +68,6 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane return contentPane; } - //设置色彩面板内容 - protected void setColorPaneContent (JPanel panel) { - panel.add(getFillStylePane(), BorderLayout.NORTH); - } - private JPanel createWordCloudStylePane(){ double labelSize = LABEL_SIZE; double p = TableLayout.PREFERRED; From 63f86eea253794a845effcd4040be71f4aa8dedb Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 09:39:25 +0800 Subject: [PATCH 07/17] 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 dd1e885bf2..cd969de4f9 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 08/17] 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 cd969de4f9..1e1a8b935f 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 09/17] 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 1e1a8b935f..ee2445884d 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 10/17] =?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 74e8fbdf35..13a836c92a 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 02eb45388779b5947c2443439e23b81848f0d00a Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 31 Aug 2017 11:04:58 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=9C=E8=89=B2?= =?UTF-8?q?=E9=85=8D=E6=8E=A5=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/VanChartAreaSeriesFillColorPane.java | 14 +++----------- .../designer/style/axis/VanChartBaseAxisPane.java | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java index b4913e6415..5606e7defd 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/component/VanChartAreaSeriesFillColorPane.java @@ -4,7 +4,6 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; @@ -19,7 +18,6 @@ import java.awt.*; */ public class VanChartAreaSeriesFillColorPane extends BasicPane { private static final long serialVersionUID = 9166866984438854779L; - private static final int PANE_WIDTH = 221; private VanChartMarkerBackgroundPane fillColorPane; private UINumberDragPane transparent; @@ -41,15 +39,9 @@ public class VanChartAreaSeriesFillColorPane extends BasicPane { JPanel transparentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Alpha"), transparent); - Component[][] components = new Component[][]{ - new Component[]{fillColorPane}, - new Component[]{transparentPane}, - }; - - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - contentPane.setPreferredSize(new Dimension(PANE_WIDTH, (int)contentPane.getPreferredSize().getHeight())); - - this.add(contentPane); + this.setLayout(new BorderLayout()); + this.add(fillColorPane, BorderLayout.NORTH); + this.add(transparentPane, BorderLayout.CENTER); } protected String title4PopupWindow(){ diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java index 2030f48e9e..649e030da4 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/axis/VanChartBaseAxisPane.java @@ -252,8 +252,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { axisLimitSize = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_Limit"),Inter.getLocText("Plugin-ChartF_NotLimit")}); JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_AreaSize"),axisLimitSize); - maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion); - maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-ChartF_MaxProportion"),maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); + maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); JPanel panel = new JPanel(new BorderLayout()); panel.add(limitSizePane, BorderLayout.NORTH); panel.add(maxProportionPane, BorderLayout.CENTER); From 081d2ab03bcd0518af816755e36b728ad1f1c624 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 31 Aug 2017 11:17:03 +0800 Subject: [PATCH 12/17] =?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 ee2445884d..861df6aaa0 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 299dbcb55bfa8e28438c22ff50f050ef04c3ae42 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Thu, 31 Aug 2017 11:57:38 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/series/VanChartAbstractPlotSeriesPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index abb629af99..7e02cbddf0 100644 --- a/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer_chart/src/com/fr/plugin/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -84,7 +84,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } JPanel panel = new JPanel(new BorderLayout()); - panel.add(fillStylePane, BorderLayout.NORTH); + if (fillStylePane != null) { + panel.add(fillStylePane, BorderLayout.NORTH); + } panel.add(getContentInPlotType(), BorderLayout.CENTER); return panel; } From 9e68e1210d0fac847396c852b0b8b39346be6a08 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 29 Aug 2017 18:39:42 +0800 Subject: [PATCH 14/17] =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/locale/designer.properties | 5 +++-- .../src/com/fr/design/locale/designer_en_US.properties | 5 +++-- .../src/com/fr/design/locale/designer_ja_JP.properties | 1 + .../src/com/fr/design/locale/designer_ko_KR.properties | 3 ++- .../src/com/fr/design/locale/designer_zh_CN.properties | 3 ++- .../src/com/fr/design/locale/designer_zh_TW.properties | 1 + 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index c048d29c55..96949d4e50 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -71,7 +71,7 @@ FR-Designer_Button-Icon= FR-Designer_Button-Name= FR-Designer_Button-Type= FR-Designer_CardLayout= -FR-Designer_Cell= +FR-Designer_Cell=Cell FR-Designer_Chart_Cell= FR-Designer_Chart_Float= FR-Designer_Chart_Float_chart= @@ -2131,4 +2131,5 @@ FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color FR-Designer-Basic_Dynamic_Parameter_Injection=Injection FR-Designer_Label= -FR-Designer_Widgetname=Widget Name \ No newline at end of file +FR-Designer_Widgetname=Widget Name +FR-Designer_Insert_Cell_Element=Insert Cell Element \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 4a87f16203..a28a029360 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -71,7 +71,7 @@ FR-Designer_Button-Icon=Button Icon FR-Designer_Button-Name=Button Name FR-Designer_Button-Type=Button Type FR-Designer_CardLayout=TabLayout -FR-Designer_Cell=cell +FR-Designer_Cell=Cell FR-Designer_Chart_Cell=Chart Hyperlink-Link Cell FR-Designer_Chart_Float=Chart Hyperlink-Floating Element FR-Designer_Chart_Float_chart=Chart Hyperlink-Floating Chart @@ -2127,4 +2127,5 @@ FR-Designer-Download_Online_Sources= FR-Designer_Select_Color=Select Color FR-Designer-Basic_Dynamic_Parameter_Injection=Injection FR-Designer_Label=Label -FR-Designer_Widgetname=Widget Name \ No newline at end of file +FR-Designer_Widgetname=Widget Name +FR-Designer_Insert_Cell_Element=Insert Cell Element \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 05783bc7be..501932da07 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2126,3 +2126,4 @@ FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\ FR-Designer_Label=\u30E9\u30D9\u30EBa FR-Designer_Widgetname=\u30B3\u30F3\u30C8\u30ED\u30FC\u30EB\u540D +FR-Designer_Insert_Cell_Element=\ diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 6a660743d4..2d98287192 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2126,4 +2126,5 @@ FR-Designer-Download_Online_Sources= FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection= FR-Designer_Label=\uB808\uC774\uBE14 -FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984 \ No newline at end of file +FR-Designer_Widgetname=\uC18C\uD504\uD2B8\uC6E8\uC5B4\uC81C\uC5B4\uC774\uB984 +FR-Designer_Insert_Cell_Element=\ \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 4e7b879734..1be9234d45 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2139,4 +2139,5 @@ FR-Designer-Download_Online_Sources=\u56FE\u8868\u9700\u8981\u4E0B\u8F7D\u6700\u FR-Designer_Select_Color=\u9009\u62E9\u989C\u8272 FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 FR-Designer_Label=\u6807\u7B7E -FR-Designer_Widgetname=\u63A7\u4EF6\u540D \ No newline at end of file +FR-Designer_Widgetname=\u63A7\u4EF6\u540D +FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 95c67c32af..518d8d949a 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2131,3 +2131,4 @@ FR-Designer_Select_Color= FR-Designer-Basic_Dynamic_Parameter_Injection=\u6CE8\u5165 FR-Designer_Label=\u6A19\u7C3D FR-Designer_Widgetname=\u63A7\u5236\u9805\u540D +FR-Designer_Insert_Cell_Element=\u63D2\u5165\u5143\u7D20 From a9863134a5a8c4848c8f9d151065bfd1ca016217 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 31 Aug 2017 12:17:14 +0800 Subject: [PATCH 15/17] REPORT-3348 --- .../com/fr/quickeditor/CellQuickEditor.java | 23 +++++++++++-------- .../cellquick/CellBiasTextPainterEditor.java | 2 +- .../cellquick/CellDSColumnEditor.java | 16 ++++++------- .../cellquick/CellFormulaQuickEditor.java | 2 +- .../cellquick/CellImageQuickEditor.java | 2 +- .../cellquick/CellRichTextEditor.java | 2 +- .../cellquick/CellSubReportEditor.java | 2 +- .../src/com/fr/file/FILEChooserPane.java | 1 - 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index 6f0530a70f..683f17bc73 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -43,6 +43,15 @@ public abstract class CellQuickEditor extends QuickEditor { /*面板配置*/ protected UITextField columnRowTextField; protected TemplateCellElement cellElement; + /*占位label*/ + protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); + protected static final UILabel EMPTY_LABEL = new UILabel(); + + static { + EMPTY_LABEL.setPreferredSize(LABEL_DIMENSION); + } + + protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; private UIComboBox comboBox; private UpdateAction[] cellInsertActions; private int selectedIndex; @@ -53,12 +62,6 @@ public abstract class CellQuickEditor extends QuickEditor { private int currentSelectedIndex; - static { - emptyLabel.setPreferredSize(new Dimension(60, 20)); - } - - protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; - public CellQuickEditor() { scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { @@ -117,10 +120,10 @@ public abstract class CellQuickEditor extends QuickEditor { double f = TableLayout.FILL; double[] columnSize = {p, f}; double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(Inter.getLocText("Cell")); - cellLabel.setPreferredSize(new Dimension(60, 20)); - UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content")); - insertContentLabel.setPreferredSize(new Dimension(60, 20)); + UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell")); + cellLabel.setPreferredSize(LABEL_DIMENSION); + UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element")); + insertContentLabel.setPreferredSize(LABEL_DIMENSION); UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, diff --git a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java index c17ac86784..d5d8e1f800 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java @@ -35,7 +35,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor { }); editButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, editButton}}, + new Component[]{EMPTY_LABEL, editButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 2c1a30c116..d7c6ddbd47 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -217,7 +217,7 @@ public class CellDSColumnEditor extends CellQuickEditor { double[] rowSize = {P}, columnSize = {P, F}; UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions")); - uiLabel.setPreferredSize(new Dimension(60, 20)); + uiLabel.setPreferredSize(LABEL_DIMENSION); UIButton uiButton = new UIButton(); if (tc != null) { //第一次初始化时tc为空,会引发NullPointerException @@ -481,14 +481,13 @@ public class CellDSColumnEditor extends CellQuickEditor { multiNumSpinner = new UISpinner(1, 10000, 1, 1); //数据倍数 UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); - multipleLabel.setPreferredSize(new Dimension(60, 20)); multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{ multipleLabel, multiNumSpinner } }, new double[]{P}, new double[]{P, F}, HGAP, VGAP ); - multiPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + multiPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); multiNumPane.add(multiPane); useMultiplyNumCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -563,7 +562,7 @@ public class CellDSColumnEditor extends CellQuickEditor { centerPane.add(new JPanel(), "none"); centerPane.add(formulaField, "content"); UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order")); - sortLabel.setPreferredSize(new Dimension(60, 20)); + sortLabel.setPreferredSize(LABEL_DIMENSION); sortTypePane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -982,7 +981,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public CustomValuePane() { this.setLayout(new BorderLayout()); UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); - customValueLabel.setPreferredSize(new Dimension(60, 20)); + customValueLabel.setPreferredSize(LABEL_DIMENSION); formulaField = new JFormulaField(DEFAULT_VALUE); this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{customValueLabel, formulaField}, @@ -994,14 +993,13 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value != null && value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) value; - //formula String valueFormula = dSColumn.getResult(); - if (valueFormula == null) { - valueFormula = DEFAULT_VALUE; + if (valueFormula != null) { + formulaField.populate(valueFormula); } formulaField.populateElement(cellElement); - formulaField.populate(valueFormula); + } } } diff --git a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index fcd16a6765..7429b146eb 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -121,7 +121,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor { content.add(pane, BorderLayout.NORTH); return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, content}}, + new Component[]{EMPTY_LABEL, content}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP); } diff --git a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java index 51b7417ac5..25818e79f3 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java @@ -43,7 +43,7 @@ public class CellImageQuickEditor extends CellQuickEditor { }); editButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, editButton}}, + new Component[]{EMPTY_LABEL, editButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 8f8afbeed2..75ef442dae 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -30,7 +30,7 @@ public class CellRichTextEditor extends CellQuickEditor { richTextButton = new UIButton(); richTextButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, richTextButton}}, + new Component[]{EMPTY_LABEL, richTextButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java index e28bdbf395..70d8c51ea1 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -31,7 +31,7 @@ public class CellSubReportEditor extends CellQuickEditor { subReportButton = new UIButton(); subReportButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, subReportButton}}, + new Component[]{EMPTY_LABEL, subReportButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer_base/src/com/fr/file/FILEChooserPane.java b/designer_base/src/com/fr/file/FILEChooserPane.java index 02c92f646b..09e9114216 100644 --- a/designer_base/src/com/fr/file/FILEChooserPane.java +++ b/designer_base/src/com/fr/file/FILEChooserPane.java @@ -475,7 +475,6 @@ public class FILEChooserPane extends BasicPane { this.type = type; this.suffix = suffix; - dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); JPanel contentPane = (JPanel) dialog.getContentPane(); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); From 345d060aecbca084ba5bf41cb6f966688d1ea25a Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 31 Aug 2017 16:33:09 +0800 Subject: [PATCH 16/17] =?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 60f45450c7..14e5fdc033 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 961c88d105..6eac1c5710 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); // 不知道这行代码的作用,怕去掉之后会出问题,先放在这里 From 244e9a06c87acc84eba796405818e01a028d7fc3 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 31 Aug 2017 13:57:26 +0800 Subject: [PATCH 17/17] =?UTF-8?q?REPORT-3348=20=E6=95=B0=E6=8D=AE=E5=88=97?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BD=BF=E7=94=A8=E5=8D=95=E7=8B=AC=E7=9A=84?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/cell/CellEditorPane.java | 97 ++++++- .../com/fr/quickeditor/CellQuickEditor.java | 256 +++++++++--------- .../cellquick/CellBiasTextPainterEditor.java | 5 + .../cellquick/CellDSColumnEditor.java | 18 +- .../cellquick/CellElementBarLayout.java | 41 +++ .../cellquick/CellFormulaQuickEditor.java | 5 + .../cellquick/CellImageQuickEditor.java | 5 + .../cellquick/CellRichTextEditor.java | 5 + .../cellquick/CellStringQuickEditor.java | 5 + .../cellquick/CellSubReportEditor.java | 4 + 10 files changed, 300 insertions(+), 141 deletions(-) create mode 100644 designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java diff --git a/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java b/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java index 48b6d8a179..6fbf73dc0f 100644 --- a/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java +++ b/designer/src/com/fr/design/mainframe/cell/CellEditorPane.java @@ -1,6 +1,15 @@ package com.fr.design.mainframe.cell; -import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.iscrollbar.UIScrollBar; +import com.fr.design.mainframe.CellElementPropertyPane; +import com.fr.quickeditor.cellquick.CellElementBarLayout; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; /** * 右侧单元格元素面板抽象类 @@ -9,7 +18,20 @@ import com.fr.design.dialog.BasicPane; * @version 2017年7月25日 * @since 9.0 */ -public abstract class CellEditorPane extends BasicPane { +public abstract class CellEditorPane extends JPanel { + + /*滚动条相关配置*/ + private static final int MAXVALUE = 100; + private static final int TITLE_HEIGHT = 95; + private static final int CONTENT_PANE_WIDTH_GAP = 3; + private static final int SCROLLBAR_WIDTH = 7; + private static final int MOUSE_WHEEL_SPEED = 5; + private int maxHeight = 280; + + private JPanel leftContentPane; + private UIScrollBar scrollBar; + + protected abstract JPanel createContentPane(); public abstract String getIconPath(); @@ -22,7 +44,76 @@ public abstract class CellEditorPane extends BasicPane { /** * 更新面板数据 - * */ public abstract void populate(); + + protected void createScrollPane() { + leftContentPane = this.createContentPane(); + this.prepareScrollBar(); + leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); + + this.setLayout(new CellElementBarLayout(leftContentPane) { + @Override + public void layoutContainer(Container parent) { + maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT; + int beginY; + if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { + beginY = 0; + } else { + int preferredHeight = leftContentPane.getPreferredSize().height; + int value = scrollBar.getValue(); + beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount()); + } + int width = parent.getWidth(); + int height = parent.getHeight(); + if (leftContentPane.getPreferredSize().height > maxHeight) { + leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY); + scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height); + } else { + leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height); + } + } + }); + this.add(scrollBar); + this.add(leftContentPane); + } + + + private void prepareScrollBar() { + scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { + @Override + public int getVisibleAmount() { + int preferredHeight = leftContentPane.getPreferredSize().height; + int e = MAXVALUE * (maxHeight) / preferredHeight; + setVisibleAmount(e); + return e; + } + + @Override + public int getMaximum() { + return MAXVALUE; + } + }; + + scrollBar.addAdjustmentListener(new AdjustmentListener() { + + @Override + public void adjustmentValueChanged(AdjustmentEvent e) { + doLayout(); + } + }); + this.addMouseWheelListener(new MouseWheelListener() { + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + int value = scrollBar.getValue(); + value += MOUSE_WHEEL_SPEED * e.getWheelRotation(); + scrollBar.setValue(value); + doLayout(); + } + }); + scrollBar.setPreferredSize(new Dimension(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, this.getHeight())); + scrollBar.setBlockIncrement(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP); + scrollBar.setBorder(BorderFactory.createMatteBorder(0, CONTENT_PANE_WIDTH_GAP, 0, 0, this.getBackground())); + } } diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index 683f17bc73..a3cd546434 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -18,6 +18,7 @@ import com.fr.design.menu.ShortCut; import com.fr.design.selection.QuickEditor; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; +import com.fr.quickeditor.cellquick.CellElementBarLayout; import com.fr.report.cell.TemplateCellElement; import com.fr.stable.ColumnRow; @@ -33,37 +34,145 @@ import java.util.ArrayList; */ public abstract class CellQuickEditor extends QuickEditor { - /*滚动条相关配置*/ - private static final int MAXVALUE = 100; - private static final int TITLE_HEIGHT = 50; - private static final int MOUSE_WHEEL_SPEED = 5; - private static final int CONTENT_PANE_WIDTH_GAP = 4; - private static final int SCROLLBAR_WIDTH = 8; - private int maxHeight = 280; + /*面板配置*/ protected UITextField columnRowTextField; protected TemplateCellElement cellElement; /*占位label*/ protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); protected static final UILabel EMPTY_LABEL = new UILabel(); + protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; static { EMPTY_LABEL.setPreferredSize(LABEL_DIMENSION); } - protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; + /*滚动条相关配置*/ + private static final int MAXVALUE = 100; + private static final int CONTENT_PANE_WIDTH_GAP = 3; + private static final int MOUSE_WHEEL_SPEED = 5; + private static final int SCROLLBAR_WIDTH = 7; + private int maxHeight = 280; + private static final int TITLE_HEIGHT = 50; + private UIComboBox comboBox; private UpdateAction[] cellInsertActions; private int selectedIndex; + private int currentSelectedIndex; private JPanel leftContentPane; private UIScrollBar scrollBar; - /*占位label*/ - protected static UILabel emptyLabel = new UILabel(); - - private int currentSelectedIndex; public CellQuickEditor() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p}; + JComponent centerBody = createCenterBody(); + JPanel topContent = initTopContent(); + if (isScrollAll()) { + prepareScrollBar(); + topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 0, this.getBackground())); + centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); + Component[][] components = new Component[][]{ + new Component[]{topContent, null}, + new Component[]{centerBody, null} + }; + leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + this.setLayout(new CellElementBarLayout(leftContentPane) { + @Override + public void layoutContainer(Container parent) { + maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT; + int beginY; + if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { + beginY = 0; + } else { + int preferredHeight = leftContentPane.getPreferredSize().height; + int value = scrollBar.getValue(); + beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount()); + } + int width = parent.getWidth(); + int height = parent.getHeight(); + if (leftContentPane.getPreferredSize().height > maxHeight) { + leftContentPane.setBounds(0, -beginY, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height + beginY); + scrollBar.setBounds(width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, 0, SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, height); + } else { + leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height); + } + leftContentPane.validate(); + } + }); + this.add(scrollBar); + this.add(leftContentPane); + } else { + topContent.setBorder(BorderFactory.createMatteBorder(10, 10, 0, 10, this.getBackground())); + centerBody.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, this.getBackground())); + Component[][] components = new Component[][]{ + new Component[]{topContent, null}, + new Component[]{centerBody, null} + }; + this.setLayout(new BorderLayout()); + this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP), BorderLayout.CENTER); + } + } + + /** + * 初始化详细信息面板 + * + * @return JComponent 待显示的详细信息面板 + */ + public abstract JComponent createCenterBody(); + + /** + * 是否全局具有滚动条 + * + * @return boolean 是否全局具有滚动条 + */ + public abstract boolean isScrollAll(); + + + /** + * 初始化下拉框中的类型 + * + * @return JComponent 待显示的详细信息面板 + */ + public abstract Object getComboBoxSelected(); + + /** + * 刷新 + */ + @Override + protected void refresh() { + CellSelection cs = (CellSelection) tc.getSelection(); + ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow()); + columnRowTextField.setText(columnRow.toString()); + cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); + refreshDetails(); + } + + /** + * 刷新详细信息 + */ + protected abstract void refreshDetails(); + + + private JPanel initTopContent() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, f}; + double[] rowSize = {p, p}; + UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell")); + cellLabel.setPreferredSize(LABEL_DIMENSION); + UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element")); + insertContentLabel.setPreferredSize(LABEL_DIMENSION); + UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); + Component[][] components = new Component[][]{ + new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, + new Component[]{insertContentLabel, cellElementEditComboBox}, + }; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); + } + private void prepareScrollBar() { scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { @Override public int getVisibleAmount() { @@ -77,7 +186,6 @@ public abstract class CellQuickEditor extends QuickEditor { public int getMaximum() { return MAXVALUE; } - }; scrollBar.addAdjustmentListener(new AdjustmentListener() { @@ -98,43 +206,11 @@ public abstract class CellQuickEditor extends QuickEditor { } }); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p}; - JComponent centerBody = createCenterBody(); - centerBody.setBorder(BorderFactory.createMatteBorder(0, 10, 0, 0, this.getBackground())); - Component[][] components = new Component[][]{ - new Component[]{initTopContent(), null}, - new Component[]{centerBody, null} - }; - leftContentPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - this.setLayout(new BarLayout()); - this.add(scrollBar); - this.add(leftContentPane); - } - - - private JPanel initTopContent() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell")); - cellLabel.setPreferredSize(LABEL_DIMENSION); - UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element")); - insertContentLabel.setPreferredSize(LABEL_DIMENSION); - UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); - Component[][] components = new Component[][]{ - new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, - new Component[]{insertContentLabel, cellElementEditComboBox}, - }; - JPanel topContent = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - topContent.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); - return topContent; + scrollBar.setPreferredSize(new Dimension(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP, this.getHeight())); + scrollBar.setBlockIncrement(SCROLLBAR_WIDTH + CONTENT_PANE_WIDTH_GAP); + scrollBar.setBorder(BorderFactory.createMatteBorder(0, CONTENT_PANE_WIDTH_GAP, 0, 0, this.getBackground())); } - /** * 初始化添加按钮 * @@ -209,88 +285,4 @@ public abstract class CellQuickEditor extends QuickEditor { }); return columnRowTextField; } - - - /** - * 初始化详细信息面板 - * - * @return JComponent 待显示的详细信息面板 - */ - public abstract JComponent createCenterBody(); - - - /** - * 初始化下拉框中的类型 - * - * @return JComponent 待显示的详细信息面板 - */ - public abstract Object getComboBoxSelected(); - - /** - * 刷新 - */ - @Override - protected void refresh() { - CellSelection cs = (CellSelection) tc.getSelection(); - ColumnRow columnRow = ColumnRow.valueOf(cs.getColumn(), cs.getRow()); - columnRowTextField.setText(columnRow.toString()); - cellElement = tc.getEditingElementCase().getTemplateCellElement(cs.getColumn(), cs.getRow()); - refreshDetails(); - } - - /** - * 刷新详细信息 - */ - protected abstract void refreshDetails(); - - /** - * 属性面板的滚动条和内容区域的布局管理类 - * yaoh.wu 由于这边不能继承{@link com.fr.design.mainframe.AbstractAttrPane.BarLayout},所以冗余了一份滚动条代码进来 - * - * @see com.fr.design.mainframe.AbstractAttrPane.BarLayout - */ - protected class BarLayout implements LayoutManager { - - @Override - public void addLayoutComponent(String name, Component comp) { - - } - - @Override - public void removeLayoutComponent(Component comp) { - - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - return leftContentPane.getPreferredSize(); - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - return leftContentPane.getMinimumSize(); - } - - @Override - public void layoutContainer(Container parent) { - maxHeight = CellElementPropertyPane.getInstance().getHeight() - TITLE_HEIGHT; - int beginY; - if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { - beginY = 0; - } else { - int preferredHeight = leftContentPane.getPreferredSize().height; - int value = scrollBar.getValue(); - beginY = value * (preferredHeight - maxHeight) / (MAXVALUE - scrollBar.getVisibleAmount()); - } - int width = parent.getWidth(); - int height = parent.getHeight(); - if (leftContentPane.getPreferredSize().height > maxHeight) { - leftContentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - CONTENT_PANE_WIDTH_GAP, height + beginY); - scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height); - } else { - leftContentPane.setBounds(0, 0, width - SCROLLBAR_WIDTH - CONTENT_PANE_WIDTH_GAP, height); - } - leftContentPane.validate(); - } - } } \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java index d5d8e1f800..8347f6d0d9 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java @@ -68,4 +68,9 @@ public class CellBiasTextPainterEditor extends CellQuickEditor { protected void refreshDetails() { } + @Override + public boolean isScrollAll() { + return true; + } + } \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index d7c6ddbd47..4ea7a138c9 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -98,6 +98,11 @@ public class CellDSColumnEditor extends CellQuickEditor { return centerPane; } + @Override + public boolean isScrollAll() { + return false; + } + /** * 内容全部重新动态生成,不然容易出错 * 刷新详细信息面板 @@ -158,9 +163,11 @@ public class CellDSColumnEditor extends CellQuickEditor { paneList = new ArrayList<>(); /*基本设置面板*/ DSColumnBasicEditorPane cellDSColumnBasicPane = new DSColumnBasicEditorPane(); + paneList.add(cellDSColumnBasicPane); /*高级设置面板*/ cellDSColumnAdvancedPane = new DSColumnAdvancedEditorPane(); + paneList.add(cellDSColumnAdvancedPane); } @@ -209,7 +216,6 @@ public class CellDSColumnEditor extends CellQuickEditor { }; DSColumnBasicEditorPane() { - this.setLayout(new BorderLayout()); dataPane = new SelectedDataColumnPane(true, true, tc, cellElement); groupPane = new ResultSetGroupDockingPane(tc); dataPane.addListener(dataListener); @@ -231,8 +237,9 @@ public class CellDSColumnEditor extends CellQuickEditor { new Component[]{uiLabel, uiButton} }; conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); - this.add(this.createContentPane(), BorderLayout.CENTER); + this.createScrollPane(); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + } @@ -265,7 +272,7 @@ public class CellDSColumnEditor extends CellQuickEditor { * * @return content JPanel */ - private JPanel createContentPane() { + protected JPanel createContentPane() { double[] columnSize = {F}; double[] rowSize = {P, P, P}; @@ -303,9 +310,8 @@ public class CellDSColumnEditor extends CellQuickEditor { public DSColumnAdvancedEditorPane() { - this.setLayout(new BorderLayout()); - this.add(this.createContentPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + this.createScrollPane(); } @@ -415,7 +421,7 @@ public class CellDSColumnEditor extends CellQuickEditor { * * @return 内容面板 */ - private JPanel createContentPane() { + protected JPanel createContentPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); //结果集排序 sortPane = new ResultSetSortConfigPane(); diff --git a/designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java b/designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java new file mode 100644 index 0000000000..c9714bc465 --- /dev/null +++ b/designer/src/com/fr/quickeditor/cellquick/CellElementBarLayout.java @@ -0,0 +1,41 @@ +package com.fr.quickeditor.cellquick; + +import javax.swing.*; +import java.awt.*; + +/** + * 单元格元素面板的滚动条 + * + * @see com.fr.design.mainframe.AbstractAttrPane.BarLayout + */ +public abstract class CellElementBarLayout implements LayoutManager { + + private JPanel leftContentPane; + + protected CellElementBarLayout(JPanel leftContentPane) { + this.leftContentPane = leftContentPane; + } + + @Override + public void addLayoutComponent(String name, Component comp) { + + } + + @Override + public void removeLayoutComponent(Component comp) { + + } + + @Override + public Dimension preferredLayoutSize(Container parent) { + return leftContentPane.getPreferredSize(); + } + + @Override + public Dimension minimumLayoutSize(Container parent) { + return leftContentPane.getMinimumSize(); + } + + @Override + public abstract void layoutContainer(Container parent); +} \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index 7429b146eb..7d245434cc 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -203,4 +203,9 @@ public class CellFormulaQuickEditor extends CellQuickEditor { formulaTextField.getDocument().addDocumentListener(documentListener); } + @Override + public boolean isScrollAll() { + return true; + } + } \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java index 25818e79f3..d33ff1828d 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java @@ -72,6 +72,11 @@ public class CellImageQuickEditor extends CellQuickEditor { } + @Override + public boolean isScrollAll() { + return true; + } + @Override public Object getComboBoxSelected() { return ActionFactory.createAction(ImageCellAction.class); diff --git a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 75ef442dae..1c0bdd04da 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -49,4 +49,9 @@ public class CellRichTextEditor extends CellQuickEditor { richTextButton.setAction(subReportCellAction); } + @Override + public boolean isScrollAll() { + return true; + } + } \ No newline at end of file diff --git a/designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java index c82a3883dc..bd5ea60d1c 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java @@ -90,6 +90,11 @@ public class CellStringQuickEditor extends CellQuickEditor { return content; } + @Override + public boolean isScrollAll() { + return true; + } + private void changeReportPaneCell(String tmpText) { isEditing = true; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java index 70d8c51ea1..be34789f9b 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -50,4 +50,8 @@ public class CellSubReportEditor extends CellQuickEditor { return ActionFactory.createAction(SubReportCellAction.class); } + @Override + public boolean isScrollAll() { + return true; + } } \ No newline at end of file