Browse Source

CHART-13666 代码质量

feature/big-screen
白岳 5 years ago
parent
commit
87c6994e38
  1. 14
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java
  2. 6
      designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java
  3. 8
      designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java
  4. 31
      designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java
  5. 15
      designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java
  6. 3
      designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java

14
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java

@ -53,7 +53,7 @@ public class UICheckListPopup extends UIPopupMenu {
public void setMaxDisplayNumber(int maxDisplayNumber) {
this.maxDisplayNumber = maxDisplayNumber;
addCheckboxValues(values);
addCheckboxValues();
}
private void initComponent() {
@ -65,21 +65,21 @@ public class UICheckListPopup extends UIPopupMenu {
this.setLayout(new BorderLayout());
this.add(jScrollPane, BorderLayout.CENTER);
addCheckboxValues(values);
addCheckboxValues();
}
public void refreshCheckboxValues(Object[] value){
this.values = value;
addCheckboxValues(values);
public void refreshCheckboxValues(Object[] values){
this.values = values;
addCheckboxValues();
}
public void addCheckboxValues(Object[] value) {
private void addCheckboxValues() {
checkboxPane.removeAll();
checkBoxList.clear();
//全选加在第一个位置
addOneCheckValue(SELECT_ALL);
for (Object checkValue : value) {
for (Object checkValue : values) {
addOneCheckValue(checkValue);
}
addSelectListener();

6
designer-chart/src/main/java/com/fr/design/chart/AutoChartDialog.java

@ -34,8 +34,8 @@ public class AutoChartDialog extends ChartDialog {
return autoChartTypePane;
}
protected void addOkAction() {
ok.addActionListener(new ActionListener() {
protected ActionListener getActionListener() {
return new ActionListener() {
public void actionPerformed(ActionEvent e) {
ChartCollection chartCollection = (ChartCollection) getChartCollection();
autoChartTypePane.update(chartCollection);
@ -45,7 +45,7 @@ public class AutoChartDialog extends ChartDialog {
doCancel();
}
}
});
};
}
/**

8
designer-chart/src/main/java/com/fr/design/chart/AutoChartIcon.java

@ -1,13 +1,12 @@
package com.fr.design.chart;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.chart.result.WebChartIDInfo;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.script.Calculator;
import javax.swing.Icon;
@ -69,10 +68,7 @@ public class AutoChartIcon implements Icon {
BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(),
WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight());
int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
if (resolution == 0) {
resolution = ScreenResolution.getScreenResolution();
}
int resolution = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getJTemplateResolution();
Graphics2D g2d = (Graphics2D) g;
Paint oldPaint = g2d.getPaint();

31
designer-chart/src/main/java/com/fr/design/chart/AutoChartTypePane.java

@ -1,7 +1,5 @@
package com.fr.design.chart;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartGetter;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chartx.attr.ChartProvider;
@ -14,10 +12,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.line.VanChartLinePlot;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
@ -168,31 +162,6 @@ public class AutoChartTypePane extends ChartWizardPane implements CallbackEvent
private void calculateAutoChart() {
chartResultModel.clear();
//TODO 使用以下模拟数据,计算规则待补充
BaseChartCollection chartCollection = BaseChartGetter.createChartCollection(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID);
VanChart selectedChart = ((ChartCollection) chartCollection).getSelectedChart(VanChart.class);
selectedChart.getTitle().setTextObject("自动图表标题");
BaseChartCollection chartCollection1 = BaseChartGetter.createChartCollection(VanChartLinePlot.VAN_CHART_LINE_PLOT);
VanChart selectedChart1 = ((ChartCollection) chartCollection1).getSelectedChart(VanChart.class);
selectedChart1.getTitle().setTextObject("自动图表标题");
BaseChartCollection chartCollection2 = BaseChartGetter.createChartCollection(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID);
VanChart selectedChart2 = ((ChartCollection) chartCollection2).getSelectedChart(VanChart.class);
selectedChart2.getTitle().setTextObject("自动图表标题");
AutoChartIcon autoChartIcon = new AutoChartIcon((ChartCollection) chartCollection);
autoChartIcon.registerCallBackEvent(this);
AutoChartIcon autoChartIcon1 = new AutoChartIcon((ChartCollection) chartCollection1);
autoChartIcon1.registerCallBackEvent(this);
AutoChartIcon autoChartIcon2 = new AutoChartIcon((ChartCollection) chartCollection2);
autoChartIcon2.registerCallBackEvent(this);
chartResultModel.addElement(autoChartIcon);
chartResultModel.addElement(autoChartIcon1);
chartResultModel.addElement(autoChartIcon2);
chartViewList.setSelectedIndex(0);
}
@Override

15
designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java

@ -27,9 +27,10 @@ public class ChartDialog extends MiddleChartDialog {
private BaseChartCollection cc;
protected UIButton ok;
protected UIButton cancel;
private UIButton ok;
private UIButton cancel;
private ChartTypePane chartTypePane;
private String createTime;
public ChartDialog(Frame owner) {
super(owner);
@ -42,6 +43,7 @@ public class ChartDialog extends MiddleChartDialog {
}
private void initComponent() {
createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
this.setModal(true);
this.setLayout(new BorderLayout());
setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"));
@ -58,7 +60,7 @@ public class ChartDialog extends MiddleChartDialog {
ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel"));
addOkAction();
ok.addActionListener(getActionListener());
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doCancel();
@ -76,14 +78,13 @@ public class ChartDialog extends MiddleChartDialog {
return chartTypePane;
}
protected void addOkAction() {
final String createTime = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
ok.addActionListener(new ActionListener() {
protected ActionListener getActionListener() {
return new ActionListener() {
public void actionPerformed(ActionEvent e) {
chartTypePane.update((ChartCollection) cc, createTime);
doOK();
}
});
};
}
/**

3
designer-realize/src/main/java/com/fr/design/actions/insert/cell/AutoChartCellAction.java

@ -3,6 +3,7 @@ package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.AutoChartCollection;
import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
@ -40,7 +41,7 @@ public class AutoChartCellAction extends AbstractCellAction implements WorkBookS
@Override
public String getMenuName() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart");
return Toolkit.i18nText("Fine-Design_Report_M_Insert_Auto_Chart");
}
@Override

Loading…
Cancel
Save