Browse Source

Merge pull request #533 in BA/design from ~ZHENG/design:dev to dev

* commit 'c931aec0386fab64d572eb9b805e6352f3702b95':
  代码质量
  pmd
  单元格数据源公式没有335$
master
superman 8 years ago
parent
commit
557b37187f
  1. 16
      designer_base/src/com/fr/design/formula/TinyFormulaPane.java
  2. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  3. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

16
designer_base/src/com/fr/design/formula/TinyFormulaPane.java

@ -42,7 +42,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> 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));
@ -56,11 +56,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
@Override
public void doOk() {
Formula fm = formulaPane.update();
if (fm.getContent().length() <= 1) {
formulaTextField.setText("$$$");
} else {
formulaTextField.setText(fm.getContent());
}
populateTextField(fm);
okEvent();
}
}).setVisible(true);
@ -69,6 +65,14 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
initLayout();
}
protected void populateTextField(Formula fm) {
if (fm.getContent().length() <= 1) {
formulaTextField.setText("$$$");
} else {
formulaTextField.setText(fm.getContent());
}
}
protected void initLayout() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;

7
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<ChartC
seriesPane.stopCellEditing();
seriesPane.fireTargetChanged();
}
@Override
protected void populateTextField(Formula fm) {
formulaTextField.setText(fm.getContent());
}
};
editorComponent.setBackground(UIConstants.FLESH_BLUE);

6
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.data.report;
import com.fr.base.Formula;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
@ -56,6 +57,11 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
this.add(formulaTextFieldButton, BorderLayout.EAST);
}
@Override
protected void populateTextField(Formula fm) {
formulaTextField.setText(fm.getContent());
}
public void okEvent() {
checkBoxUse();
}

Loading…
Cancel
Save