Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~kerry/design into release/9.0

master
kerry 7 years ago
parent
commit
d8d646de9c
  1. 8
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  2. 2
      designer_base/src/com/fr/design/gui/style/NumberDragBar.java
  3. 2
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  4. 6
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  5. 6
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  6. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  7. 12
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  8. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java
  9. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  10. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  11. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java
  12. 16
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java
  13. 25
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  14. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java
  15. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  16. 13
      designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java
  17. 0
      designer_chart/src/com/fr/plugin/chart/background.png
  18. 20
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  19. 49
      designer_chart/src/com/fr/plugin/chart/custom/component/VanChartHyperLinkPane.java
  20. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartConditionNameObjectCreator.java
  21. 84
      designer_chart/src/com/fr/plugin/chart/designer/other/ChartHyperlinkNameObjectCreartor.java
  22. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartConditionAttrContentPane.java
  23. 12
      designer_chart/src/com/fr/plugin/chart/designer/other/VanChartListControlPane.java
  24. 116
      designer_chart/src/com/fr/plugin/chart/designer/style/background/AlertLineListControlPane.java
  25. 121
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundListControlPane.java
  26. 48
      designer_chart/src/com/fr/plugin/chart/designer/style/background/BackgroundNameObjectCreator.java
  27. 53
      designer_chart/src/com/fr/plugin/chart/designer/style/background/ChartNameObjectCreator.java
  28. 11
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAlertValuePane.java
  29. 237
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartAxisAreaPane.java
  30. 17
      designer_chart/src/com/fr/plugin/chart/designer/style/background/VanChartCustomIntervalBackgroundPane.java
  31. 3
      designer_chart/src/com/fr/plugin/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java
  32. 18
      designer_chart/src/com/fr/plugin/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

8
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -8,7 +8,6 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.gui.chart.DownLoadOnLineSourcesHelper;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.UIList;
@ -233,13 +232,6 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C
getCurrentEditingTemplate().repaint();
}
public void downLoadSources() {
DownLoadOnLineSourcesHelper pane = new DownLoadOnLineSourcesHelper();
pane.addMapJSONSiteInfo();
pane.addPhantomSiteInfo();
pane.installOnline();
}
private class HistoryListCellRender extends DefaultListCellRenderer {
@Override

2
designer_base/src/com/fr/design/gui/style/NumberDragBar.java

@ -74,7 +74,7 @@ public class NumberDragBar extends JComponent {
g2.setColor(isEnabled() ? UIConstants.FONT_COLOR : UIManager.getColor("Label.disabledForeground"));
g2.drawString(String.valueOf(minValue), 2, 10);
g2.drawString(String.valueOf(maxValue), width - 20, 10);
g2.drawString(String.valueOf(maxValue), width - 10 * String.valueOf(maxValue).length(), 10);
if(minValue < 0) {
g2.drawString("0", width / 2 - 2, 10);
}

2
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -42,6 +42,7 @@ import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.DownloadOnlineSourcesHelper;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot;
@ -125,6 +126,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
DesignImageEvent.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
}
});
}

6
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java

@ -331,10 +331,4 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
public void callback() {
this.repaint();
}
@Override
public void downLoadSources() {
HistoryTemplateListPane.getInstance().downLoadSources();
}
}

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");
}

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

@ -67,7 +67,8 @@ 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);
this.add(panel, "0,6,2,4");
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
this.add(panel, "0,6,2,4");
addButton.addActionListener(new ActionListener() {
@Override

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,14 +57,9 @@ 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);
JPanel pane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("FR-Chart-Data_Filter"),filterPane);
filterPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
double[] cs = {p};
components = new Component[][]{
new Component[]{panel1},
};
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, cs);
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);

25
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.*;
@ -35,31 +36,35 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
nameBox = new UIComboBox();
valueBox = new UIComboBox();
filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
nameBox.setPreferredSize(new Dimension(100, 20));
valueBox.setPreferredSize(new Dimension(100, 20));
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 panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
this.add(panel,BorderLayout.CENTER);
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);
}
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);
}

13
designer_base/src/com/fr/design/gui/chart/DownLoadOnLineSourcesHelper.java → designer_chart/src/com/fr/plugin/chart/DownloadOnlineSourcesHelper.java

@ -1,4 +1,4 @@
package com.fr.design.gui.chart;
package com.fr.plugin.chart;
import com.fr.base.FRContext;
import com.fr.design.RestartHelper;
@ -26,7 +26,7 @@ import java.util.List;
/**
* Created by shine on 2017/8/21.
*/
public class DownLoadOnLineSourcesHelper {
public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent{
// 定义加载窗口大小
private static final int LOAD_WIDTH = 455;
private static final int INCIDENT_HEIGHT = 15;
@ -151,7 +151,7 @@ public class DownLoadOnLineSourcesHelper {
private void initDialog() {
// 创建标签,并在标签上放置一张图片
BufferedImage image = IOUtils.readImage("/com/fr/design/gui/chart/background.png");
BufferedImage image = IOUtils.readImage("/com/fr/plugin/chart/background.png");
ImageIcon imageIcon = new ImageIcon(image);
UILabel label = new UILabel(imageIcon);
label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT);
@ -209,6 +209,13 @@ public class DownLoadOnLineSourcesHelper {
}
}
@Override
public void downloadSources() {
this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline();
}
private class SiteInfo {
String siteKind;
String localDir;

0
designer_base/src/com/fr/design/gui/chart/background.png → designer_chart/src/com/fr/plugin/chart/background.png

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 105 KiB

20
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,20 +61,17 @@ 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);
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,10,0,15));
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{filterPane}
};
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);
yCombox.addItemListener(tooltipListener);

49
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);
}
/**
@ -113,7 +112,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
if (isPopulating) {
return;
}
update((VanChartPlot)plot);
update((VanChartPlot) plot);
}
public void populate(Plot plot) {
@ -125,15 +124,14 @@ public class VanChartHyperLinkPane extends UIListControlPane {
for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator();
//todo@shine9.0
// paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
// paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
//todo@mengao 去掉UIMenuNameableCreator
java.util.List<UIMenuNameableCreator> list = refreshList(paneMap);
ChartHyperlinkNameObjectCreartor[] creators= new ChartHyperlinkNameObjectCreartor[list.size()];
for(int i = 0; list != null && i < list.size(); i++) {
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());
}
@ -142,12 +140,12 @@ public class VanChartHyperLinkPane extends UIListControlPane {
java.util.List<NameObject> nameObjects = new ArrayList<NameObject>();
NameJavaScriptGroup nameGroup = populateHotHyperLink(plot);
for(int i = 0; nameGroup != null && i < nameGroup.size(); i++) {
for (int i = 0; nameGroup != null && i < nameGroup.size(); i++) {
NameJavaScript javaScript = nameGroup.getNameHyperlink(i);
if(javaScript != null && javaScript.getJavaScript() != null) {
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));
UIMenuNameableCreator uiMenuNameableCreator = new UIMenuNameableCreator(javaScript.getName(), script, getUseMap(paneMap, script.getClass()));
nameObjects.add(new NameObject(uiMenuNameableCreator.getName(), uiMenuNameableCreator.getObj()));
}
}
@ -160,7 +158,7 @@ public class VanChartHyperLinkPane extends UIListControlPane {
return plot.getHotHyperLink();
}
protected HashMap getHyperlinkMap(Plot plot){
protected HashMap getHyperlinkMap(Plot plot) {
return HyperlinkMapFactory.getHyperlinkMap(plot);
}
@ -181,10 +179,10 @@ public class VanChartHyperLinkPane extends UIListControlPane {
NameJavaScriptGroup nameGroup = new NameJavaScriptGroup();
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());
for (int i = 0; i < nameables.length; i++) {
JavaScript javaScript = (JavaScript) ((NameObject) nameables[i]).getObject();
String name = nameables[i].getName();
NameJavaScript nameJava = new NameJavaScript(name, javaScript);
nameGroup.addNameHyperlink(nameJava);
}
@ -219,23 +217,16 @@ public class VanChartHyperLinkPane extends UIListControlPane {
}
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){
return (Class<? extends BasicBeanPane>)map.get(key);
if (map.get(key) != null) {
return (Class<? extends BasicBeanPane>) map.get(key);
}
//引擎在这边放了个provider,当前表单对象
for(Object tempKey : map.keySet()){
if(((Class)tempKey).isAssignableFrom((Class)key)){
return (Class<? extends BasicBeanPane>)map.get(tempKey);
for (Object tempKey : map.keySet()) {
if (((Class) tempKey).isAssignableFrom((Class) key)) {
return (Class<? extends BasicBeanPane>) map.get(tempKey);
}
}
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;
}
}

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

@ -2,97 +2,90 @@ 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;
/**
* 样式-背景-绘图区背景-坐标轴图表特有间隔背景网格线警戒线
*/
public class VanChartAxisAreaPane extends BasicBeanPane<Plot>{
public class VanChartAxisAreaPane extends BasicBeanPane<Plot> {
private static final long serialVersionUID = -1880497996650835504L;
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(){
public VanChartAxisAreaPane() {
initComponents();
}
protected void initComponents(){
protected void initComponents() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { f };
double[] rowSize = {p,p,p};
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{createGridLinePane(new double[]{p,p,p}, new double[]{p,f})},
new Component[]{createGridLinePane(new double[]{p, p, p}, new double[]{p, f})},
new Component[]{createAlertLinePane()},
new Component[]{createIntervalPane(new double[]{p,p,p,p}, new double[]{p,f})},
new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{p, f})},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
this.add(panel, BorderLayout.CENTER);
}
private JPanel createGridLinePane(double[] row, double[] col){
private JPanel createGridLinePane(double[] row, double[] col) {
horizontalGridLine = new ColorSelectBox(100);
verticalGridLine = new ColorSelectBox(100);
Component[][] components = getGridLinePaneComponents();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"),panel);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("ChartF-Grid_Line"), panel);
}
protected Component[][] getGridLinePaneComponents() {
return new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalGridLine},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalGridLine},
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalGridLine},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalGridLine},
};
}
protected JPanel createAlertLinePane(){
alertLine = new UICorrelationComboBoxPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Plugin-ChartF_AlertLine"),alertLine);
protected JPanel createAlertLinePane() {
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){
protected JPanel createIntervalPane(double[] row, double[] col) {
isDefaultIntervalBackground = new UIButtonGroup(new String[]{Inter.getLocText("Plugin-ChartF_IntervalBackground"), Inter.getLocText("Plugin-ChartF_CustomIntervalBackground")});
horizontalColorBackground = new ColorSelectBox(100);
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,43 +100,43 @@ 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() {
return new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")),horizontalColorBackground},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")),verticalColorBackground},
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Horizontal")), horizontalColorBackground},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Direction_Vertical")), verticalColorBackground},
};
}
private void checkCardPane(){
if(isDefaultIntervalBackground.getSelectedIndex() == 0){
private void checkCardPane() {
if (isDefaultIntervalBackground.getSelectedIndex() == 0) {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_IntervalBackground"));
} else {
cardLayout.show(centerPane, Inter.getLocText("Plugin-ChartF_CustomIntervalBackground"));
}
}
protected String title4PopupWindow(){
protected String title4PopupWindow() {
return "";
}
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);
public void populateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
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,107 +145,23 @@ 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();
public void updateBean(Plot plot) {
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
updateGirdLine(rectanglePlot);
updateAlert(xAxisList, yAxisList);
alertLine.update(plot);
rectanglePlot.setIsDefaultIntervalBackground(isDefaultIntervalBackground.getSelectedIndex() == 0);
if(rectanglePlot.isDefaultIntervalBackground()){
if (rectanglePlot.isDefaultIntervalBackground()) {
rectanglePlot.getDefaultYAxis().setDefaultIntervalBackgroundColor(horizontalColorBackground.getSelectObject());
rectanglePlot.getDefaultXAxis().setDefaultIntervalBackgroundColor(verticalColorBackground.getSelectObject());
} else {
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,40 +181,7 @@ 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(){
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