From e60e6e46b3eb1113cd671f7a09cc51b9e24b8176 Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 27 Mar 2017 16:33:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 18 +++++++----------- .../chart/gui/style/axis/ChartValuePane.java | 5 ++--- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 73235dc31..4a9be221d 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p, p, p, p, p}; + double[] rowSize = { p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i+=2) { + for(int i = 0; i < components.length; i++) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,19 +57,15 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); } } protected Component[][] getPanelComponents() { return new Component[][]{ - new Component[]{minCheckBox}, - new Component[]{minValueField}, - new Component[]{maxCheckBox}, - new Component[]{maxValueField}, - new Component[]{isCustomMainUnitBox}, - new Component[]{mainUnitField}, - new Component[]{isCustomSecUnitBox}, - new Component[]{secUnitField}, + new Component[]{minCheckBox, minValueField}, + new Component[]{maxCheckBox, maxValueField}, + new Component[]{isCustomMainUnitBox, mainUnitField}, + new Component[]{isCustomSecUnitBox, secUnitField}, }; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index f798a0a07..d25ed2997 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,11 +151,10 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = { p, p, p}; + double[] rowSize = {p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), null}, - new Component[]{null, null, addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } From b7fea495cff85298182c710dc5c2dd98ffbbdbde Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 27 Mar 2017 16:43:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 18 +++++++++++------- .../chart/gui/style/axis/ChartValuePane.java | 5 +++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index 4a9be221d..73235dc31 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p}; + double[] rowSize = { p, p, p, p, p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i++) { + for(int i = 0; i < components.length; i+=2) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,15 +57,19 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); } } protected Component[][] getPanelComponents() { return new Component[][]{ - new Component[]{minCheckBox, minValueField}, - new Component[]{maxCheckBox, maxValueField}, - new Component[]{isCustomMainUnitBox, mainUnitField}, - new Component[]{isCustomSecUnitBox, secUnitField}, + new Component[]{minCheckBox}, + new Component[]{minValueField}, + new Component[]{maxCheckBox}, + new Component[]{maxValueField}, + new Component[]{isCustomMainUnitBox}, + new Component[]{mainUnitField}, + new Component[]{isCustomSecUnitBox}, + new Component[]{secUnitField}, }; } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index d25ed2997..f798a0a07 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,10 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = {p, p}; + double[] rowSize = { p, p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), null}, + new Component[]{null, null, addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } From fed1ceaeea3185789c5a78b17671d7f29afe7850 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 18 Apr 2017 23:34:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E4=B8=AD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E4=B8=80=E4=BA=9B=E6=8E=A5=E5=8F=A3=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=88Vancharts=E6=96=B0=E6=8F=92=E4=BB=B6=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=9C=80=E8=A6=81=EF=BC=8Ceason=E4=B8=8EFR=E5=95=86=E8=AE=A8?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=EF=BC=8C=E5=8F=AF=E4=BB=A5=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9master=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/TableDataPane.java | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index a6bea6b0c..721e7432a 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -25,6 +25,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ private ChartDataPane parent; + protected AbstractTableDataContentPane getDataContentPane() { + return dataContentPane; + } + public TableDataPane(ChartDataPane parent) { this.parent = parent; initDataPane(); @@ -103,34 +107,41 @@ public class TableDataPane extends FurtherBasicBeanPane{ * @param collection 图表属性的集合 */ public void refreshContentPane(ChartCollection collection) { + refreshContentPane(getContentPane(collection.getSelectedChart().getPlot())); + } + + protected void refreshContentPane(AbstractTableDataContentPane contentPane) { if(dataContentPane != null) { remove(dataContentPane); } - dataContentPane = getContentPane(collection.getSelectedChart().getPlot()); + dataContentPane = contentPane; if(dataContentPane != null) { add(dataContentPane, BorderLayout.CENTER); } } - /** - * 更新界面属性 + * 更新界面属性 */ public void populateBean(ChartCollection collection) { if(collection == null) { return; } TableDataDefinition data = (TableDataDefinition)collection.getSelectedChart().getFilterDefinition(); + populateDSName(data); + if(dataContentPane != null) { + dataContentPane.populateBean(collection); + } + } + protected void populateDSName(TableDataDefinition dataDefinition){ + TableData tableData = null; - if(data != null) { - tableData = data.getTableData(); + if(dataDefinition != null) { + tableData = dataDefinition.getTableData(); } onSelectTableData(); checkBoxUse(); tableDataPane.populateBean(tableData); - if(dataContentPane != null) { - dataContentPane.populateBean(collection); - } } /** @@ -141,6 +152,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ dataContentPane.updateBean(collection); } TopDefinition dataDefinition = (TopDefinition)collection.getSelectedChart().getFilterDefinition(); + updateDSName(dataDefinition); + } + + protected void updateDSName(TopDefinition dataDefinition) { if(dataDefinition instanceof TableDataDefinition) { TableDataWrapper tableDataWrapper = tableDataPane.getTableDataWrapper(); if (dataDefinition != null && tableDataWrapper != null){