Browse Source

Merge pull request #1105 in BA/design from ~MANGO/m_design:release/9.0 to release/9.0

* commit 'fc2d5d0b91aa2e4ceecc5a5fc8ef71961ef7ac34':
  9.0界面修改
  代码规范
  处理超链和条件显示的todo,修改警戒线和间隔背景
master
superman 7 years ago
parent
commit
ac4740e3fa
  1. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  2. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  3. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  4. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java
  5. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  6. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  7. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  8. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java
  9. 17
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  10. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java
  11. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  12. 18
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  13. 23
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  14. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java
  15. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java
  16. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java
  17. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java
  18. 116
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  19. 121
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  20. 48
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java
  21. 53
      designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java
  22. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java
  23. 183
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  24. 17
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  25. 3
      designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java
  26. 18
      designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

6
designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -113,20 +113,20 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
}
};
styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight()));
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character"), styleAttrPane);
}
private JPanel createButtonBackgroundColorPane(){
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background"), colorSelectBox4button);
}
private JPanel createButtonConfigPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p,p,p};
double[] rowSize = {p,p};
Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null},
new Component[]{createButtonBackgroundColorPane(),null},

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -59,6 +59,18 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
}
}
protected void initLayout() {
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) {
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
}
}
this.add(centerPane, BorderLayout.CENTER);
}
protected List<NamePane> initPaneList(Plot plot, AbstractAttrNoScrollPane parent) {
plot4Pane = plot;

12
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -44,8 +44,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
initSeriesPane();
this.add(seriesPane, "0,2,2,2");
seriesPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.add(seriesPane);
this.add(panel, "0,2,2,2");
}
//kunsnat: 用于重载, 甘特图, 股价图 第一列 默认应该不可编辑.
@ -192,4 +194,10 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
}
}
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(246, 2));
return jSeparator;
}
}

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java

@ -27,6 +27,7 @@ public class BubblePlotReportDataContentPane extends AbstractReportDataContentPa
initEveryPane();
filterPane = new ChartDataFilterPane(new BubblePlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4");
}

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -67,6 +67,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() {

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

@ -38,6 +38,7 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
this.add(categoryName, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4"); }
protected TinyFormulaPane initCategoryBox(final String leftLabel) {

9
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java

@ -57,13 +57,8 @@ public class MeterPlotReportDataContentPane extends AbstractReportDataContentPan
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.NORTH);
filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
double[] cs = {p};
components = new Component[][]{
new Component[]{panel1},
};
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, cs);
JPanel pane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(pane, BorderLayout.CENTER);
}

16
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition;
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.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
@ -14,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
@ -52,23 +52,23 @@ public class BubblePlotTableDataContentPane extends AbstractTableDataContentPane
double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p};
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesName},
new Component[]{new UILabel("x :",SwingConstants.RIGHT), xCombox},
new Component[]{new UILabel("y :",SwingConstants.RIGHT), yCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), bubbleSize}
new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")), seriesName},
new Component[]{new UILabel("x"), xCombox},
new Component[]{new UILabel("y"), yCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize}
};
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{new JSeparator()},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{dataScreeningPane}
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane), null},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);

17
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -11,6 +11,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
@ -42,12 +43,19 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p,f};
double[] rowSize = { p, p,p,p,p,p,p,p, p};
double[] rowSize = {p, p};
Component[][] components = createComponents();
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
panel.setBorder(BorderFactory.createEmptyBorder(10,24,10,15));
this.add(getJSeparator(),BorderLayout.NORTH);
this.add(panel,BorderLayout.CENTER);
this.add(jPanel,BorderLayout.SOUTH);
nameBox.addItemListener(tooltipListener);
valueBox.addItemListener(tooltipListener);
@ -55,11 +63,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
private Component[][] createComponents() {
return new Component[][]{
new Component[]{new BoldFontTextLabel(METER_NAME, SwingConstants.RIGHT), getNameComponent()},
new Component[]{new BoldFontTextLabel(METER_VALUE, SwingConstants.RIGHT), valueBox},
new Component[]{new JSeparator(), null},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{filterPane, null}
new Component[]{new BoldFontTextLabel(METER_NAME), getNameComponent()},
new Component[]{new BoldFontTextLabel(METER_VALUE), valueBox},
};
}

7
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java

@ -1,18 +1,19 @@
package com.fr.design.mainframe.chart.gui.data.table;
import java.awt.BorderLayout;
import java.util.List;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.PiePlot;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import java.awt.*;
import java.util.List;
public class PiePlotTableDataContentPane extends AbstractTableDataContentPane{
private SeriesTypeUseComboxPane typeChoosePane;
public PiePlotTableDataContentPane(ChartDataPane parent) {
typeChoosePane = new SeriesTypeUseComboxPane(parent, new PiePlot());
this.setLayout(new BorderLayout());
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(typeChoosePane, BorderLayout.CENTER);
}

1
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -57,6 +57,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.add(cardPane, BorderLayout.CENTER);
dataScreeningPane = new ChartDataFilterPane(this.initplot, parent);
JPanel panel = new UIExpandablePane(Inter.getLocText("FR-Chart-Data_Filter"), 290, 24, dataScreeningPane);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, BorderLayout.SOUTH);
}

18
designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java

@ -8,7 +8,6 @@ import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
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.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -50,7 +49,7 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = { p, p,p,p};
double[] rowSize = {p, p};
double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p};
@ -62,19 +61,16 @@ public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataCon
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), bubbleSize},
};
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
JPanel north = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15));
JPanel filterPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),dataScreeningPane);
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{filterPane}
};
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(north, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH);
seriesName.addItemListener(tooltipListener);
xCombox.addItemListener(tooltipListener);

23
designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java

@ -9,6 +9,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
@ -25,7 +26,6 @@ import com.fr.js.ParameterJavaScript;
import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.other.ChartHyperlinkNameObjectCreartor;
import com.fr.plugin.chart.designer.other.HyperlinkMapFactory;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable;
@ -89,7 +89,6 @@ public class VanChartHyperLinkPane extends UIListControlPane {
}
public void populate(TargetComponent elementCasePane) {
// hyperlinkGroupPaneActionProvider.populate(this, elementCasePane);
}
/**
@ -128,12 +127,11 @@ public class VanChartHyperLinkPane extends UIListControlPane {
// paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
//todo@mengao 去掉UIMenuNameableCreator
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()];
NameObjectCreator[] creators = new NameObjectCreator[list.size()];
for (int i = 0; list != null && i < list.size(); i++) {
UIMenuNameableCreator uiMenuNameableCreator = list.get(i);
creators[i] = new ChartHyperlinkNameObjectCreartor(uiMenuNameableCreator.getObj(),uiMenuNameableCreator.getName(), uiMenuNameableCreator.getClass(), uiMenuNameableCreator.getPaneClazz());
creators[i] = new NameObjectCreator(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj().getClass(), uiMenuNameableCreator.getPaneClazz());
}
@ -147,7 +145,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
if (javaScript != null && javaScript.getJavaScript() != null) {
JavaScript script = javaScript.getJavaScript();
UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()));
nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator));
nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj()));
}
}
@ -182,9 +180,9 @@ public class VanChartHyperLinkPane extends UIListControlPane {
nameGroup.clear();
for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator menu = (UIMenuNameableCreator)((NameObject)nameables[i]).getObject();
NameJavaScript nameJava = new NameJavaScript(menu.getName(), (JavaScript)menu.getObj());
nameJava.setName(nameables[i].getName());
JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject();
String name = nameables[i].getName();
NameJavaScript nameJava = new NameJavaScript(name, javaScript);
nameGroup.addNameHyperlink(nameJava);
}
@ -231,11 +229,4 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return null;
}
protected Object getob2Populate (Object ob2Populate) {
if (ob2Populate == null) {
return ob2Populate;
}
return ((UIMenuNameableCreator)ob2Populate).getObj();
}
}

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.base.chart.BasePlot;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/18.
*/
public class ChartConditionNameObjectCreator extends NameObjectCreator {
private BasePlot plot;
private ConditionUIMenuNameableCreator conditionUIMenuNameableCreator;
public ChartConditionNameObjectCreator(BasePlot plot, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.plot = plot;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends ConditionUIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(Plot.class, String.class, Object.class, Class.class);
ConditionUIMenuNameableCreator conditionUIMenuNameableCreator = constructor.newInstance(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), conditionUIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
conditionUIMenuNameableCreator = (ConditionUIMenuNameableCreator) ((ConditionUIMenuNameableCreator) ob).clone();
return ob;
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
conditionUIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(conditionUIMenuNameableCreator);
}
}

84
designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java

@ -1,84 +0,0 @@
package com.fr.plugin.chart.designer.other;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartHyperlinkNameObjectCreartor extends NameObjectCreator {
private Object object;
private UIMenuNameableCreator uIMenuNameableCreator;
public ChartHyperlinkNameObjectCreartor(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends UIMenuNameableCreator> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor(String.class, Object.class, Class.class);
UIMenuNameableCreator uIMenuNameableCreator = constructor.newInstance(menuName, object, getUpdatePane());
return new NameObject(helper.createUnrepeatedName(this.menuName()), uIMenuNameableCreator);
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
return null;
}
/**
* @param ob
* @return
*/
public Object acceptObject2Populate(Object ob) {
if (ob instanceof NameObject) {
ob = ((NameObject) ob).getObject();
}
if (clazzOfObject != null && clazzOfObject.isInstance(ob)) {
doSthChanged4Icon(ob);
uIMenuNameableCreator = ((UIMenuNameableCreator) ob).clone();
if (uIMenuNameableCreator.getObj() != null && object.getClass().isInstance(uIMenuNameableCreator.getObj())) {
return ob;
}
}
return null;
}
/**
* save update bean
*
* @param wrapper
* @param bean
*/
public void saveUpdatedBean(ListModelElement wrapper, Object bean) {
uIMenuNameableCreator.setObj(bean);
((NameObject) wrapper.wrapper).setObject(uIMenuNameableCreator);
}
}

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java

@ -6,14 +6,10 @@ import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mitisky on 16/5/20.
@ -41,17 +37,11 @@ public class VanChartConditionAttrContentPane extends AbstractConditionAttrConte
this.setLayout(new BorderLayout());
this.add(conditionPane, BorderLayout.CENTER);
//todo@mango
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new ConditionUIMenuNameableCreator(plot, Inter.getLocText("Chart-Condition_Attributes"), new ConditionAttr(), showPane));
NameObject[] nameables = new NameObject[collection.getConditionAttrSize()];
for(int i = 0; i < collection.getConditionAttrSize(); i++) {
ConditionUIMenuNameableCreator c =new ConditionUIMenuNameableCreator(plot, collection.getConditionAttr(i).getName(), collection.getConditionAttr(i), showPane);
nameables[i]=(new NameObject(c.getName(),c));
nameables[i]=(new NameObject(collection.getConditionAttr(i).getName(),collection.getConditionAttr(i)));
}
conditionPane.populate(nameables);

12
designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java

@ -6,14 +6,13 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.designer.component.ConditionUIMenuNameableCreator;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
@ -36,7 +35,7 @@ public class VanChartListControlPane extends UIListControlPane {
@Override
public NameableCreator[] createNameableCreators() {
return new ChartConditionNameObjectCreator[]{new ChartConditionNameObjectCreator(this.plot, Inter.getLocText("Condition_Attributes"), ConditionUIMenuNameableCreator.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())};
return new NameObjectCreator[]{new NameObjectCreator(Inter.getLocText("Condition_Attributes"), ConditionAttr.class, ChartTypeInterfaceManager.getInstance().getPlotConditionPane((Plot) plot).getClass())};
}
@ -77,10 +76,6 @@ public class VanChartListControlPane extends UIListControlPane {
return Inter.getLocText("Condition_Attributes");
}
protected Object getob2Populate(Object ob2Populate) {
return ((ConditionUIMenuNameableCreator) ob2Populate).getObj();
}
/**
* Update.
@ -91,8 +86,7 @@ public class VanChartListControlPane extends UIListControlPane {
cc.clearConditionAttr();
for (int i = 0; i < nameables.length; i++) {
UIMenuNameableCreator uiMenuNameableCreator = (UIMenuNameableCreator) ((NameObject) nameables[i]).getObject();
ConditionAttr ca = (ConditionAttr) uiMenuNameableCreator.getObj();
ConditionAttr ca = (ConditionAttr) ((NameObject) nameables[i]).getObject();
ca.setName(nameables[i].getName());
cc.addConditionAttr(ca);

116
designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java

@ -0,0 +1,116 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class AlertLineListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new ChartNameObjectCreator[]{new ChartNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
protected String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_AlertLine");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
ChartNameObjectCreator[] creators = {new ChartNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_AlertLine"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> values = axis.getAlertValues();
for (VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(alertValue.getAlertPaneSelectName(), alertValue));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for (int i = 0; i < nameables.length; i++) {
VanChartAlertValue value = (VanChartAlertValue) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setAlertPaneSelectName(nameables[i].getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
}

121
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java

@ -0,0 +1,121 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
/**
* Created by mengao on 2017/8/22.
*/
public class BackgroundListControlPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
update((VanChartPlot) plot, false);
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
@Override
public NameableCreator[] createNameableCreators() {
return new BackgroundNameObjectCreator[]{new BackgroundNameObjectCreator(new String[]{Inter.getLocText("ChartF-X_Axis"), Inter.getLocText("ChartF-Y_Axis")},
Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartAlertValue.class, VanChartAlertValuePane.class)};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
@Override
public String getAddItemText() {
return Inter.getLocText("Plugin-ChartF_CustomIntervalBackground");
}
public void populate(Plot plot) {
this.plot = plot;
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
BackgroundNameObjectCreator[] creators = {new BackgroundNameObjectCreator(axisNames, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), VanChartCustomIntervalBackground.class, VanChartCustomIntervalBackgroundPane.class)};
refreshNameableCreator(creators);
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for (VanChartCustomIntervalBackground background : customIntervalBackgrounds) {
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
nameObjects.add(new NameObject(background.getCustomIntervalBackgroundSelectName(), background));
}
}
populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
doLayout();
}
public void update(Plot plot, boolean isDefaultIntervalBackground) {
Nameable[] nameables = this.update();
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
for (VanChartAxis axis : xAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for (VanChartAxis axis : yAxisList) {
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if (!isDefaultIntervalBackground) {
for (int i = 0; i < nameables.length; i++) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground) ((NameObject) nameables[i]).getObject();
if (ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())) {
value.setCustomIntervalBackgroundSelectName(nameables[i].getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
}

48
designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java

@ -0,0 +1,48 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/23.
*/
public class BackgroundNameObjectCreator extends ChartNameObjectCreator {
public BackgroundNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(object, menuName, clazz, updatePane);
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartCustomIntervalBackground> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartCustomIntervalBackground vanChartCustomIntervalBackground = constructor.newInstance();
vanChartCustomIntervalBackground.setAxisNamesArray((String[]) object);
vanChartCustomIntervalBackground.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartCustomIntervalBackground);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

53
designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java

@ -0,0 +1,53 @@
package com.fr.plugin.chart.designer.style.background;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.UnrepeatedNameHelper;
import com.fr.general.FRLogger;
import com.fr.general.NameObject;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.stable.Nameable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
/**
* Created by mengao on 2017/8/21.
*/
public class ChartNameObjectCreator extends NameObjectCreator {
protected Object object;
public ChartNameObjectCreator(Object object, String menuName, Class clazz, Class<? extends BasicBeanPane> updatePane) {
super(menuName, clazz, updatePane);
this.object = object;
}
/**
* create Nameable
*
* @param helper
* @return
*/
public Nameable createNameable(UnrepeatedNameHelper helper) {
Constructor<? extends VanChartAlertValue> constructor = null;
try {
constructor = clazzOfInitCase.getConstructor();
VanChartAlertValue vanChartAlertValue = constructor.newInstance();
vanChartAlertValue.setAxisNamesArray((String[]) object);
vanChartAlertValue.setAxisName(((String[]) object)[0]);
return new NameObject(helper.createUnrepeatedName(this.menuName()), vanChartAlertValue);
} catch (NoSuchMethodException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRLogger.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRLogger.getLogger().error(e.getMessage(), e);
}
return null;
}
}

11
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java

@ -46,6 +46,8 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
private UIComboBox fontName;
private ColorSelectBox fontColor;
private VanChartAlertValue chartAlertValue;
public VanChartAlertValuePane(){
initComponents();
}
@ -134,6 +136,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
}
public void populateBean(VanChartAlertValue chartAlertValue){
this.chartAlertValue =chartAlertValue;
alertAxis = new UIButtonGroup(chartAlertValue.getAxisNamesArray(), chartAlertValue.getAxisNamesArray());
alertAxis.setSelectedItem(chartAlertValue.getAxisName());
alertAxis.addChangeListener(new ChangeListener() {
@ -165,8 +168,7 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
fontColor.setSelectObject(chartAlertValue.getAlertFont().getForeground());
}
@Override
public void updateBean(VanChartAlertValue chartAlertValue) {
public VanChartAlertValue updateBean(){
chartAlertValue.setAxisName(alertAxis.getSelectedItem().toString());
chartAlertValue.setAlertValueFormula(new Formula(alertValue.updateBean()));
@ -191,9 +193,6 @@ public class VanChartAlertValuePane extends BasicBeanPane<VanChartAlertValue> {
} else {
chartAlertValue.setAlertPosition(alertTextPosition.getSelectedIndex() == 0 ? Constants.LEFT : Constants.RIGHT);
}
}
public VanChartAlertValue updateBean(){
return null;
return chartAlertValue;
}
}

183
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java

@ -2,30 +2,21 @@ package com.fr.plugin.chart.designer.style.background;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenutable.UIMenuNameableCreator;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.DefaultAxisHelper;
import com.fr.plugin.chart.attr.axis.VanChartAlertValue;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartCustomIntervalBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.VanChartUIMenuNameableCreator;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
/**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
@ -36,14 +27,14 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
protected ColorSelectBox horizontalGridLine;
protected ColorSelectBox verticalGridLine;
protected UICorrelationComboBoxPane alertLine;
protected AlertLineListControlPane alertLine;
private UIButtonGroup isDefaultIntervalBackground;
private JPanel centerPane;
private CardLayout cardLayout;
protected ColorSelectBox horizontalColorBackground;
private ColorSelectBox verticalColorBackground;
protected UICorrelationComboBoxPane customIntervalBackground;
protected BackgroundListControlPane customIntervalBackground;
public VanChartAxisAreaPane() {
initComponents();
@ -82,8 +73,10 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
}
protected JPanel createAlertLinePane() {
alertLine = new UICorrelationComboBoxPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine);
alertLine = new AlertLineListControlPane();
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"), alertLine);
alertLine.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
}
protected JPanel createIntervalPane(double[] row, double[] col) {
@ -92,7 +85,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
verticalColorBackground = new ColorSelectBox(100);
Component[][] components = getIntervalPaneComponents();
JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
customIntervalBackground = new UICorrelationComboBoxPane();
customIntervalBackground = new BackgroundListControlPane();
cardLayout = new CardLayout();
centerPane = new JPanel(cardLayout);
@ -107,7 +100,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
JPanel intervalPane = new JPanel(new BorderLayout(0, 6));
intervalPane.add(isDefaultIntervalBackground, BorderLayout.NORTH);
intervalPane.add(centerPane, BorderLayout.CENTER);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"),intervalPane);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_IntervalBackground"), intervalPane);
intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return panel;
}
protected Component[][] getIntervalPaneComponents() {
@ -132,18 +127,16 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
public void populateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
String[] axisNames = DefaultAxisHelper.getAllAxisNames(xAxisList, yAxisList);
populateGridLine(rectanglePlot);
populateAlert(xAxisList, yAxisList, axisNames);
alertLine.populate(plot);
isDefaultIntervalBackground.setSelectedIndex(rectanglePlot.isDefaultIntervalBackground() ? 0 : 1);
horizontalColorBackground.setSelectObject(rectanglePlot.getDefaultYAxis().getDefaultIntervalBackgroundColor());
verticalColorBackground.setSelectObject(rectanglePlot.getDefaultXAxis().getDefaultIntervalBackgroundColor());
populateCustomIntervalBackground(xAxisList, yAxisList, axisNames);
customIntervalBackground.populate(plot);
checkCardPane();
}
@ -152,97 +145,13 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
verticalGridLine.setSelectObject(rectanglePlot.getDefaultXAxis().getMainGridColor());
}
protected Class<? extends BasicBeanPane> getAlertPaneClass() {
return VanChartAlertValuePane.class;
}
protected void setAlertDemoAxisName(VanChartAlertValue demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartAlertValue demo = new VanChartAlertValue();
demo.setAxisNamesArray(axisNames);
setAlertDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_AlertLine"), demo, getAlertPaneClass()));
alertLine.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartAlertValue> values = axis.getAlertValues();
for(VanChartAlertValue alertValue : values) {
alertValue.setAxisNamesArray(axisNames);
alertValue.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(alertValue.getAlertPaneSelectName(), alertValue, getAlertPaneClass()));
}
}
alertLine.populateBean(list);
alertLine.doLayout();
}
protected Class<? extends BasicBeanPane> getIntervalPaneClass() {
return VanChartCustomIntervalBackgroundPane.class;
}
protected void setCustomIntervalBackgroundDemoAxisName(VanChartCustomIntervalBackground demo, String[] axisNames) {
demo.setAxisName(axisNames[0]);
}
private void populateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList, String[] axisNames){
List<UIMenuNameableCreator> menuList = new ArrayList<UIMenuNameableCreator>();
VanChartCustomIntervalBackground demo = new VanChartCustomIntervalBackground();
demo.setAxisNamesArray(axisNames);
setCustomIntervalBackgroundDemoAxisName(demo, axisNames);
menuList.add(new VanChartUIMenuNameableCreator(Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"), demo, getIntervalPaneClass()));
customIntervalBackground.refreshMenuAndAddMenuAction(menuList);
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
for(VanChartAxis axis: xAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
for(VanChartAxis axis: yAxisList){
List<VanChartCustomIntervalBackground> customIntervalBackgrounds = axis.getCustomIntervalBackgroundArray();
for(VanChartCustomIntervalBackground background : customIntervalBackgrounds){
background.setAxisNamesArray(axisNames);
background.setAxisName(axis.getAxisName());
list.add(new VanChartUIMenuNameableCreator(background.getCustomIntervalBackgroundSelectName(), background, getIntervalPaneClass()));
}
}
customIntervalBackground.populateBean(list);
customIntervalBackground.doLayout();
}
public void updateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
List<VanChartAxis> xAxisList = rectanglePlot.getXAxisList();
List<VanChartAxis> yAxisList = rectanglePlot.getYAxisList();
updateGirdLine(rectanglePlot);
updateAlert(xAxisList, yAxisList);
alertLine.update(plot);
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0);
if (rectanglePlot.isDefaultIntervalBackground()) {
@ -252,7 +161,7 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(null);
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(null);
}
updateCustomIntervalBackground(xAxisList, yAxisList);
customIntervalBackground.update(plot, isDefaultIntervalBackground.getSelectedIndex() == 0);
}
protected void updateGirdLine(VanChartRectanglePlot rectanglePlot) {
@ -260,36 +169,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
rectanglePlot.getDefaultXAxis().setMainGridColor(verticalGridLine.getSelectObject());
}
private void updateAlert(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){
List<UIMenuNameableCreator> alertList = alertLine.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
for(VanChartAxis axis : yAxisList){
List<VanChartAlertValue> axisAlerts = new ArrayList<VanChartAlertValue>();
for(UIMenuNameableCreator creator : alertList) {
VanChartAlertValue value = (VanChartAlertValue)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName()) || yAxisEquals(value.getAxisName(), axis.getAxisName())){
value.setAlertPaneSelectName(creator.getName());
axisAlerts.add(value);
}
}
axis.setAlertValues(axisAlerts);
}
}
/**
* Y軸和雷達圖的極軸也是相等的
*
* @param axisName
* @param valueAxisName
* @return
@ -299,39 +181,6 @@ public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
ComparatorUtils.equals(VanChartAttrHelper.RADAR_Y_AXIS_PREFIX, axisName);
}
private void updateCustomIntervalBackground(List<VanChartAxis> xAxisList, List<VanChartAxis> yAxisList){
List<UIMenuNameableCreator> customList = customIntervalBackground.updateBean();
for(VanChartAxis axis : xAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
for(VanChartAxis axis : yAxisList){
List<VanChartCustomIntervalBackground> axisCustomBackground = new ArrayList<VanChartCustomIntervalBackground>();
if(isDefaultIntervalBackground.getSelectedIndex() == 1){//tab选中间隔背景,则置所有自定义间隔背景为空数组
for(UIMenuNameableCreator creator : customList) {
VanChartCustomIntervalBackground value = (VanChartCustomIntervalBackground)creator.getObj();
if(ComparatorUtils.equals(value.getAxisName(), axis.getAxisName())){
value.setCustomIntervalBackgroundSelectName(creator.getName());
axisCustomBackground.add(value);
}
}
}
axis.setCustomIntervalBackgroundArray(axisCustomBackground);
}
}
public Plot updateBean() {
return null;
}

17
designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java

@ -32,8 +32,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
private ColorSelectBox color;
private UINumberDragPane transparent;
public VanChartCustomIntervalBackgroundPane(){
}
private VanChartCustomIntervalBackground customIntervalBackground;
private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@ -44,8 +43,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
top.add(createContentPane());
}
private JPanel createContentPane()
{
private JPanel createContentPane() {
bottomValue = new TinyFormulaPane();
topValue = new TinyFormulaPane();
bottomValue.setPreferredSize(new Dimension(124,20));
@ -90,6 +88,7 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
}
public void populateBean(VanChartCustomIntervalBackground customIntervalBackground){
this.customIntervalBackground = customIntervalBackground;
backgroundAxis = new UIButtonGroup(customIntervalBackground.getAxisNamesArray(), customIntervalBackground.getAxisNamesArray());
backgroundAxis.setSelectedItem(customIntervalBackground.getAxisName());
@ -99,20 +98,16 @@ public class VanChartCustomIntervalBackgroundPane extends BasicBeanPane<VanChart
topValue.populateBean(Utils.objectToString(customIntervalBackground.getToFormula()));
color.setSelectObject(customIntervalBackground.getBackgroundColor());
transparent.populateBean(customIntervalBackground.getAlpha() * VanChartAttrHelper.PERCENT);
}
public void updateBean(VanChartCustomIntervalBackground customIntervalBackground){
public VanChartCustomIntervalBackground updateBean(){
customIntervalBackground.setAxisName(backgroundAxis.getSelectedItem().toString());
customIntervalBackground.setFromFormula(new Formula(bottomValue.updateBean()));
customIntervalBackground.setToFormula(new Formula(topValue.updateBean()));
customIntervalBackground.setBackgroundColor(color.getSelectObject());
customIntervalBackground.setAlpha(transparent.updateBean() / VanChartAttrHelper.PERCENT);
}
public VanChartCustomIntervalBackground updateBean(){
return null;
return customIntervalBackground;
}
}

3
designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java

@ -29,7 +29,8 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{
this.setLayout(new BorderLayout());
initAllComponent();
JPanel panel = getContentPane();
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15));
this.add(getJSeparator(), BorderLayout.NORTH);
this.add(panel, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight()));

18
designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -11,12 +11,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
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.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
@ -32,7 +32,7 @@ import java.util.List;
*/
public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver {
private static final int HT = 20;
private static final int WD = 120;
private static final int WD = 100;
private UISpinner levelNumEdit;
private UITextField nameField;
protected UIComboBox value;
@ -103,7 +103,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
calculateCombox.reset();
calculateCombox.setPreferredSize(new Dimension(WD, HT));
components_center[levelNum] = new Component[]{new JSeparator(), null};
components_center[levelNum] = new Component[]{getJSeparator(), null};
components_center[levelNum+1] = new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")), value};
components_center[levelNum+2] = new Component[]{new UILabel(Inter.getLocText("Chart-Summary_Method")), calculateCombox};
@ -112,7 +112,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
registerListener4Center();
return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center);
}
@ -175,11 +175,11 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MultiPie_Series_Name")), nameField},
new Component[]{new JSeparator(),null },
new Component[]{getJSeparator(),null },
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Level_Number")), levelNumEdit},
};
return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north);
}
private void refreshCenterPane(){
@ -357,4 +357,10 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
}
return false;
}
protected JSeparator getJSeparator() {
JSeparator jSeparator = new JSeparator();
jSeparator.setPreferredSize(new Dimension(220, 2));
return jSeparator;
}
}

Loading…
Cancel
Save