From ceea3afd2817809ab2e7b2af51e2f2b7c36eafd9 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 27 Sep 2018 16:37:40 +0800 Subject: [PATCH 1/6] =?UTF-8?q?CHART-3044=20=E6=96=B0=E5=A2=9E=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=99=A8=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ColorBackgroundQuickPane.java | 113 +++++++++--------- .../style/color/NewColorSelectPane.java | 16 ++- 2 files changed, 72 insertions(+), 57 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 8309a802d2..0861af63d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -6,7 +6,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.color.NewColorSelectPane; import com.fr.general.Background; - import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -18,18 +17,24 @@ import java.awt.Color; */ public class ColorBackgroundQuickPane extends BackgroundQuickPane { - private NewColorSelectPane detailColorSelectPane; - private boolean isBackGroundColor; + private NewColorSelectPane detailColorSelectPane; + private boolean isBackGroundColor; + + public ColorBackgroundQuickPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(); + this.add(detailColorSelectPane, BorderLayout.NORTH); + } - public ColorBackgroundQuickPane() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); + public ColorBackgroundQuickPane(Color color) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(color); + this.add(detailColorSelectPane, BorderLayout.NORTH); + } - detailColorSelectPane = new NewColorSelectPane(); - this.add(detailColorSelectPane, BorderLayout.NORTH); - } - public void populateBean(Background background) { - ColorBackground colorBackgroud = (ColorBackground) background; + public void populateBean(Background background) { + ColorBackground colorBackgroud = (ColorBackground) background; populateColor(colorBackgroud.getColor()); } @@ -47,48 +52,48 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { return this.detailColorSelectPane.getNotNoneColor(); } - public boolean isBackGroundColor(){ - return isBackGroundColor; - } - - /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ - public void registerChangeListener(final UIObserverListener listener) { - detailColorSelectPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - isBackGroundColor = true; - listener.doChange(); - isBackGroundColor = false; - } - }); - } - - @Override - /** - * 是否为ColorBackground 类型 - * - * @param background 背景 - * @return 同上 - * - */ - public boolean accept(Background background) { - return background instanceof ColorBackground; - } - - @Override - /** - * 窗口名称 - * @return 同上 - */ - public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"); - } - - @Override - public void reset() { - this.detailColorSelectPane.setColor(null); - } + public boolean isBackGroundColor() { + return isBackGroundColor; + } + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ + public void registerChangeListener(final UIObserverListener listener) { + detailColorSelectPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + isBackGroundColor = true; + listener.doChange(); + isBackGroundColor = false; + } + }); + } + + @Override + /** + * 是否为ColorBackground 类型 + * + * @param background 背景 + * @return 同上 + * + */ + public boolean accept(Background background) { + return background instanceof ColorBackground; + } + + @Override + /** + * 窗口名称 + * @return 同上 + */ + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"); + } + + @Override + public void reset() { + this.detailColorSelectPane.setColor(null); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index fec4993221..5b3dd97a47 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -8,11 +8,16 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; - -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -49,6 +54,11 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } + public NewColorSelectPane(Color color) { + this(false); + this.setColor(color); + } + /** * Constructor. */ From 6de15112dd0fb7c53ccf2c105fcee3775e0b24d0 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 27 Sep 2018 18:09:20 +0800 Subject: [PATCH 2/6] revert code --- .../mainframe/backgroundpane/ColorBackgroundQuickPane.java | 7 ------- .../java/com/fr/design/style/color/NewColorSelectPane.java | 4 ---- 2 files changed, 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 0861af63d0..6ae9ce5ebc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -26,13 +26,6 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { this.add(detailColorSelectPane, BorderLayout.NORTH); } - public ColorBackgroundQuickPane(Color color) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - detailColorSelectPane = new NewColorSelectPane(color); - this.add(detailColorSelectPane, BorderLayout.NORTH); - } - - public void populateBean(Background background) { ColorBackground colorBackgroud = (ColorBackground) background; populateColor(colorBackgroud.getColor()); diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 5b3dd97a47..e06e55a059 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -54,10 +54,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } - public NewColorSelectPane(Color color) { - this(false); - this.setColor(color); - } /** * Constructor. From 7505fdd631479e28eaa3c3703a63144aecefdb54 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sat, 29 Sep 2018 20:00:53 +0800 Subject: [PATCH 3/6] revert code --- .../backgroundpane/ColorBackgroundQuickPane.java | 2 ++ .../fr/design/style/color/NewColorSelectPane.java | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 6ae9ce5ebc..89c61ec9d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -6,6 +6,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.color.NewColorSelectPane; import com.fr.general.Background; + import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -22,6 +23,7 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { public ColorBackgroundQuickPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(); this.add(detailColorSelectPane, BorderLayout.NORTH); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index e06e55a059..fec4993221 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -8,16 +8,11 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JPanel; + +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GridLayout; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -54,7 +49,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } - /** * Constructor. */ From 6f1fa596446448698da5ba8afbf7bea36f38b0da Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 11:35:41 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=9A=82=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=8C=BA=E9=97=B4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=9C=80=E4=B8=8B=E9=9D=A2=E9=A2=9C=E8=89=B2=E8=A2=AB=E9=81=AE?= =?UTF-8?q?=E6=8C=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SectionIntervalConfigPaneWithOutNum.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index eff5060620..1c8cfdb464 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -3,7 +3,6 @@ package com.fr.van.chart.range.component; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; - import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; @@ -16,7 +15,7 @@ import java.awt.Dimension; * Created by Mitisky on 16/10/20. * 没有主题颜色,自动的时候没有划分阶段 */ -public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula{ +public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula { private BoldFontTextLabel numLabel; public SectionIntervalConfigPaneWithOutNum(AbstractAttrNoScrollPane container) { @@ -24,7 +23,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF getDesignTypeButtonGroup().addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if(getDesignTypeButtonGroup().getSelectedIndex() == 0){ + if (getDesignTypeButtonGroup().getSelectedIndex() == 0) { setRegionVisible(false); } else { setRegionVisible(true); @@ -33,15 +32,16 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF }); } - protected JPanel getUpControlPane (Component[][] components) { + @Override + 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); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze(), columnSize); return panel; } - private void setRegionVisible(boolean visible){ + private void setRegionVisible(boolean visible) { getRegionNumPane().setVisible(visible); numLabel.setVisible(visible); } @@ -53,13 +53,14 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF setRegionVisible(false); return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")),getDesignTypeButtonGroup()}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")), getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; } - public Dimension getPreferredSize(){ + @Override + public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - return new Dimension((int)dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); + return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); } } From 8332a48601a1df4acceac4f013f76d8a57f01d82 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 17:20:47 +0800 Subject: [PATCH 5/6] CHART-3043 --- .../component/SectionIntervalConfigPaneWithOutNum.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index 1c8cfdb464..c3146ff89c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -1,5 +1,6 @@ package com.fr.van.chart.range.component; +import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; @@ -63,4 +64,10 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF Dimension dim = super.getPreferredSize(); return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); } + + @Override + public void populateBean(MapHotAreaColor hotAreaColor) { + super.populateBean(hotAreaColor); + setRegionVisible(hotAreaColor.getUseType() == 1); + } } From aa983470dcf3f24da3f4d1cc86fa9d6ab53d9c6c Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 17:28:48 +0800 Subject: [PATCH 6/6] CHART-3043 --- .../range/component/SectionIntervalConfigPaneWithOutNum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index c3146ff89c..e8342aad5c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -62,7 +62,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); + return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); } @Override