Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~henry.wang/design into release/10.0

feature/big-screen
Henry.Wang 4 years ago
parent
commit
245f5a34c8
  1. 13
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java
  2. 3
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  3. 53
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  4. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  5. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  6. 29
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  7. 25
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java
  8. 30
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  9. 50
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  10. 6
      designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java
  11. 97
      designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java
  12. 53
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java
  13. 45
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java
  14. 26
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java
  15. 107
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java
  16. 21
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java
  17. 149
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java
  18. 17
      designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java
  19. 11
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java
  20. 4
      designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java
  21. 212
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java
  22. 178
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java
  23. 12
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java
  24. 12
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java
  25. 224
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java
  26. 59
      designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxTableDefinitionHelper.java
  27. 38
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  28. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png
  29. BIN
      designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png

13
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -11,6 +12,8 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.StringUtils;
public class MaxMemRowCountPanel extends UIToolbar {
@ -19,7 +22,7 @@ public class MaxMemRowCountPanel extends UIToolbar {
private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") };
private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 250;
private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4;
private static int getMaxComBoBoxWidth() {
int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]);
for (int i = 1; i < CACHE_LIST.length; i++) {
@ -86,9 +89,13 @@ public class MaxMemRowCountPanel extends UIToolbar {
this.removeAll();
this.add(switchCache);
switchCache.setSelectedIndex(MAX_IN_MEMORY);
this.add(new UILabel(" "));
if (this.getComponentCount() == MAX_COMPONENT_COUNT_OF_MAX_MEMORY) {
//此处因为switchCache的setSelectedIndex可能会造成双层调用,然后因为重复添加组件产生bug,故而定义这个工具栏的正常最大组件数,做个判断
return;
}
this.add(new UILabel(StringUtils.BLANK));
this.add(numberSpinner);
this.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")));
this.add(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Basic_Row")));
this.validate();
this.repaint();
}

3
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -49,6 +49,7 @@ import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
@ -79,6 +80,7 @@ import com.fr.stable.StringUtils;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.area.AreaIndependentVanChartInterface;
import com.fr.van.chart.bar.BarIndependentVanChartInterface;
import com.fr.van.chart.box.BoxIndependentVanChartInterface;
import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface;
import com.fr.van.chart.column.VanColumnChartTypeUI;
import com.fr.van.chart.custom.CustomIndependentVanChartInterface;
@ -202,6 +204,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI());
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBoxPlot.VAN_CHART_BOX_PLOT_ID, new BoxIndependentVanChartInterface());
}

53
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -7,13 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -50,6 +50,11 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
this.isNeedPresent = true;
}
public ChartDataFilterPane(Plot plot, ChartDataPane parent, boolean isNeedPresent) {
super(plot, parent);
this.isNeedPresent = isNeedPresent;
}
protected void initTabPane() {
super.initTabPane();
tabPane.setPreferredSize(new Dimension(221, 25));
@ -109,7 +114,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* @return 返回标题.
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter");
return Toolkit.i18nText("Fine-Design_Chart_Data_Filter");
}
/**
@ -144,12 +149,17 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
}
public void populateBean(ChartCollection collection, boolean isNeedPresent) {
relayoutPane(isNeedPresent);
TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedPresent);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (categoryPane != null) {
categoryPane.populateBean(collection.getSelectedChart().getFilterDefinition());
categoryPane.populateBean(topDefinition);
}
if (seriesPane != null) {
seriesPane.populateBean(collection.getSelectedChart().getFilterDefinition());
seriesPane.populateBean(topDefinition);
}
checkBoxUse();
}
@ -165,11 +175,16 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 保存界面数据筛选.
*/
public void updateBean(ChartCollection collection) {
TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
updateDefinition(topDefinition);
}
public void updateDefinition(TopDefinitionProvider topDefinition) {
if (categoryPane != null) {
categoryPane.updateBean(collection.getSelectedChart().getFilterDefinition());
categoryPane.updateBean(topDefinition);
}
if (seriesPane != null) {
seriesPane.updateBean(collection.getSelectedChart().getFilterDefinition());
seriesPane.updateBean(topDefinition);
}
}
@ -222,13 +237,13 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
}
protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -244,7 +259,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
//默认不显示
preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() {
@ -258,7 +273,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
fire();
}
};
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f};
@ -281,7 +296,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 界面标题 "分类"
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category");
return Toolkit.i18nText("Fine-Design_Chart_Style_Category");
}
/**
@ -397,13 +412,13 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
@ -419,7 +434,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
//默认不显示
preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() {
@ -433,7 +448,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
fire();
}
};
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f};
@ -457,7 +472,7 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
* 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series");
return Toolkit.i18nText("Fine-Design_Chart_Series");
}
/**

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -13,21 +13,20 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -72,14 +71,14 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
catePane.add(boxPane, BorderLayout.SOUTH);
catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,6));
catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,20));
this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,2,4");
this.add(panel, "0,6,1,4");
addButton.addActionListener(new ActionListener() {
@Override

11
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -10,7 +10,6 @@ import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -18,9 +17,9 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.List;
public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane {
protected static final int PRE_WIDTH = 210;
@ -35,14 +34,14 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
public CategoryPlotReportDataContentPane(ChartDataPane parent) {
initEveryPane();
categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
categoryName.setPreferredSize(new Dimension(246,30));
categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,7));
this.add(categoryName, "0,0,2,0");
categoryName.setPreferredSize(new Dimension(236,30));
categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,20));
this.add(categoryName, "0,0,1,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,2,4"); }
this.add(panel, "0,6,1,4"); }
protected TinyFormulaPane initCategoryBox(final String leftLabel) {
TinyFormulaPane categoryName = new TinyFormulaPane() {

29
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
@ -41,11 +42,11 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
categoryCombox = new UIComboBox();
JPanel categoryPane = new JPanel(new BorderLayout(4,0));
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label1 = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ;
UILabel label1 = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ;
label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
categoryCombox.setPreferredSize(new Dimension(100,20));
categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox,null,null,label1,null}));
categoryPane.setPreferredSize(new Dimension(246,30));
categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15));
@ -90,7 +91,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(categoryCombox, list);
categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
seriesTypeComboxPane.refreshBoxListWithSelectTableData(list);
}
@ -100,7 +101,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
*/
public void clearAllBoxList(){
clearBoxItems(categoryCombox);
categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
seriesTypeComboxPane.clearAllBoxList();
}
@ -135,9 +136,9 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
}
NormalTableDataDefinition data = (NormalTableDataDefinition)top;
if(data == null || ComparatorUtils.equals(data.getCategoryName(), StringUtils.EMPTY)) {
categoryCombox.setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if(data!= null && !this.boxItemsContainsObject(categoryCombox,data.getCategoryName())){
if(ComparatorUtils.equals(data.getCategoryName(), StringUtils.EMPTY)) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if(!DataPaneHelper.boxItemsContainsObject(categoryCombox,data.getCategoryName())){
categoryCombox.setSelectedItem(null);
}else {
combineCustomEditValue(categoryCombox, data.getCategoryName());
@ -146,20 +147,6 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
seriesTypeComboxPane.populateBean(collection,this.isNeedSummaryCaculateMethod());
}
private boolean boxItemsContainsObject(UIComboBox box,Object item){
if(box == null){
return false;
}
ComboBoxModel dataModel = box.getModel();
for (int i = 0; i < dataModel.getSize(); i++) {
if(ComparatorUtils.equals(dataModel.getElementAt(i),item)){
return true;
}
}
return false;
}
/**
* 重新布局整个面板
*/

25
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java

@ -7,6 +7,7 @@ import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.ComboBoxModel;
import java.util.List;
/**
@ -24,6 +25,30 @@ public class DataPaneHelper {
box.refreshBoxItems(list);
}
public static boolean boxItemsContainsObject(UIComboBox box, Object item) {
if (box == null) {
return false;
}
ComboBoxModel dataModel = box.getModel();
for (int i = 0; i < dataModel.getSize(); i++) {
if (ComparatorUtils.equals(dataModel.getElementAt(i), item)) {
return true;
}
}
return false;
}
public static void combineCustomEditValue(UIComboBox comBox, String value) {
if(comBox != null) {
comBox.setEditable(true);
comBox.setSelectedItem(value);
comBox.setEditable(false);
}
}
/**
* 清空box里所有东西
*

30
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itable.UITable;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
@ -40,8 +41,15 @@ import java.util.List;
* @version 创建时间2012-12-26 下午04:39:46
*/
public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollection> {
private static final String[] HEADS = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")};
private static final String[] HEADS_NO_SUMMARY = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")};
private static final String[] HEADS = {
Toolkit.i18nText("Fine-Design_Chart_Field_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Name"),
Toolkit.i18nText("Fine-Design_Chart_Summary_Method")};
private static final String[] HEADS_NO_SUMMARY = {
Toolkit.i18nText("Fine-Design_Chart_Field_Name"),
Toolkit.i18nText("Fine-Design_Chart_Series_Name")};
private UICorrelationPane seriesDataPane;
private List<String> field = new ArrayList<String>();
private JPanel centerPane;
@ -62,7 +70,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String[] blank =heads.length == 3?new String[]{StringUtils.EMPTY, StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}:
String[] blank = heads.length == 3 ? new String[]{StringUtils.EMPTY, StringUtils.EMPTY, Toolkit.i18nText("Fine-Design_Chart_Use_None")} :
new String[]{StringUtils.EMPTY, StringUtils.EMPTY};
tablePane.addLine(blank);
fireTargetChanged();
@ -121,7 +129,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
* @return 标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name");
return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name");
}
/**
@ -187,8 +195,12 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
}
public void populateBean(ChartCollection collection, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedSummary);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (topDefinition instanceof MoreNameCDDefinition) {
MoreNameCDDefinition moreDefinition = (MoreNameCDDefinition) topDefinition;
ChartSummaryColumn[] chartSummaryColumnArray = moreDefinition.getChartSummaryColumn();
@ -221,6 +233,11 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
*/
public void updateBean(ChartCollection collection) {
TopDefinitionProvider normalDefinition = collection.getSelectedChart().getFilterDefinition();
MoreNameCDDefinition moreDefinition = updateDefinition(normalDefinition);
collection.getSelectedChart().setFilterDefinition(moreDefinition);
}
public MoreNameCDDefinition updateDefinition(TopDefinitionProvider normalDefinition) {
MoreNameCDDefinition moreDefinition = null;
if (normalDefinition instanceof MoreNameCDDefinition) {
moreDefinition = (MoreNameCDDefinition) normalDefinition;
@ -242,7 +259,8 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
}
}
moreDefinition.setChartSummaryColumn(dataArray);
collection.getSelectedChart().setFilterDefinition(moreDefinition);
return moreDefinition;
}
/**

50
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java

@ -8,15 +8,14 @@ import com.fr.data.util.function.NoneFunction;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -79,11 +78,11 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p};
UILabel Label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
UILabel Label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
UILabel Label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
Component[][] components = getUseComponent(Label1, Label2, Label3);
@ -98,11 +97,11 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
UILabel Label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
UILabel Label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
Label1.setPreferredSize(new Dimension(75, 20));
UILabel Label2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
UILabel Label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
Label2.setPreferredSize(new Dimension(75, 20));
UILabel Label3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(75, 20));
Component[][] components = getUseComponentWithOutSummary(Label1, Label2, Label3);
@ -170,20 +169,6 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
DataPaneHelper.clearBoxItems(seriesValue);
}
private boolean boxItemsContainsObject(UIComboBox box,Object item){
if(box == null){
return false;
}
ComboBoxModel dataModel = box.getModel();
for (int i = 0; i < dataModel.getSize(); i++) {
if(ComparatorUtils.equals(dataModel.getElementAt(i),item)){
return true;
}
}
return false;
}
/**
* 判断界面是否接受
* @param ob 接受的对象
@ -199,7 +184,7 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
* @return 界面标题
*/
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value");
return Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value");
}
/**
@ -227,16 +212,21 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
}
public void populateBean(ChartCollection ob, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
TopDefinitionProvider topDefinition = ob.getSelectedChart().getFilterDefinition();
populateDefinition(topDefinition, isNeedSummary);
}
public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) {
relayoutPane(isNeedSummary);
if (topDefinition instanceof OneValueCDDefinition) {
OneValueCDDefinition oneDefinition = (OneValueCDDefinition) topDefinition;
seriesName.setEditable(true);
seriesName.setSelectedItem(this.boxItemsContainsObject(seriesName,oneDefinition.getSeriesColumnName())
seriesName.setSelectedItem(DataPaneHelper.boxItemsContainsObject(seriesName, oneDefinition.getSeriesColumnName())
? oneDefinition.getSeriesColumnName() : null);
seriesName.setEditable(false);
seriesValue.setEditable(true);
seriesValue.setSelectedItem(this.boxItemsContainsObject(seriesValue,oneDefinition.getValueColumnName())
seriesValue.setSelectedItem(DataPaneHelper.boxItemsContainsObject(seriesValue,oneDefinition.getValueColumnName())
? oneDefinition.getValueColumnName() : null);
seriesValue.setEditable(false);
if(this.isNeedSummary){
@ -256,6 +246,11 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
* 保存界面内容 字段值
*/
public void updateBean(ChartCollection collection) {
OneValueCDDefinition oneDefinition = updateDefinition();
collection.getSelectedChart().setFilterDefinition(oneDefinition);
}
public OneValueCDDefinition updateDefinition() {
OneValueCDDefinition oneDefinition = createOneValueCDDefinition();
String seriesName = (String) this.seriesName.getSelectedItem();
@ -267,7 +262,8 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
}else{
oneDefinition.setDataFunction(new NoneFunction());
}
collection.getSelectedChart().setFilterDefinition(oneDefinition);
return oneDefinition;
}
protected OneValueCDDefinition createOneValueCDDefinition(){

6
designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java

@ -109,7 +109,7 @@ public class ExtendedOtherPane<T extends AbstractChart> extends AbstractChartAtt
}
});
autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
autoRefreshTime = createIntervalTime();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f, 20};
@ -129,6 +129,10 @@ public class ExtendedOtherPane<T extends AbstractChart> extends AbstractChartAtt
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Refresh"), gapPane);
}
protected UISpinner createIntervalTime() {
return new UISpinner(1, Integer.MAX_VALUE, 5, 60);
}
private JPanel createHyperlinkPane() {
hyperLinkPane = new ExtendedChartHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperLinkPane);

97
designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java

@ -0,0 +1,97 @@
package com.fr.van.chart.box;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.van.chart.box.data.BoxPlotReportDataContentPane;
import com.fr.van.chart.box.data.table.BoxPlotTableDataContentPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.designer.other.VanChartOtherPane;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI;
import java.awt.Component;
public class BoxIndependentVanChartInterface extends AbstractIndependentVanChartUI {
public String getName() {
return Toolkit.i18nText("Fine-Design_Chart_New_Box");
}
public String[] getSubName() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_New_Box")
};
}
public String[] getDemoImagePath() {
return new String[]{
"com/fr/plugin/chart/demo/image/box.png"
};
}
public String getIconPath() {
return "com/fr/design/images/form/toolbar/box.png";
}
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return new BoxPlotTableDataContentPane(plot, parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return new BoxPlotReportDataContentPane(parent);
}
public AbstractChartTypePane getPlotTypePane() {
return new VanChartBoxPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartBoxConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartBoxSeriesPane(parent, plot);
}
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBoxStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePane() {
protected Component[][] createToolBarComponents() {
return new Component[][]{
new Component[]{null, exportImages},
new Component[]{null, fullScreenDisplay}
};
}
protected double[] getToolBarRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p, p};
}
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
}

53
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java

@ -0,0 +1,53 @@
package com.fr.van.chart.box;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.plugin.chart.type.ConditionKeyType;
import com.fr.van.chart.column.VanChartColumnLabelBorderPane;
import com.fr.van.chart.designer.other.condition.item.VanChartColumnSeriesColorConditionPane;
import java.awt.Dimension;
public class VanChartBoxConditionPane extends DataSeriesConditionPane {
public VanChartBoxConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this));
}
protected void addStyleAction() {
}
protected ChartConditionPane createListConditionPane() {
return new ChartConditionPane() {
@Override
protected ConditionKeyType[] conditionKeyTypes() {
return ConditionKeyType.BOX_CONDITION_KEY_TYPES;
}
};
}
public Class<? extends Plot> class4Correspond() {
return VanChartBoxPlot.class;
}
}

45
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java

@ -0,0 +1,45 @@
package com.fr.van.chart.box;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.box.BoxIndependentVanChart;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
public class VanChartBoxPlotPane extends AbstractVanChartTypePane {
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/van/chart/box.images/box.png"
};
}
protected Plot getSelectedClonedPlot() {
VanChartBoxPlot newPlot = null;
Chart[] boxChartGroup = BoxIndependentVanChart.BoxVanChartTypes;
for (int i = 0, len = boxChartGroup.length; i < len; i++) {
if (typeDemo.get(i).isPressing) {
newPlot = boxChartGroup[i].getPlot();
}
}
Plot cloned = null;
try {
if (newPlot != null) {
cloned = (Plot) newPlot.clone();
}
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In ColumnChart");
}
return cloned;
}
public Chart getDefaultChart() {
return BoxIndependentVanChart.BoxVanChartTypes[0];
}
}

26
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java

@ -0,0 +1,26 @@
package com.fr.van.chart.box;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.box.attr.AttrBoxTooltip;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane {
public VanChartBoxPlotTooltipPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
protected void initTooltipContentPane(Plot plot) {
tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this);
}
protected AttrTooltip getAttrTooltip() {
return new AttrBoxTooltip();
}
protected boolean hasTooltipSeriesType() {
return false;
}
}

107
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java

@ -0,0 +1,107 @@
package com.fr.van.chart.box;
import com.fr.chart.chartattr.Plot;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane {
private JPanel normalMarker;
private JPanel outlierMarker;
private VanChartMarkerPane normalValuePane;
private VanChartMarkerPane outlierValuePane;
public VanChartBoxSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createBorderPane()},
new Component[]{createNormalValuePane()},
new Component[]{createOutlierValuePane()}
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return contentPane;
}
protected VanChartBorderPane createDiffBorderPane() {
return new VanChartBorderPane();
}
private JPanel createNormalValuePane() {
normalValuePane = new VanChartMarkerPane();
normalMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane);
return normalMarker;
}
private JPanel createOutlierValuePane() {
outlierValuePane = new VanChartMarkerPane();
outlierMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane);
return outlierMarker;
}
private void checkMarkerPane(boolean isDetailed) {
normalMarker.setVisible(isDetailed);
outlierMarker.setVisible(isDetailed);
}
protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.SOUTH);
}
protected VanChartBeautyPane createStylePane() {
return null;
}
public void populateBean(Plot plot) {
if (plot == null) {
return;
}
super.populateBean(plot);
if (plot instanceof VanChartBoxPlot) {
normalValuePane.populate(((VanChartBoxPlot) plot).getNormalValue());
outlierValuePane.populate(((VanChartBoxPlot) plot).getOutlierValue());
checkMarkerPane(((VanChartBoxPlot) plot).isDetailed());
}
}
public void updateBean(Plot plot) {
if (plot == null) {
return;
}
if (plot instanceof VanChartBoxPlot) {
((VanChartBoxPlot) plot).setNormalValue(normalValuePane.update());
((VanChartBoxPlot) plot).setOutlierValue(outlierValuePane.update());
}
super.updateBean(plot);
}
}

21
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java

@ -0,0 +1,21 @@
package com.fr.van.chart.box;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.van.chart.designer.style.VanChartStylePane;
import java.util.List;
public class VanChartBoxStylePane extends VanChartStylePane {
public VanChartBoxStylePane(AttributeChangeListener listener) {
super(listener);
}
protected void createVanChartLabelPane(List<BasicPane> paneList) {
}
protected void addVanChartTooltipPane(List<BasicPane> paneList) {
paneList.add(new VanChartBoxTooltipPane(VanChartBoxStylePane.this));
}
}

149
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java

@ -0,0 +1,149 @@
package com.fr.van.chart.box;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent;
import com.fr.van.chart.designer.component.VanChartTooltipContentPane;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel;
import java.awt.Component;
public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane {
private VanChartFormatPaneWithCheckBox number;
private VanChartFormatPaneWithCheckBox max;
private VanChartFormatPaneWithCheckBox q3;
private VanChartFormatPaneWithCheckBox median;
private VanChartFormatPaneWithCheckBox q1;
private VanChartFormatPaneWithCheckBox min;
private VanChartFormatPaneWithCheckBox outlier;
public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane);
}
protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) {
categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane);
seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane);
number = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Number");
}
};
max = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Max_Value");
}
};
q3 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Q3");
}
};
median = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Median");
}
};
q1 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Data_Q1");
}
};
min = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Design_Chart_Min_Value");
}
};
outlier = new VanChartFormatPaneWithCheckBox(parent, showOnPane) {
protected String getCheckBoxText() {
return Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value");
}
};
}
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p, p, p, p, p, p};
}
protected Component[][] getPaneComponents() {
return new Component[][]{
new Component[]{categoryNameFormatPane, null},
new Component[]{seriesNameFormatPane, null},
new Component[]{number, null},
new Component[]{max, null},
new Component[]{q3, null},
new Component[]{median, null},
new Component[]{q1, null},
new Component[]{min, null},
new Component[]{outlier, null}
};
}
public boolean isDirty() {
return categoryNameFormatPane.isDirty()
|| seriesNameFormatPane.isDirty()
|| number.isDirty()
|| max.isDirty()
|| q3.isDirty()
|| median.isDirty()
|| q1.isDirty()
|| min.isDirty()
|| outlier.isDirty();
}
public void setDirty(boolean isDirty) {
categoryNameFormatPane.setDirty(isDirty);
seriesNameFormatPane.setDirty(isDirty);
number.setDirty(isDirty);
max.setDirty(isDirty);
q3.setDirty(isDirty);
median.setDirty(isDirty);
q1.setDirty(isDirty);
min.setDirty(isDirty);
outlier.setDirty(isDirty);
}
protected AttrTooltipContent createAttrTooltip() {
return new AttrBoxTooltipContent();
}
protected void populateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat());
if (attrTooltipContent instanceof AttrBoxTooltipContent) {
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent;
number.populate(boxTooltipContent.getNumber());
max.populate(boxTooltipContent.getMax());
q3.populate(boxTooltipContent.getQ3());
median.populate(boxTooltipContent.getMedian());
q1.populate(boxTooltipContent.getQ1());
min.populate(boxTooltipContent.getMin());
outlier.populate(boxTooltipContent.getOutlier());
}
}
protected void updateFormatPane(AttrTooltipContent attrTooltipContent) {
categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat());
seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat());
if (attrTooltipContent instanceof AttrBoxTooltipContent) {
AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent;
number.update(boxTooltipContent.getNumber());
max.update(boxTooltipContent.getMax());
q3.update(boxTooltipContent.getQ3());
median.update(boxTooltipContent.getMedian());
q1.update(boxTooltipContent.getQ1());
min.update(boxTooltipContent.getMin());
outlier.update(boxTooltipContent.getOutlier());
}
}
}

17
designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java

@ -0,0 +1,17 @@
package com.fr.van.chart.box;
import com.fr.chart.chartattr.Plot;
import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import com.fr.van.chart.designer.style.tooltip.VanChartTooltipPane;
public class VanChartBoxTooltipPane extends VanChartTooltipPane {
public VanChartBoxTooltipPane(VanChartStylePane parent) {
super(parent);
}
protected VanChartPlotTooltipPane getTooltipPane(Plot plot) {
return new VanChartBoxPlotTooltipPane(plot, parent);
}
}

11
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java

@ -0,0 +1,11 @@
package com.fr.van.chart.box.data;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane;
public class BoxPlotReportDataContentPane extends CategoryPlotReportDataContentPane {
public BoxPlotReportDataContentPane(ChartDataPane parent) {
super(parent);
}
}

4
designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java

@ -0,0 +1,4 @@
package com.fr.van.chart.box.data;
public class BoxPlotReportResultDataSeriesPane {
}

212
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java

@ -0,0 +1,212 @@
package com.fr.van.chart.box.data.table;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.plugin.chart.box.VanChartBoxPlot;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane {
private UIButtonGroup dataType;
private BoxPlotTableSeriesTypeUsePane seriesTypeComboxPane;
private BoxPlotTableResultDataSeriesPane resultDataSeriesPane;
private JPanel filterPane;
private ChartDataFilterPane dataScreeningPane;
private ChartDataPane parent;
private Plot initplot;
public BoxPlotTableDataContentPane(Plot plot, ChartDataPane parent) {
this.initplot = plot;
this.parent = parent;
this.setLayout(new BorderLayout());
this.add(createDataTypePane(), BorderLayout.NORTH);
this.add(createSeriesPane(), BorderLayout.CENTER);
this.add(createFilterPane(), BorderLayout.SOUTH);
initDataTypeListener();
checkDataPaneVisible();
}
private JPanel createDataTypePane() {
JPanel pane = new JPanel(new BorderLayout(4, 0));
pane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Type"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
String[] names = new String[]{
Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"),
Toolkit.i18nText("Fine-Design_Chart_Result_Data")
};
dataType = new UIButtonGroup(names);
dataType.setPreferredSize(new Dimension(100, 20));
pane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{dataType, null, null, label, null}));
pane.setPreferredSize(new Dimension(246, 30));
pane.setBorder(BorderFactory.createEmptyBorder(0, 24, 10, 15));
return pane;
}
private JPanel createSeriesPane() {
seriesTypeComboxPane = new BoxPlotTableSeriesTypeUsePane();
resultDataSeriesPane = new BoxPlotTableResultDataSeriesPane();
JPanel pane = new JPanel(new BorderLayout(4, 0));
pane.add(seriesTypeComboxPane, BorderLayout.CENTER);
pane.add(resultDataSeriesPane, BorderLayout.SOUTH);
return pane;
}
private JPanel createFilterPane() {
dataScreeningPane = new ChartDataFilterPane(initplot, parent, false);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
filterPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
return filterPane;
}
private void initDataTypeListener() {
dataType.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkDataPaneVisible();
}
});
}
private void checkDataPaneVisible() {
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.setVisible(dataType.getSelectedIndex() == 0);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.setVisible(dataType.getSelectedIndex() == 1);
}
if (filterPane != null) {
filterPane.setVisible(dataType.getSelectedIndex() == 0);
}
}
public void checkBoxUse(boolean hasUse) {
if (dataType.getSelectedIndex() == 0 && seriesTypeComboxPane != null) {
seriesTypeComboxPane.checkBoxUse(hasUse);
}
if (dataType.getSelectedIndex() == 1 && resultDataSeriesPane != null) {
resultDataSeriesPane.checkBoxUse(hasUse);
}
dataScreeningPane.checkBoxUse();
}
protected void refreshBoxListWithSelectTableData(List list) {
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.refreshBoxListWithSelectTableData(list);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.refreshBoxListWithSelectTableData(list);
}
}
public void clearAllBoxList() {
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.clearAllBoxList();
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.clearAllBoxList();
}
}
public void updateBean(ChartCollection collection) {
checkChartCollection(collection);
VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection);
if (table != null) {
boolean isDetailed = dataType.getSelectedIndex() == 0;
table.setDetailed(isDetailed);
((VanChartBoxPlot) initplot).setDetailed(isDetailed);
}
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.updateBean(collection);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.updateBean(collection);
}
if (dataScreeningPane != null) {
updateDataScreeningPane(dataScreeningPane, collection);
}
}
public void populateBean(ChartCollection collection) {
checkChartCollection(collection);
if (dataType != null) {
dataType.setSelectedIndex(BoxTableDefinitionHelper.isDetailedTableDataType(collection) ? 0 : 1);
}
if (seriesTypeComboxPane != null) {
seriesTypeComboxPane.populateBean(collection);
}
if (resultDataSeriesPane != null) {
resultDataSeriesPane.populateBean(collection);
}
if (dataScreeningPane != null) {
populateDataScreeningPane(dataScreeningPane, collection);
}
checkDataPaneVisible();
}
private void checkChartCollection(ChartCollection collection) {
VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection);
if (table == null) {
collection.getSelectedChart().setFilterDefinition(new VanBoxTableDefinition());
}
}
private void populateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) {
NormalTableDataDefinition detailedDefinition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (detailedDefinition != null) {
dataScreeningPane.populateDefinition(detailedDefinition, false);
}
}
private void updateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) {
NormalTableDataDefinition detailedDefinition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (detailedDefinition != null) {
dataScreeningPane.updateDefinition(detailedDefinition);
}
}
}

178
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java

@ -0,0 +1,178 @@
package com.fr.van.chart.box.data.table;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.List;
public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPane {
private UIComboBox category;
private UIComboBox seriesName;
private UIComboBox max;
private UIComboBox q3;
private UIComboBox median;
private UIComboBox q1;
private UIComboBox min;
public BoxPlotTableResultDataSeriesPane() {
initComboxSize();
this.setLayout(new BorderLayout());
this.add(createDataSeriesPane(), BorderLayout.CENTER);
addItemListener();
}
private void initComboxSize() {
Dimension preferredSize = new Dimension(100, 20);
category = new UIComboBox();
seriesName = new UIComboBox();
max = new UIComboBox();
q3 = new UIComboBox();
median = new UIComboBox();
q1 = new UIComboBox();
min = new UIComboBox();
category.setPreferredSize(preferredSize);
seriesName.setPreferredSize(preferredSize);
max.setPreferredSize(preferredSize);
q3.setPreferredSize(preferredSize);
median.setPreferredSize(preferredSize);
q1.setPreferredSize(preferredSize);
min.setPreferredSize(preferredSize);
}
private void addItemListener() {
category.addItemListener(tooltipListener);
seriesName.addItemListener(tooltipListener);
max.addItemListener(tooltipListener);
q3.addItemListener(tooltipListener);
median.addItemListener(tooltipListener);
q1.addItemListener(tooltipListener);
min.addItemListener(tooltipListener);
}
private JPanel createDataSeriesPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {f, COMPONENT_WIDTH};
double[] row = {p, p, p, p, p, p, p};
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category")), category},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), max},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Q3")), q3},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Median")), median},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Q1")), q1},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Min")), min},
};
JPanel center = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, row, column);
center.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
return center;
}
public void checkBoxUse(boolean hasUse) {
}
protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(category, list);
refreshBoxItems(seriesName, list);
refreshBoxItems(max, list);
refreshBoxItems(q3, list);
refreshBoxItems(median, list);
refreshBoxItems(q1, list);
refreshBoxItems(min, list);
}
public void clearAllBoxList() {
clearBoxItems(category);
clearBoxItems(seriesName);
clearBoxItems(max);
clearBoxItems(q3);
clearBoxItems(median);
clearBoxItems(q1);
clearBoxItems(min);
}
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
VanBoxTableResultDefinition definition = BoxTableDefinitionHelper.getBoxTableResultDefinition(collection);
if (definition == null) {
return;
}
combineCustomEditValue(category, definition.getCategoryName());
combineCustomEditValue(seriesName, definition.getSeriesName());
combineCustomEditValue(max, definition.getMax());
combineCustomEditValue(q3, definition.getQ3());
combineCustomEditValue(median, definition.getMedian());
combineCustomEditValue(q1, definition.getQ1());
combineCustomEditValue(min, definition.getMin());
}
public void updateBean(ChartCollection collection) {
VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection);
VanBoxTableResultDefinition definition = new VanBoxTableResultDefinition();
Object resultCategory = category.getSelectedItem();
Object resultSeries = seriesName.getSelectedItem();
Object resultMax = max.getSelectedItem();
Object resultQ3 = q3.getSelectedItem();
Object resultMedian = median.getSelectedItem();
Object resultQ1 = q1.getSelectedItem();
Object resultMin = min.getSelectedItem();
if (resultCategory == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultCategory)) {
definition.setCategoryName(StringUtils.EMPTY);
} else {
definition.setCategoryName(resultCategory.toString());
}
if (resultSeries == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultSeries)) {
definition.setSeriesName(StringUtils.EMPTY);
} else {
definition.setSeriesName(resultSeries.toString());
}
if (resultMax != null) {
definition.setMax(resultMax.toString());
}
if (resultQ3 != null) {
definition.setQ3(resultQ3.toString());
}
if (resultMedian != null) {
definition.setMedian(resultMedian.toString());
}
if (resultQ1 != null) {
definition.setQ1(resultQ1.toString());
}
if (resultMin != null) {
definition.setMin(resultMin.toString());
}
table.setResultDefinition(definition);
}
}

12
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java

@ -0,0 +1,12 @@
package com.fr.van.chart.box.data.table;
import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane;
import com.fr.plugin.chart.box.data.VanBoxMoreNameCDDefinition;
public class BoxPlotTableSeriesNameUseFieldNamePane extends SeriesNameUseFieldNamePane {
protected MoreNameCDDefinition createMoreNameCDDefinition() {
return new VanBoxMoreNameCDDefinition();
}
}

12
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java

@ -0,0 +1,12 @@
package com.fr.van.chart.box.data.table;
import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane;
import com.fr.plugin.chart.box.data.VanBoxOneValueCDDefinition;
public class BoxPlotTableSeriesNameUseFieldValuePane extends SeriesNameUseFieldValuePane {
protected OneValueCDDefinition createOneValueCDDefinition() {
return new VanBoxOneValueCDDefinition();
}
}

224
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java

@ -0,0 +1,224 @@
package com.fr.van.chart.box.data.table;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
public class BoxPlotTableSeriesTypeUsePane extends UIComboBoxPane<ChartCollection> {
private static boolean NEED_SUMMERY = false;
private UIComboBox categoryCombox;
private BoxPlotTableSeriesNameUseFieldValuePane nameFieldValuePane;
private BoxPlotTableSeriesNameUseFieldNamePane nameFieldNamePane;
public BoxPlotTableSeriesTypeUsePane() {
cards = initPaneList();
initComponents();
initListener();
}
protected void initLayout() {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM));
cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
this.add(createNorthPane(), BorderLayout.NORTH);
this.add(createCenterPane(), BorderLayout.CENTER);
this.add(cardPane, BorderLayout.SOUTH);
}
protected UIComboBox createComboBox() {
UIComboBox uiComboBox = new UIComboBox();
UIComponentUtils.setPreferedWidth(uiComboBox, 100);
return uiComboBox;
}
private JPanel createNorthPane() {
JPanel north = new JPanel(new BorderLayout(4, 0));
north.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
categoryCombox = new UIComboBox();
categoryCombox.setPreferredSize(new Dimension(100, 20));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
north.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, null, null, label, null}));
north.setPreferredSize(new Dimension(246, 30));
north.setBorder(BorderFactory.createEmptyBorder(0, 24, 10, 15));
return north;
}
private JPanel createCenterPane() {
JPanel center = new JPanel(new BorderLayout(4, 0));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
center.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label, null}));
center.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
return center;
}
private void initListener() {
categoryCombox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkBoxUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
}
});
}
public void checkBoxUse(boolean hasUse) {
categoryCombox.setEnabled(hasUse);
jcb.setEnabled(hasUse);
nameFieldValuePane.checkUse(hasUse);
}
private void makeToolTipUse(UIComboBox comBox) {
if (comBox.getSelectedItem() != null) {
comBox.setToolTipText(comBox.getSelectedItem().toString());
} else {
comBox.setToolTipText(null);
}
}
public void refreshBoxListWithSelectTableData(List list) {
DataPaneHelper.refreshBoxItems(categoryCombox, list);
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
nameFieldValuePane.refreshBoxListWithSelectTableData(list);
nameFieldNamePane.refreshBoxListWithSelectTableData(list);
}
public void clearAllBoxList() {
DataPaneHelper.clearBoxItems(categoryCombox);
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
nameFieldValuePane.clearAllBoxList();
nameFieldNamePane.clearAllBoxList();
}
protected String title4PopupWindow() {
return Toolkit.i18nText("Fine-Design_Chart_Series_Name_From");
}
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
nameFieldValuePane = new BoxPlotTableSeriesNameUseFieldValuePane();
nameFieldNamePane = new BoxPlotTableSeriesNameUseFieldNamePane();
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
paneList.add(nameFieldValuePane);
paneList.add(nameFieldNamePane);
return paneList;
}
public void relayoutPane() {
if (jcb.getSelectedIndex() == 0) {
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
} else {
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
}
}
protected void comboBoxItemStateChanged() {
if (jcb.getSelectedIndex() == 0) {
nameFieldValuePane.relayoutPane(NEED_SUMMERY);
} else {
nameFieldNamePane.relayoutPane(NEED_SUMMERY);
}
}
public void populateBean(ChartCollection collection) {
NormalTableDataDefinition definition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection);
if (definition == null) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
return;
}
if (definition instanceof OneValueCDDefinition) {
this.setSelectedIndex(0);
nameFieldValuePane.populateDefinition(definition, NEED_SUMMERY);
} else if (definition instanceof MoreNameCDDefinition) {
this.setSelectedIndex(1);
nameFieldNamePane.populateDefinition(definition, NEED_SUMMERY);
}
populateCategoryItem(categoryCombox, definition.getCategoryName());
}
public void updateBean(ChartCollection collection) {
VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection);
if (table == null) {
return;
}
NormalTableDataDefinition definition;
if (this.getSelectedIndex() == 0) {
definition = nameFieldValuePane.updateDefinition();
} else {
definition = nameFieldNamePane.updateDefinition(table.getDetailedDefinition());
}
Object categoryName = categoryCombox.getSelectedItem();
if (ArrayUtils.contains(ChartConstants.getNoneKeys(), categoryName)) {
definition.setCategoryName(StringUtils.EMPTY);
} else {
definition.setCategoryName(categoryName == null ? null : categoryName.toString());
}
table.setDetailedDefinition(definition);
}
private void populateCategoryItem(UIComboBox categoryCombox, String item) {
if (ComparatorUtils.equals(item, StringUtils.EMPTY)) {
categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if (!DataPaneHelper.boxItemsContainsObject(categoryCombox, item)) {
categoryCombox.setSelectedItem(null);
} else {
DataPaneHelper.combineCustomEditValue(categoryCombox, item);
}
}
}

59
designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxTableDefinitionHelper.java

@ -0,0 +1,59 @@
package com.fr.van.chart.box.data.table;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableDefinition;
import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition;
public class BoxTableDefinitionHelper {
public static VanBoxTableDefinition getBoxTableDefinition(ChartCollection collection) {
if (collection != null) {
Chart chart = collection.getSelectedChart();
if (chart != null) {
TopDefinitionProvider definitionProvider = chart.getFilterDefinition();
if (definitionProvider instanceof VanBoxTableDefinition) {
return (VanBoxTableDefinition) definitionProvider;
}
}
}
return null;
}
public static VanBoxTableResultDefinition getBoxTableResultDefinition(ChartCollection collection) {
VanBoxTableDefinition table = getBoxTableDefinition(collection);
if (table != null) {
return table.getResultDefinition();
}
return null;
}
public static NormalTableDataDefinition getBoxTableDetailedDefinition(ChartCollection collection) {
VanBoxTableDefinition table = getBoxTableDefinition(collection);
if (table != null) {
return table.getDetailedDefinition();
}
return null;
}
public static boolean isDetailedTableDataType(ChartCollection collection) {
VanBoxTableDefinition table = getBoxTableDefinition(collection);
if (table != null) {
return table.isDetailed();
}
return true;
}
}

38
designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -14,16 +14,16 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.multilayer.data.MultiPieValueDefinition;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.ComboBoxModel;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
@ -72,7 +72,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
for (int i = 0; i < levelNum; i++){
levelNameList.add(new UIComboBox());
levelNameList.get(i).setPreferredSize(new Dimension(WD, HT));
levelNameList.get(i).addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
levelNameList.get(i).addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
}
@ -103,7 +103,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
Component[][] components_center = new Component[levelNum + 3][];
for (int i = 0; i < levelNum; i++){
components_center[i] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Level") + String.valueOf(i+1)), levelNameList.get(i)};
components_center[i] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level") + String.valueOf(i+1)), levelNameList.get(i)};
}
value = new UIComboBox();
@ -113,8 +113,8 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
calculateCombox.setPreferredSize(new Dimension(WD, HT));
components_center[levelNum] = new Component[]{getJSeparator(), null};
components_center[levelNum+1] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")), value};
components_center[levelNum+2] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox};
components_center[levelNum+1] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), value};
components_center[levelNum+2] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox};
initCenterItemListener();
@ -181,9 +181,9 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
nameField = new UITextField();
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name")), nameField},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name")), nameField},
new Component[]{getJSeparator(),null },
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north);
@ -243,7 +243,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
columnNameList = list;
for (int i = 0; i < levelNum; i++) {
refreshBoxItems(levelNameList.get(i), list);
levelNameList.get(i).addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
levelNameList.get(i).addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
}
refreshBoxItems(value, list);
}
@ -282,7 +282,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
//值
value.setEditable(true);
value.setSelectedItem(this.boxItemsContainsObject(value,data.getValueColumnName())
value.setSelectedItem(DataPaneHelper.boxItemsContainsObject(value,data.getValueColumnName())
? data.getValueColumnName() : null);
value.setEditable(false);
//汇总方式
@ -327,8 +327,8 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
for (int i = 0; i < levelNameList.size(); i++){
if(!definition.hasLevelIndex(i) || ComparatorUtils.equals(levelColumnNameList.get(i), StringUtils.EMPTY)) {
levelNameList.get(i).setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if(definition.hasLevelIndex(i) && !this.boxItemsContainsObject(levelNameList.get(i),levelColumnNameList.get(i))){
levelNameList.get(i).setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} else if(definition.hasLevelIndex(i) && !DataPaneHelper.boxItemsContainsObject(levelNameList.get(i),levelColumnNameList.get(i))){
levelNameList.get(i).setSelectedItem(null);
}else {
combineCustomEditValue(levelNameList.get(i), definition.hasLevelIndex(i) ? levelColumnNameList.get(i) : null);
@ -353,20 +353,6 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
}
}
private boolean boxItemsContainsObject(UIComboBox box,Object item){
if(box == null){
return false;
}
ComboBoxModel dataModel = box.getModel();
for (int i = 0; i < dataModel.getSize(); i++) {
if(ComparatorUtils.equals(dataModel.getElementAt(i),item)){
return true;
}
}
return false;
}
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(220, 2));

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 918 B

Loading…
Cancel
Save