Browse Source

大屏插件jartime更新 顺便解决之前的一些代码质量

bugfix/10.0
zheng 6 years ago
parent
commit
526ff72786
  1. 33
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java
  2. 32
      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

33
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.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -92,6 +92,17 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
if (chart.getFilterDefinition() instanceof ExtendedReportDataSet) {
ExtendedReportDataSet dataSet = (ExtendedReportDataSet) chart.getFilterDefinition();
populateDataSet(dataSet);
}
}
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
@ -103,14 +114,8 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
}
}
}
}
@Override
public void updateBean(ChartCollection ob) {
if (ob != null) {
Chart chart = ob.getSelectedChart();
if (chart != null) {
public ExtendedReportDataSet updateDataSet() {
ExtendedReportDataSet dataSet = new ExtendedReportDataSet();
AbstractDataConfig dataConfig = update();
@ -123,7 +128,17 @@ public abstract class AbstractExtendedChartReportDataPane<T extends AbstractData
}
dataConfig.setCustomFields(fieldList);
chart.setFilterDefinition(dataSet);
return dataSet;
}
@Override
public void updateBean(ChartCollection ob) {
if (ob != null) {
Chart chart = ob.getSelectedChart();
if (chart != null) {
chart.setFilterDefinition(updateDataSet());
}
}
}

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

@ -93,7 +93,20 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
if (chart.getFilterDefinition() instanceof ExtendedTableDataSet) {
ExtendedTableDataSet dataSet = (ExtendedTableDataSet) chart.getFilterDefinition();
populateDataSet(dataSet);
}
}
public void populateDataSet(DataSet dataSet) {
if (dataSet == null) {
return;
}
AbstractDataConfig dataConfig = dataSet.getDataConfig();
if (dataConfig != null) {
populate((T) dataConfig);
@ -101,9 +114,19 @@ public abstract class AbstractExtendedChartTableDataPane<T extends AbstractDataC
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();
if (chart != null) {
ExtendedTableDataSet dataSet = new ExtendedTableDataSet();
dataSet.setDataConfig(update());
if (customFieldComboBoxPane != null) {
customFieldComboBoxPane.updateBean(dataSet.getDataConfig());
}
chart.setFilterDefinition(dataSet);
chart.setFilterDefinition(updateDataSet());
}
}
}

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;
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.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
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.GradualLegendPane;
import com.fr.van.chart.range.component.LegendGradientBar;
import com.fr.van.chart.range.component.SectionIntervalConfigPaneWithOutNum;
import com.fr.van.chart.range.component.SectionLegendPane;
@ -46,8 +50,12 @@ public class HeatMapRangeLegendPane extends VanChartRangeLegendPane {
protected GradualIntervalConfigPane createGradualIntervalConfigPane() {
return new GradualIntervalConfigPane(){
@Override
protected Component[][] getPaneComponents() {
return super.getPaneComponentsWithOutTheme();
protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane, ColorSelectBoxWithOutTransparent colorSelectBox, UINumberDragPane numberDragPane, LegendGradientBar legendGradientBar) {
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.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.range.GradualIntervalConfig;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutTick;
@ -23,7 +22,7 @@ public class GradualIntervalConfigPane extends JPanel{
//主题颜色
private ColorSelectBoxWithOutTransparent colorSelectBox;
//划分阶段
UINumberDragPane numberDragPane;
private UINumberDragPane numberDragPane;
//渐变色编辑器
private LegendGradientBar legendGradientBar;
@ -58,7 +57,7 @@ public class GradualIntervalConfigPane extends JPanel{
double[] col = new double[]{f, e};
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);
@ -70,7 +69,10 @@ public class GradualIntervalConfigPane extends JPanel{
return new LegendGradientBar();
}
protected Component[][] getPaneComponents(){
protected Component[][] getPaneComponents(MinMaxValuePaneWithOutTick minMaxValuePane,
ColorSelectBoxWithOutTransparent colorSelectBox,
UINumberDragPane numberDragPane,
LegendGradientBar legendGradientBar) {
return new Component[][]{
new Component[]{minMaxValuePane, null},
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){
minMaxValuePane.populate(intervalConfig.getMinAndMaxValue());

Loading…
Cancel
Save