From 12a8f10b116dbab50d509ff5439e63f167062e92 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 21 Nov 2016 15:06:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E5=85=AC=E5=BC=8F=E6=B2=A1=E6=9C=89335$?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/TinyFormulaPane.java | 6 +++++- .../gui/data/report/AbstractReportDataContentPane.java | 7 ++++++- .../gui/data/report/CategoryPlotReportDataContentPane.java | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java index 16c897bc12..a7ea7b6cf9 100644 --- a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java +++ b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java @@ -56,7 +56,7 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver @Override public void doOk() { Formula fm = formulaPane.update(); - if (fm.getContent().length() <= 1) { + if (dealEmpty() && fm.getContent().length() <= 1) { formulaTextField.setText("$$$"); } else { formulaTextField.setText(fm.getContent()); @@ -69,6 +69,10 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver initLayout(); } + protected boolean dealEmpty() { + return true; + } + protected void initLayout() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; 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 6754ca7965..dd24b450c0 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 @@ -3,8 +3,8 @@ package com.fr.design.mainframe.chart.gui.data.report; import com.fr.base.Formula; import com.fr.base.Utils; import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.constants.UIConstants; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.UIConstants; import com.fr.design.event.UIObserverListener; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UICorrelationPane; @@ -155,6 +155,11 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane Date: Mon, 21 Nov 2016 15:18:33 +0800 Subject: [PATCH 2/3] pmd --- designer_base/src/com/fr/design/formula/TinyFormulaPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java index a7ea7b6cf9..da60d4f235 100644 --- a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java +++ b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java @@ -42,7 +42,7 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver // 添加一公式编辑器按钮 formulaTextFieldButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); - formulaTextFieldButton.setToolTipText(Inter.getLocText("Formula") + "..."); + formulaTextFieldButton.setToolTipText(Inter.getLocText("FR-Designer_Formula") + "..."); formulaTextFieldButton.setPreferredSize(new Dimension(24, 20)); formulaTextFieldButton.setOpaque(false); formulaTextFieldButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); From c931aec0386fab64d572eb9b805e6352f3702b95 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 21 Nov 2016 16:36:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/formula/TinyFormulaPane.java | 14 +++++++------- .../data/report/AbstractReportDataContentPane.java | 4 ++-- .../report/CategoryPlotReportDataContentPane.java | 5 +++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java index da60d4f235..649d5face2 100644 --- a/designer_base/src/com/fr/design/formula/TinyFormulaPane.java +++ b/designer_base/src/com/fr/design/formula/TinyFormulaPane.java @@ -56,11 +56,7 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver @Override public void doOk() { Formula fm = formulaPane.update(); - if (dealEmpty() && fm.getContent().length() <= 1) { - formulaTextField.setText("$$$"); - } else { - formulaTextField.setText(fm.getContent()); - } + populateTextField(fm); okEvent(); } }).setVisible(true); @@ -69,8 +65,12 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver initLayout(); } - protected boolean dealEmpty() { - return true; + protected void populateTextField(Formula fm) { + if (fm.getContent().length() <= 1) { + formulaTextField.setText("$$$"); + } else { + formulaTextField.setText(fm.getContent()); + } } protected void initLayout() { 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 dd24b450c0..4ff643522c 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 @@ -157,8 +157,8 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane