Browse Source

Merge pull request #779 in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit '526ff727863bba596f3b0a26c7ea2972a9dfecfe':
  大屏插件jartime更新 顺便解决之前的一些代码质量
bugfix/10.0
zheng 6 years ago
parent
commit
ffe22570bc
  1. 55
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  2. 44
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java
  3. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java
  4. 18
      designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java

55
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java

@ -12,8 +12,8 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -92,38 +92,53 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) { if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) {
ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition(); ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) { populateDataSet(dataSet);
populate((T) dataConfig); }
}
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
if (hasCustomFieldPane() && dataConfig.getCustomFields().size() == 2) { if (hasCustomFieldPane() && dataConfig.getCustomFields().size() == 2) {
populateField(seriesPane, dataConfig.getCustomFields().get(0)); populateField(seriesPane, dataConfig.getCustomFields().get(0));
populateField(valuePane, dataConfig.getCustomFields().get(1)); populateField(valuePane, dataConfig.getCustomFields().get(1));
}
} }
} }
} }
public ExtendedReportDataSet updateDataSet() {
ExtendedReportDataSet dataSet = new ExtendedReportDataSet();
AbstractDataConfig dataConfig = update();
dataSet.setDataConfig(dataConfig);
List<ExtendedField> fieldList = new ArrayList<ExtendedField>();
if (hasCustomFieldPane()) {
fieldList.add(new ExtendedField(seriesPane.updateBean()));
fieldList.add(new ExtendedField(valuePane.updateBean()));
}
dataConfig.setCustomFields(fieldList);
return dataSet;
}
@Override @Override
public void updateBean(ChartCollection ob) { public void updateBean(ChartCollection ob) {
if (ob != null) { if (ob != null) {
Chart chart = ob.getSelectedChart(); Chart chart = ob.getSelectedChart();
if (chart != null) { if (chart != null) {
ExtendedReportDataSet dataSet = new ExtendedReportDataSet();
AbstractDataConfig dataConfig = update();
dataSet.setDataConfig(dataConfig);
List<ExtendedField> fieldList = new ArrayList<ExtendedField>();
if (hasCustomFieldPane()) {
fieldList.add(new ExtendedField(seriesPane.updateBean()));
fieldList.add(new ExtendedField(valuePane.updateBean()));
}
dataConfig.setCustomFields(fieldList);
chart.setFilterDefinition(dataSet); chart.setFilterDefinition(updateDataSet());
} }
} }
} }

44
designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java

@ -93,17 +93,40 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) { if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) {
ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition(); ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition();
AbstractDataConfig dataConfig = dataSet.getDataConfig(); populateDataSet(dataSet);
if (dataConfig != null) {
populate((T) dataConfig);
if (customFieldComboBoxPane != null) { }
customFieldComboBoxPane.populateBean(dataConfig);
} }
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.populateBean(dataConfig);
} }
}
}
public ExtendedTableDataSet updateDataSet() {
ExtendedTableDataSet dataSet = new ExtendedTableDataSet();
dataSet.setDataConfig(update());
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.updateBean(dataSet.getDataConfig());
} }
return dataSet;
} }
@ -113,14 +136,7 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
Chart chart = ob.getSelectedChart(); Chart chart = ob.getSelectedChart();
if (chart != null) { if (chart != null) {
ExtendedTableDataSet dataSet = new ExtendedTableDataSet(); chart.setFilterDefinition(updateDataSet());
dataSet.setDataConfig(update());
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.updateBean(dataSet.getDataConfig());
}
chart.setFilterDefinition(dataSet);
} }
} }
} }

14
designer-chart/src/main/java/com/fr/van/chart/designer/style/HeatMapRangeLegendPane.java

@ -1,12 +1,16 @@
package com.fr.van.chart.designer.style; package com.fr.van.chart.designer.style;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.plugin.chart.type.LegendType; import com.fr.plugin.chart.type.LegendType;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
import com.fr.van.chart.range.component.GradualIntervalConfigPane; import com.fr.van.chart.range.component.GradualIntervalConfigPane;
import com.fr.van.chart.range.component.GradualLegendPane; import com.fr.van.chart.range.component.GradualLegendPane;
import com.fr.van.chart.range.component.LegendGradientBar;
import com.fr.van.chart.range.component.SectionIntervalConfigPaneWithOutNum; import com.fr.van.chart.range.component.SectionIntervalConfigPaneWithOutNum;
import com.fr.van.chart.range.component.SectionLegendPane; import com.fr.van.chart.range.component.SectionLegendPane;
@ -46,8 +50,12 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane {
protected GradualIntervalConfigPane createGradualIntervalConfigPane() { protected GradualIntervalConfigPane createGradualIntervalConfigPane() {
return new GradualIntervalConfigPane(){ return new GradualIntervalConfigPane(){
@Override @Override
protected Component[][] getPaneComponents() { protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane, ColorSelectBoxWithOutTransparent colorSelectBox, UINumberDragPane numberDragPane, LegendGradientBar legendGradientBar) {
return super.getPaneComponentsWithOutTheme(); return new Component[][]{
new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane},
new Component[]{null, legendGradientBar}
};
} }
}; };
} }

18
designer-chart/src/main/java/com/fr/van/chart/range/component/GradualIntervalConfigPane.java

@ -4,7 +4,6 @@ import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.range.GradualIntervalConfig; import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick; import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
@ -23,7 +22,7 @@ public class GradualIntervalConfigPane extends JPanel{
//主题颜色 //主题颜色
private ColorSelectBoxWithOutTransparent colorSelectBox; private ColorSelectBoxWithOutTransparent colorSelectBox;
//划分阶段 //划分阶段
UINumberDragPane numberDragPane; private UINumberDragPane numberDragPane;
//渐变色编辑器 //渐变色编辑器
private LegendGradientBar legendGradientBar; private LegendGradientBar legendGradientBar;
@ -58,7 +57,7 @@ public class GradualIntervalConfigPane extends JPanel{
double[] col = new double[]{f, e}; double[] col = new double[]{f, e};
double[] row = new double[]{p, p, p, p}; double[] row = new double[]{p, p, p, p};
Component[][] components = getPaneComponents(); Component[][] components = getPaneComponents(minMaxValuePane, colorSelectBox, numberDragPane, legendGradientBar);
//控件承载面板 //控件承载面板
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col); JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components,row,col);
@ -70,7 +69,10 @@ public class GradualIntervalConfigPane extends JPanel{
return new LegendGradientBar(); return new LegendGradientBar();
} }
protected Component[][] getPaneComponents(){ protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane,
ColorSelectBoxWithOutTransparent colorSelectBox,
UINumberDragPane numberDragPane,
LegendGradientBar legendGradientBar) {
return new Component[][]{ return new Component[][]{
new Component[]{minMaxValuePane, null}, new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Subject_Color")), colorSelectBox}, new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Subject_Color")), colorSelectBox},
@ -79,14 +81,6 @@ public class GradualIntervalConfigPane extends JPanel{
}; };
} }
protected Component[][] getPaneComponentsWithOutTheme(){
return new Component[][]{
new Component[]{minMaxValuePane, null},
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), numberDragPane},
new Component[]{null, legendGradientBar},
};
}
public void populate(GradualIntervalConfig intervalConfig){ public void populate(GradualIntervalConfig intervalConfig){
minMaxValuePane.populate(intervalConfig.getMinAndMaxValue()); minMaxValuePane.populate(intervalConfig.getMinAndMaxValue());

Loading…
Cancel
Save