From 67bf6a1d0c255e0faff8bc1fbe01ecfa00628a11 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 1 Sep 2017 13:39:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E6=AE=B5=E9=A2=9C=E8=89=B2=E9=85=8D=E7=BD=AE=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/style/series/UIColorPickerPane.java | 59 ++++++++++--------- .../SectionIntervalConfigPaneWithOutNum.java | 1 - 2 files changed, 32 insertions(+), 28 deletions(-) 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 b5cdb0b74..a4771e1bf 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 @@ -19,6 +19,7 @@ import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; +import com.fr.plugin.chart.designer.TableLayout4VanChartHelper; import com.fr.stable.StringUtils; import javax.swing.*; @@ -32,11 +33,14 @@ import java.util.List; public class UIColorPickerPane extends BasicPane implements UIObserver { private static final int MARGIN_TOP = 10; + private static final int MARGIN_LEFT = 5; + private static final int COLORGROUP_MARGIN_LEFT = 40; private static final int OFF_HEIGHT = 6; private static final int COLOR_REC_HEIGHT = 40; private static final int COLOR_REC_WIDTH = 30; protected static final int TEXTFIELD_HEIGHT = 20; protected static final int TEXTFIELD_WIDTH = 120; + protected static final int UPCONTROLPANE_WIDTH = 230; private static final int LAYOUR_DET = 6; private static final double VALUE = 100; @@ -182,17 +186,18 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { }; double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + double[] columnSize = {d, e}; double[] rowSize = {p}; Component[][] tmpComp = new Component[][]{new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Divided_stage")), regionNumPane}}; - - stagePanel = TableLayoutHelper.createTableLayoutPane(tmpComp, rowSize, columnSize); - + + stagePanel = TableLayout4VanChartHelper.createGapTableLayoutPane(tmpComp, rowSize, columnSize); + Component[][] components = new Component[][]{ new Component[]{new BoldFontTextLabel(Inter.getLocText("FR-Chart-Value_Tick_And_Color")), designTypeButtonGroup}, }; - upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + upControlPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); this.textGroup = new TextFieldGroupPane(); this.colorGroup = new ColorGroupPane(); @@ -204,7 +209,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { this.textFieldList = this.getTextFieldList(); refreshGroupPane(colors, getValueArray(number)); - + } protected ArrayList getTextFieldList(){ @@ -249,7 +254,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { */ public Dimension getPreferredSize() { if (designTypeButtonGroup.getSelectedIndex() == 0) { - return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height); + return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + MARGIN_TOP); } else { int extra = stagePanel == null ? 0 : stagePanel.getPreferredSize().height + this.MARGIN_TOP; return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, @@ -503,7 +508,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { * 根据这些 确定每个Field的最大最小值. 并且改变背景颜色. */ public void checkEveryFiledMinMax() { - + double forValue = Double.MAX_VALUE; double backValue = -Double.MAX_VALUE; for(int i = 0, size = textFieldList.size(); i < size; i++) {// check 是否合格, 然后检查 是否改变颜色, @@ -515,9 +520,9 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { backValue = backNumber.doubleValue(); } } - + Number number = ChartBaseUtils.formula2Number(new Formula(getValue4Index(i))); - + if(number != null) { double value = number.doubleValue(); if(value < forValue && value > backValue) { @@ -571,13 +576,13 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { return null; } - @Override - public void layoutContainer(Container parent) { - upControlPane.setBounds(0, 0, parent.getPreferredSize().width, upControlPane.getPreferredSize().height); - stagePanel.setBounds(0,upControlPane.getPreferredSize().height + LAYOUR_DET, parent.getPreferredSize().width, stagePanel.getPreferredSize().height); - colorGroup.setBounds(0, MARGIN_TOP + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); - textGroup.setBounds(colorGroup.getPreferredSize().width, upControlPane.getPreferredSize().height+ stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); - } + @Override + public void layoutContainer(Container parent) { + upControlPane.setBounds(MARGIN_LEFT, MARGIN_TOP, UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); + stagePanel.setBounds(MARGIN_LEFT, upControlPane.getPreferredSize().height + LAYOUR_DET + MARGIN_TOP, UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); + colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, 2 * MARGIN_TOP + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); + textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + MARGIN_TOP, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); + } @Override public void addLayoutComponent(String name, Component comp) { @@ -601,12 +606,12 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { return null; } - @Override - public void layoutContainer(Container parent) { - upControlPane.setBounds(0, 0, parent.getPreferredSize().width, upControlPane.getPreferredSize().height); - colorGroup.setBounds(0, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); - textGroup.setBounds(colorGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); - } + @Override + public void layoutContainer(Container parent) { + upControlPane.setBounds(MARGIN_LEFT, MARGIN_TOP, UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height); + colorGroup.setBounds(COLORGROUP_MARGIN_LEFT, MARGIN_TOP + upControlPane.getPreferredSize().height + LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); + textGroup.setBounds(colorGroup.getPreferredSize().width + COLORGROUP_MARGIN_LEFT, upControlPane.getPreferredSize().height + LAYOUR_DET, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); + } @Override public void addLayoutComponent(String name, Component comp) { @@ -633,7 +638,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { public int getDesignType(){ return this.designTypeButtonGroup.getSelectedIndex(); } - + public void populateBean(MapHotAreaColor hotAreaColor) { Color mainColor = hotAreaColor.getMainColor(); @@ -650,7 +655,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { regionNumPane.populateBean(value); refreshPane(); } - + private void initContainerLister(){ Container container = UIColorPickerPane.this; while (!(container instanceof ChartStylePane)) { @@ -684,7 +689,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { // 检查 数字顺序. private boolean checkInOrder() { textGroup.checkEveryFiledMinMax(); - + boolean allInOrder = true; double maxValue = Double.MAX_VALUE; 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 899b283e5..0500e8581 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 @@ -35,7 +35,6 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF 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; } From 8ae2cb4c7c41fcadb1eec23251cfe3b7c578f0cd Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Fri, 1 Sep 2017 14:42:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=89=8D=E6=9C=89?= =?UTF-8?q?=E9=99=90=E6=9D=A1=E8=AE=B0=E5=BD=95=E9=BB=98=E8=AE=A4=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/data/ChartDataFilterPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index 622dcb5df..37caea168 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -243,6 +243,8 @@ public class ChartDataFilterPane extends ThirdTabPane { preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + //默认不显示 + preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); notShowNull = new UICheckBox(Inter.getLocText("FR-Chart-Data_NotShowCate")); panel2.add(notShowNull, BorderLayout.NORTH); @@ -416,6 +418,8 @@ public class ChartDataFilterPane extends ThirdTabPane { preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); preDataNumPane.setBorder(BorderFactory.createEmptyBorder(0,15,0,0)); + //默认不显示 + preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); notShowNull = new UICheckBox(Inter.getLocText("FR-Chart-Data_NotShowSeries")); panel2.add(notShowNull, BorderLayout.NORTH);