Browse Source

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

master
plough 7 years ago
parent
commit
bdfe04055c
  1. 2
      designer/src/com/fr/design/mainframe/ReportFloatPane.java
  2. 4
      designer/src/com/fr/grid/GridColumn.java
  3. 15
      designer/src/com/fr/grid/GridColumnUI.java
  4. 13
      designer/src/com/fr/grid/GridCorner.java
  5. 4
      designer/src/com/fr/grid/GridRow.java
  6. 11
      designer/src/com/fr/grid/GridRowUI.java
  7. 3
      designer/src/com/fr/start/Designer.java
  8. 14
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  9. 44
      designer_base/src/com/fr/design/dialog/BasicScrollPane.java
  10. 44
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  11. 2
      designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java
  12. 21
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  13. 115
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  14. 2
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  15. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/area.png
  16. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/bar.png
  17. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/bubble.png
  18. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/column.png
  19. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/custom.png
  20. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/drillmap.png
  21. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/funnel.png
  22. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/gantt.png
  23. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/gauge.png
  24. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/heatmap.png
  25. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/line.png
  26. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/map.png
  27. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/multiPie.png
  28. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/pie.png
  29. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/radar.png
  30. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/scatter.png
  31. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/structure.png
  32. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/treeMap.png
  33. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/wordcloud.png
  34. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_Drill_Map.png
  35. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewBubble.png
  36. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewCustom.png
  37. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewFunnel.png
  38. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGantt.png
  39. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGauge.png
  40. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewHeatMap.png
  41. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMap.png
  42. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png
  43. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewRadar.png
  44. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewScatter.png
  45. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png
  46. 9
      designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java
  47. 5
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  48. 44
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  49. 18
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  50. 38
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  51. 28
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  52. 83
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  53. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java
  54. 40
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  55. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/XYScatterSeriesPane.java
  56. 93
      designer_chart/src/com/fr/design/module/ChartDesignerModule.java
  57. 40
      designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java
  58. 96
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java
  59. 95
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java
  60. 51
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java
  61. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/area.png
  62. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/custom.png
  63. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/percentStack.png
  64. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/stack.png
  65. 56
      designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java
  66. 96
      designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java
  67. 23
      designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java
  68. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/bar.png
  69. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/custom.png
  70. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/percentstack.png
  71. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/stack.png
  72. 85
      designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java
  73. 94
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java
  74. 22
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java
  75. 27
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java
  76. 171
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java
  77. 92
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java
  78. 57
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java
  79. 74
      designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java
  80. 184
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  81. 28
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java
  82. 23
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java
  83. 26
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java
  84. 19
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java
  85. 18
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java
  86. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/bubble.png
  87. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/force.png
  88. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/large.png
  89. 43
      designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java
  90. 36
      designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java
  91. 93
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java
  92. 34
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java
  93. 96
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java
  94. 194
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java
  95. 143
      designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java
  96. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/column.png
  97. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/custom.png
  98. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/percentstack.png
  99. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/stack.png
  100. 56
      designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java
  101. Some files were not shown because too many files have changed in this diff Show More

2
designer/src/com/fr/design/mainframe/ReportFloatPane.java

@ -49,7 +49,7 @@ public class ReportFloatPane extends JPanel {
JPanel toolBarPane = new JPanel(new BorderLayout());
toolBarPane.add(topToolBar, BorderLayout.CENTER);
toolBarPane.setBorder(BorderFactory.createLineBorder(UIConstants.TITLED_BORDER_COLOR));
toolBarPane.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER));
toolBarPane.setPreferredSize(new Dimension(155,20));
UILabel emptyLabel = new UILabel();
emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));

4
designer/src/com/fr/grid/GridColumn.java

@ -68,11 +68,11 @@ public class GridColumn extends GridHeader<String> {
@Override
public Dimension getPreferredSize() {
ElementCasePane reportPane = this.getElementCasePane();
float time = (float)reportPane.getResolution()/ ScreenResolution.getScreenResolution();
if (!reportPane.isColumnHeaderVisible()) {
return new Dimension(0, 0);
}
return new Dimension(super.getPreferredSize().width, GraphHelper.getFontMetrics(this.getFont()).getHeight() + SIZE_ADJUST);
return new Dimension(super.getPreferredSize().width, (int) (GraphHelper.getFontMetrics(this.getFont()).getHeight() * time + SIZE_ADJUST));
}
}

15
designer/src/com/fr/grid/GridColumnUI.java

@ -48,6 +48,9 @@ public class GridColumnUI extends ComponentUI {
Grid gird = reportPane.getGrid();
// size
Dimension size = gridColumn.getSize();
float time = (float)resolution/ScreenResolution.getScreenResolution();
g2d.setFont(gridColumn.getFont().deriveFont(gridColumn.getFont().getSize2D() * time));
ElementCase elementCase = reportPane.getEditingElementCase();
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(elementCase);
int horizontalValue = gird.getHorizontalValue();
@ -77,7 +80,7 @@ public class GridColumnUI extends ComponentUI {
g2d.setPaint(gridColumn.getSeparatorLineColor());
GraphHelper.drawLine(g2d, 0, 0, 0, size.getHeight());
double tmpWidth2 = 0;
drawColumn(horizontalBeginValue, horizontalEndValue, columnWidthList, tmpWidth2, reportPane, g2d, gridColumn);
drawColumn(horizontalBeginValue, horizontalEndValue, columnWidthList, tmpWidth2, reportPane, g2d, gridColumn, size);
// 画上边的边框线.
g2d.setColor(gridColumn.getSeparatorLineColor());
GraphHelper.drawLine(g2d, 0, 0, tmpWidth2, 0);
@ -85,14 +88,13 @@ public class GridColumnUI extends ComponentUI {
private void drawColumn(int horizontalBeginValue, int horizontalEndValue, DynamicUnitList columnWidthList, double tmpWidth2,
ElementCasePane reportPane, Graphics2D g2d, GridColumn gridColumn) {
ElementCasePane reportPane, Graphics2D g2d, GridColumn gridColumn, Dimension size) {
// draw column.
boolean isSelectedBounds;
double tmpWidth1 = 0;
double tmpIncreaseWidth = 0;
ElementCase elementCase = reportPane.getEditingElementCase();
Dimension size = gridColumn.getSize();
// FontMetrics
FontRenderContext fontRenderContext = g2d.getFontRenderContext();
LineMetrics fm = gridColumn.getFont().getLineMetrics("", fontRenderContext);
@ -158,8 +160,9 @@ public class GridColumnUI extends ComponentUI {
columnContent += "(FR)";
}
}
float time = (float)resolution/ScreenResolution.getScreenResolution();
double stringWidth = gridColumn.getFont().getStringBounds(columnContent, fontRenderContext).getWidth();
double stringWidth = gridColumn.getFont().getStringBounds(columnContent, fontRenderContext).getWidth() * time;
// if (stringWidth > tmpIncreaseWidth) {
// paintMoreContent(i, g2d, tmpWidth1, size, tmpIncreaseWidth, isSelectedBounds, gridColumn, elementCase, columnContent, stringWidth, fmAscent);
// } else {
@ -203,8 +206,8 @@ public class GridColumnUI extends ComponentUI {
g2d.setPaint(UIManager.getColor("controlShadow"));
}
}
GraphHelper.drawString(g2d, columnContent, tmpWidth1 + (tmpIncreaseWidth - stringWidth) / 2, fmAscent + GridHeader.SIZE_ADJUST / 2 + 1);
GraphHelper.drawString(g2d, columnContent, tmpWidth1 + (tmpIncreaseWidth - stringWidth) / 2,
(gridColumn.getSize().height/2 + g2d.getFont().getSize2D()/2));
}

13
designer/src/com/fr/grid/GridCorner.java

@ -12,6 +12,7 @@ import java.awt.geom.Rectangle2D;
import javax.swing.event.MouseInputListener;
import com.fr.base.GraphHelper;
import com.fr.base.ScreenResolution;
import com.fr.design.mainframe.ElementCasePane;
/**
@ -37,7 +38,7 @@ public class GridCorner extends BaseGridComponent {
Graphics2D g2d = (Graphics2D) g;
ElementCasePane reportPane = this.getElementCasePane();
float time = (float)reportPane.getResolution()/ ScreenResolution.getScreenResolution();
//size
Dimension size = this.getSize();
Rectangle2D rect2D = new Rectangle2D.Double(0, 0, size.getWidth(), size.getHeight());
@ -50,7 +51,7 @@ public class GridCorner extends BaseGridComponent {
GraphHelper.fill(g2d, rect2D);
}
paintArc(g2d, size);
paintArc(g2d, size, time);
//画左边的边框线.
g2d.setColor(reportPane.getGridColumn().getSeparatorLineColor());
@ -85,15 +86,15 @@ public class GridCorner extends BaseGridComponent {
}
private void paintArc(Graphics2D g2d, Dimension size) {
private void paintArc(Graphics2D g2d, Dimension size, float time) {
g2d.setColor(Color.gray);
int width = size.width - 16;
int width = (int) (size.width - (16 * time));
int avgWidth = width / 3;
int height = size.height - 8;
int height = (int) (size.height - (8 * time));
int avgHeight = height / 3;
for (int i = 0; i < 3; i ++) {
for (int j = 0; j < 3; j ++) {
GraphHelper.fillArc(g2d, 8 + i * avgWidth, 4 + j * avgHeight, 3, 3, 0, 360);
GraphHelper.fillArc(g2d, (8 * time) + (i * avgWidth), (4 * time) + (j * avgHeight), 3, 3, 0, 360);
}
}
}

4
designer/src/com/fr/grid/GridRow.java

@ -65,13 +65,13 @@ public class GridRow extends GridHeader<Integer> {
@Override
public Dimension getPreferredSize() {
ElementCasePane reportPane = this.getElementCasePane();
float time = (float)reportPane.getResolution()/ ScreenResolution.getScreenResolution();
if (!(reportPane.isRowHeaderVisible())) {
return new Dimension(0, 0);
}
int maxCharNumber = this.caculateMaxCharNumber(reportPane);
return new Dimension(maxCharNumber * GraphHelper.getFontMetrics(this.getFont()).charWidth('M'), super.getPreferredSize().height);
return new Dimension((int) (maxCharNumber * GraphHelper.getFontMetrics(this.getFont()).charWidth('M') * time), super.getPreferredSize().height);
}
/**

11
designer/src/com/fr/grid/GridRowUI.java

@ -46,6 +46,9 @@ public class GridRowUI extends ComponentUI {
ElementCasePane reportPane = gridRow.getElementCasePane();
// size
Dimension size = gridRow.getSize();
float time = (float)resolution/ScreenResolution.getScreenResolution();
g2d.setFont(gridRow.getFont().deriveFont(gridRow.getFont().getSize2D() * time));
ElementCase elementCase = reportPane.getEditingElementCase();
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(elementCase);
int verticalValue = reportPane.getGrid().getVerticalValue();
@ -152,10 +155,10 @@ public class GridRowUI extends ComponentUI {
, ElementCase elementCase, Dimension size, double tmpHeight1) {
// FontMetrics
FontRenderContext fontRenderContext = g2d.getFontRenderContext();
float fmAscent = GraphHelper.getFontMetrics(gridRow.getFont()).getAscent();
double stringWidth = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getWidth();
double stringHeight = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getHeight();
float time = (float)resolution/ScreenResolution.getScreenResolution();
float fmAscent = GraphHelper.getFontMetrics(gridRow.getFont()).getAscent() * time;
double stringWidth = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getWidth() * time;
double stringHeight = gridRow.getFont().getStringBounds(paintText, fontRenderContext).getHeight() * time;
if (isSelectedBounds) {
g2d.setColor(gridRow.getSelectedForeground());
} else {

3
designer/src/com/fr/start/Designer.java

@ -116,6 +116,9 @@ public class Designer extends BaseDesigner {
if (ActionFactory.getChartPreStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartPreStyleAction());
}
if (ActionFactory.getChartMapEditorAction() != null) {
menuDef.addShortCut(ActionFactory.getChartMapEditorAction());
}
}
insertMenu(menuDef, MenuHandler.SERVER);

14
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -32,6 +32,8 @@ public class ActionFactory {
private static UpdateAction chartPreStyleAction = null;
private static UpdateAction chartMapEditorAction = null;
/**
* 待说明
*
@ -69,6 +71,18 @@ public class ActionFactory {
return chartPreStyleAction;
}
/**
* 注册图表的 地图资源
* @param action 地图资源action
*/
public static void registerChartMapEditorAction(UpdateAction action) {
chartMapEditorAction = action;
}
public static UpdateAction getChartMapEditorAction() {
return chartMapEditorAction;
}
/**
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册.
*

44
designer_base/src/com/fr/design/dialog/BasicScrollPane.java

@ -1,23 +1,15 @@
package com.fr.design.dialog;
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.iscrollbar.UIScrollBar;
import javax.swing.*;
import java.awt.*;
import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.iscrollbar.UIScrollBar;
public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = -4293765343535336275L;
private static final int MAXVALUE = 100;
@ -119,7 +111,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
/**
* august:不容易啊 还要用笔画图立个方程才计算出来
*
* @param e
* @param
*/
protected void ajustValues() {
doLayout();
@ -163,26 +155,30 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
} else {
int preferheight = leftcontentPane.getPreferredSize().height;
int value = scrollBar.getValue();
int baseValue = MAXVALUE - scrollBar.getVisibleAmount();
beginY = baseValue == 0 ? 0 : value * (preferheight - maxheight) / baseValue;
if(MAXVALUE - scrollBar.getVisibleAmount() != 0) {
beginY = value * (preferheight - maxheight) / (MAXVALUE - scrollBar.getVisibleAmount());
}
}
int width = parent.getWidth();
int height = parent.getHeight();
if (leftcontentPane.getPreferredSize().height > maxheight) {
leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else {
leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height);
}
setLeftContentPaneBounds(parent, scrollBar, beginY, maxheight);
leftcontentPane.validate();
}
}
protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) {
int width = parent.getWidth();
int height = parent.getHeight();
if (leftcontentPane.getPreferredSize().height > maxheight) {
leftcontentPane.setBounds(0, -beginY, width - scrollBar.getWidth() - DET_WIDTH_OVER_HEIGHT, height + beginY);
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, scrollBar.getWidth(), height);
} else {
leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height);
}
}
protected boolean isShowScrollBar() {
return true;
}
@ -191,7 +187,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
public T updateBean() {
return null;
}
/**
* 用于在调用removeAll以后恢复原来pane的结构放在这边是因为BarLayout是内部类
* @param pane

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

@ -1,31 +1,20 @@
package com.fr.design.file;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.*;
import java.util.List;
import java.util.logging.Level;
import javax.swing.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.fr.base.FRContext;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.dav.LocalEnv;
import com.fr.design.DesignModelAdapter;
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.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.UIList;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
@ -33,9 +22,19 @@ import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.project.ProjectConstants;
import com.fr.design.utils.gui.GUIPaintUtils;
public class HistoryTemplateListPane extends JPanel implements FileOperations {
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
public class HistoryTemplateListPane extends JPanel implements FileOperations, CallbackEvent{
private static final int LIST_BORDER = 4;
private List<JTemplate<?, ?>> historyList;
private JTemplate<?, ?> editingTemplate;
@ -228,6 +227,11 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations {
return ComparatorUtils.equals(filename, editingFileName);
}
@Override
public void callback() {
getCurrentEditingTemplate().repaint();
}
private class HistoryListCellRender extends DefaultListCellRenderer {

2
designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java

@ -1,10 +1,10 @@
package com.fr.design.gui.frpane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.dialog.BasicPane;
import javax.swing.*;
import java.awt.*;

21
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -113,12 +113,7 @@ public class FormatPane extends AbstractBasicStylePane {
centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{null, centerPane},
new Component[]{fontPane, frFontPane},
};
Component[][] components = getComponent(fontPane, centerPane, typePane);
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
@ -126,6 +121,16 @@ public class FormatPane extends AbstractBasicStylePane {
this.add(panel, BorderLayout.CENTER);
}
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{null, centerPane},
new Component[]{fontPane, frFontPane},
};
}
protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() {
@Override
@ -383,6 +388,10 @@ public class FormatPane extends AbstractBasicStylePane {
};
typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener);
setTypeComboBoxPane(typeComboBox);
}
protected void setTypeComboBoxPane (UIComboBox typeComboBox) {
this.add(typeComboBox, BorderLayout.NORTH);
}

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

@ -9,8 +9,25 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.*;
import com.fr.design.chartinterface.AreaIndependentChartInterface;
import com.fr.design.chartinterface.BarIndependentChartInterface;
import com.fr.design.chartinterface.BubbleIndependentChartInterface;
import com.fr.design.chartinterface.ColumnIndependentChartInterface;
import com.fr.design.chartinterface.CustomIndependentChartInterface;
import com.fr.design.chartinterface.DonutIndependentChartInterface;
import com.fr.design.chartinterface.FunnelIndependentChartInterface;
import com.fr.design.chartinterface.GanttIndependentChartInterface;
import com.fr.design.chartinterface.GisMapIndependentChartInterface;
import com.fr.design.chartinterface.LineIndependentChartInterface;
import com.fr.design.chartinterface.MapIndependentChartInterface;
import com.fr.design.chartinterface.MeterIndependentChartInterface;
import com.fr.design.chartinterface.PieIndependentChartInterface;
import com.fr.design.chartinterface.RadarIndependentChartInterface;
import com.fr.design.chartinterface.RangeIndependentChartInterface;
import com.fr.design.chartinterface.StockIndependentChartInterface;
import com.fr.design.chartinterface.XYScatterIndependentChartInterface;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -25,20 +42,58 @@ 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.context.PluginContext;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bar.BarIndependentVanChartInterface;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChartInterface;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.ColumnIndependentVanChartInterface;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.custom.CustomIndependentVanChartInterface;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChartInterface;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
import com.fr.plugin.chart.funnel.designer.FunnelIndependentVanChartInterface;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.plugin.chart.gantt.designer.GanttIndependentVanChartInterface;
import com.fr.plugin.chart.gauge.GaugeIndependentVanChartInterface;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot;
import com.fr.plugin.chart.heatmap.designer.HeatMapIndependentVanChartInterface;
import com.fr.plugin.chart.line.LineIndependentVanChartInterface;
import com.fr.plugin.chart.line.VanChartLinePlot;
import com.fr.plugin.chart.map.MapIndependentVanChartInterface;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChartInterface;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
import com.fr.plugin.chart.pie.PieIndependentVanChartInterface;
import com.fr.plugin.chart.radar.RadarIndependentVanChartInterface;
import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.scatter.ScatterIndependentVanChartInterface;
import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
import com.fr.plugin.chart.structure.desinger.StructureIndependentVanChartInterface;
import com.fr.plugin.chart.treemap.TreeMapIndependentVanChartInterface;
import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.solution.closeable.CloseableContainedMap;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Created by eason on 14/12/29.
@ -58,24 +113,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
static {
readDefault();
readVanChart();
StableFactory.registerMarkedObject(XML_TAG, classManager);
}
static {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override
public void on(PluginEvent event) {
public void envChanged() {
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
}
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraChartType);
DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
}
});
}
@ -130,6 +179,36 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
aRowChart.createSlotImage();
}
}
private static void readVanChart() {
if (chartTypeInterfaces.containsKey(ChartTypeManager.VAN_CHART_PRIORITY)) {
return;
}
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList =
new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class);
chartUIList.put(PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface());
chartUIList.put(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface());
chartUIList.put(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface());
chartUIList.put(VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface());
chartUIList.put(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface());
chartUIList.put(VanChartGaugePlot.VAN_CHART_GAUGE_PLOT, new GaugeIndependentVanChartInterface());
chartUIList.put(VanChartRadarPlot.VAN_CHART_RADAR_PLOT, new RadarIndependentVanChartInterface());
chartUIList.put(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID, new ScatterIndependentVanChartInterface());
chartUIList.put(VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface());
chartUIList.put(VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface());
chartUIList.put(VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface());
chartUIList.put(VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface());
chartUIList.put(VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface());
chartUIList.put(VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface());
chartUIList.put(VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface());
chartUIList.put(VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface());
chartUIList.put(VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface());
chartUIList.put(VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface());
chartUIList.put(VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface());
chartTypeInterfaces.put(ChartTypeManager.VAN_CHART_PRIORITY, chartUIList);
}
private static void readDefault() {

2
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -81,7 +81,7 @@ public class MinMaxValuePane extends JPanel {
};
}
private void checkBoxUse() {
protected void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected());

BIN
designer_chart/src/com/fr/design/images/form/toolbar/area.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/bar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/bubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/column.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/drillmap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/funnel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/gantt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/gauge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/heatmap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/line.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/map.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/multiPie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/pie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/radar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/scatter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/structure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer_chart/src/com/fr/design/images/form/toolbar/treeMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/wordcloud.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_Drill_Map.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewBubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewCustom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewFunnel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGantt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGauge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewHeatMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewRadar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewScatter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

9
designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java

@ -4,6 +4,9 @@ package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*;
import java.awt.*;
public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
public abstract void populate(ChartCollection collection);
@ -25,6 +28,12 @@ public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
}
protected void initContentPane() {
leftContentPane = createContentPane();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original));
this.add(leftContentPane, BorderLayout.CENTER);
}
/**
* 刷新图表数据界面
* @param collection 图表收集器

5
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart;
import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager;
@ -74,12 +73,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
//构建主面板
protected void createTabsPane() {
Icon[] iconArray = new Icon[paneList.size()];
String[] iconArray = new String[paneList.size()];
card = new CardLayout();
center = new JPanel(card);
for (int i = 0; i < paneList.size(); i++) {
AbstractChartAttrPane pane = paneList.get(i);
iconArray[i] = BaseUtils.readIcon(pane.getIconPath());
iconArray[i] = pane.title4PopupWindow();
center.add(pane, pane.title4PopupWindow());
}

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

@ -4,9 +4,9 @@ package com.fr.design.mainframe.chart.gui;
* Created by hufan on 2016/10/20.
*/
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.base.AttrChangeType;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
@ -15,6 +15,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
@ -55,11 +56,9 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p};
double[] rowSize = {p,p};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style") + ":"),configStyleButton},
new Component[]{null, null},
new Component[]{new JSeparator(), null},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style")),configStyleButton},
new Component[]{configPane, null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -84,6 +83,8 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
panel.add(buttonConfigPane, "button");
panel.add(carouselConfigPane, "carousel");
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
return panel;
}
@ -92,35 +93,33 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p,p,p};
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
Component[][] components = new Component[][]{
new Component[]{createTimeIntervalPane(),null},
new Component[]{new JSeparator(),null},
new Component[]{createCarouseBackgroundColorPane(),null},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), timeInterval},
new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel},
};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
}
private Component createTimeIntervalPane() {
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Time_Interval") + ":", timeInterval);
}
private JPanel createCarouseBackgroundColorPane() {
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4carousel);
return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
}
private JPanel createTitleStylePane(){
styleAttrPane = new ChartTextAttrPane();
styleAttrPane = new ChartTextAttrPane(){
protected Component[][] getComponents(JPanel buttonPane) {
return new Component[][]{
new Component[]{fontNameComboBox, null},
new Component[]{buttonPane, null}
};
}
};
styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight()));
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style")+":", styleAttrPane);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane);
}
private JPanel createButtonBackgroundColorPane(){
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4button);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button);
}
private JPanel createButtonConfigPane() {
@ -130,7 +129,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null},
new Component[]{new JSeparator(),null},
new Component[]{createButtonBackgroundColorPane(),null},
};

18
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -97,17 +97,21 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
customPane.setPreferredSize(new Dimension(200, 130));
colorGradient.setPreferredSize(new Dimension(120, 30));
this.setLayout(new BorderLayout());
this.add(getContentPane(),BorderLayout.CENTER);
}
protected JPanel getContentPane () {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { f };
double[] rowSize = { p, p};
Component[][] components = new Component[][]{
new Component[]{styleSelectBox},
new Component[]{customPane}
} ;
JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
Component[][] components = new Component[][]{
new Component[]{styleSelectBox},
new Component[]{customPane}
} ;
return TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize);
}
@Override

38
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -1,25 +1,23 @@
package com.fr.design.mainframe.chart.gui.style;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JPanel;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
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.dialog.BasicPane;
import com.fr.general.FRFont;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
public class ChartTextAttrPane extends BasicPane {
private static final long serialVersionUID = 6731679928019436869L;
@ -147,17 +145,23 @@ public class ChartTextAttrPane extends BasicPane {
buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{fontNameComboBox},
new Component[]{buttonPane}
};
double[] columnSize = {p,f};
double[] rowSize = {p, p, p};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
populate(FRFont.getInstance());
}
protected Component[][] getComponents(JPanel buttonPane) {
UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT);
return new Component[][]{
new Component[]{null, null},
new Component[]{text, fontNameComboBox},
new Component[]{null, buttonPane}
};
}
}

28
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java

@ -1,24 +1,18 @@
package com.fr.design.mainframe.chart.gui.style;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.border.Border;
import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIHeadGroup;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.util.List;
public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L;
@ -114,8 +108,8 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
protected static class NamePane {
private String name;
private AbstractChartTabPane pane;
public NamePane(String name, AbstractChartTabPane pane) {
private BasicScrollPane pane;
public NamePane(String name, BasicScrollPane pane) {
this.name = name;
this.pane = pane;
}
@ -125,10 +119,10 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
public void setName(String name) {
this.name = name;
}
public AbstractChartTabPane getPane() {
public BasicScrollPane getPane() {
return pane;
}
public void setPane(AbstractChartTabPane pane) {
public void setPane(BasicScrollPane pane) {
this.pane = pane;
}

83
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java

@ -26,62 +26,67 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot) {
this(parent, plot, false);
}
public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) {
public AbstractPlotSeriesPane(ChartStylePane parent, Plot plot, boolean custom) {
this.plot = plot;
this.parentPane = parent;
fillStylePane = getFillStylePane();
this.parentPane = parent;
fillStylePane = getFillStylePane();
this.setLayout(new BorderLayout());
this.add(getContentPane(custom), BorderLayout.CENTER);
}
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { f };
double[] rowSize = { p,p,p};
protected JPanel getContentPane(boolean custom) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[3][1];
if(custom) {
if(!(plot instanceof Bar2DPlot)) {
components[0] = new Component[]{getContentInPlotType()};
components[1] = new Component[]{new JSeparator()};
}
JPanel panel;
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
if (custom) {
if (!(plot instanceof Bar2DPlot)) {
components[0] = new Component[]{getContentInPlotType()};
components[1] = new Component[]{new JSeparator()};
}
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(scrollPane, BorderLayout.CENTER);
JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
} else {
if(fillStylePane != null) {
components[0] = new Component[]{fillStylePane};
components[1] = new Component[]{new JSeparator()};
}
JPanel contentPane = getContentInPlotType();
if(contentPane != null) {
components[2] = new Component[]{contentPane};
}
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
if (fillStylePane != null) {
components[0] = new Component[]{fillStylePane};
components[1] = new Component[]{new JSeparator()};
}
JPanel contentPane = getContentInPlotType();
if (contentPane != null) {
components[2] = new Component[]{contentPane};
}
panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
}
/**
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return panel;
}
/**
* 在每个不同类型Plot, 得到不同类型的属性. 比如: 柱形的风格, 折线的线型曲线.
*/
protected abstract JPanel getContentInPlotType();
/**
* 返回 填充界面.
*/
protected ChartFillStylePane getFillStylePane() {
return new ChartFillStylePane();
}
/**
* 界面标题.
*/
@ -95,8 +100,8 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
public Plot updateBean() {
return null;
}
/**
* 更新Plot的属性到系列界面
*/

4
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java

@ -3,9 +3,9 @@ package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.chart.chartattr.Chart;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import javax.swing.*;
import java.awt.*;
@ -15,7 +15,7 @@ import java.awt.*;
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-1-5 上午10:31:50
*/
public class ChartSeriesPane extends BasicScrollPane<Chart>{
public class ChartSeriesPane extends AbstractVanChartScrollPane<Chart> {
protected AbstractPlotSeriesPane seriesStyleContentPane;
protected Chart chart;

40
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -1,27 +1,11 @@
package com.fr.design.mainframe.chart.gui.style.series;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Formula;
import com.fr.chart.base.AreaColor;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.chartglyph.MapHotAreaColor;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -31,12 +15,20 @@ import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = 10;
@ -105,11 +97,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = createComponents();
upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
upControlPane = TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize);
this.textFieldList = this.getTextFieldList();
this.textGroup = new TextFieldGroupPane();
@ -122,6 +113,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
refreshGroupPane(colors, getValueArray(number));
}
protected double[] getRowSIze () {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p};
}
protected UIButtonGroup<Integer> getDesignTypeButtonGroup(){
return designTypeButtonGroup;
}

3
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/XYScatterSeriesPane.java

@ -10,6 +10,7 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.Marker;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.ConfigHelper;
/**
* 散点图 属性表 系列界面.
@ -57,7 +58,7 @@ public class XYScatterSeriesPane extends LineSeriesPane {
attrList.remove(attr);
}
if(!ComparatorUtils.equals(markerPane.getSelectedMarkder().getMarkerType(), Marker.NULL_M)){
if(!ComparatorUtils.equals(markerPane.getSelectedMarkder().getMarkerType(), ConfigHelper.NULL_M)){
attrList.addDataSeriesCondition(new AttrMarkerType(markerPane.getSelectedMarkder().getMarkerType()));
}
}

93
designer_chart/src/com/fr/design/module/ChartDesignerModule.java

@ -1 +1,92 @@
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App<?>[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if (ArrayUtils.isEmpty(rowChart)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } }
package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.map.server.ChartMapEditorAction;
import com.fr.stable.ArrayUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if (ArrayUtils.isEmpty(rowChart)) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
}

40
designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java

@ -0,0 +1,40 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/11/18.
*/
public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/area.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartAreaPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartAreaConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartAreaSeriesPane(parent, plot);
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartAreaPlotPane.TITLE;
}
}

96
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.area;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground;
import com.fr.plugin.chart.base.AttrDataSheet;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.other.condition.item.VanChartAreaFillColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLineTypeConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartMarkerConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane;
import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint;
import com.fr.plugin.chart.scatter.large.VanChartLargeModelMarkerConditionPane;
import java.awt.*;
/**
* Created by Mitisky on 15/11/18.
*/
public class VanChartAreaConditionPane extends DataSeriesConditionPane {
private static final long serialVersionUID = -7180705321732069806L;
public VanChartAreaConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this));
classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot));
classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
//是否使用数据表
if (plot.getDataSheet().isVisible()) {
classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot));
}
if(PlotFactory.largeDataModel(plot)){
classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this));
} else {
classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getAreaPlotDefaultEffect()));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
}
}
protected void addStyleAction() {
}
@Override
protected ChartConditionPane createListConditionPane() {
return new ChartConditionPane(){
@Override
public String[] columns2Populate() {
return new String[]{
ChartConstants.CATEGORY_INDEX,
ChartConstants.CATEGORY_NAME,
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
ChartConstants.VALUE,
VanChartMultiCategoryDataPoint.CATEGORY_ARRAY,
};
}
};
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartAreaPlot.class;
}
}

95
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java

@ -0,0 +1,95 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/11/18.
*/
public class VanChartAreaPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewArea");
private static final long serialVersionUID = -8161581682558781651L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/area/images/area.png",
"/com/fr/plugin/chart/area/images/stack.png",
"/com/fr/plugin/chart/area/images/percentStack.png",
"/com/fr/plugin/chart/area/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String area = Inter.getLocText("FR-Chart-Type_Area");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
area,
stack + area,
percent + stack + area,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewArea");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartAreaPlot) {
lastTypeIndex = ((VanChartAreaPlot) plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartAreaPlot newPlot = null;
Chart[] areaChart = AreaIndependentVanChart.AreaVanChartTypes;
for(int i = 0, len = areaChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartAreaPlot)areaChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In AreaChart");
}
return cloned;
}
public Chart getDefaultChart() {
return AreaIndependentVanChart.AreaVanChartTypes[0];
}
}

51
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java

@ -0,0 +1,51 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.column.VanChartCustomStackAndAxisConditionPane;
import com.fr.plugin.chart.line.VanChartLineSeriesPane;
import javax.swing.*;
import java.awt.*;
public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{
private static final long serialVersionUID = 5497989595104913025L;
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){
super(parent, plot);
}
protected JPanel getContentInPlotType(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createStylePane()},
new Component[]{stylePane == null ? null : new JSeparator()},
new Component[]{createLineTypePane()},
new Component[]{new JSeparator()},
new Component[]{createMarkerPane()},
new Component[]{new JSeparator()},
new Component[]{createAreaFillColorPane()},
new Component[]{new JSeparator()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{new JSeparator()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomStackAndAxisConditionPane.class;
}
}

BIN
designer_chart/src/com/fr/plugin/chart/area/images/area.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer_chart/src/com/fr/plugin/chart/area/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
designer_chart/src/com/fr/plugin/chart/area/images/percentStack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

BIN
designer_chart/src/com/fr/plugin/chart/area/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

56
designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java

@ -0,0 +1,56 @@
package com.fr.plugin.chart.bar;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.column.VanChartColumnConditionPane;
import com.fr.plugin.chart.column.VanChartColumnSeriesPane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/10/20.
*/
public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bar.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartBarPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartColumnConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartColumnSeriesPane(parent, plot);
}
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartBarStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane();
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartBarPlotPane.TITLE;
}
}

96
designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.bar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/10/20.
*/
public class VanChartBarPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBar");
private static final long serialVersionUID = 2879689884048643002L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/bar/images/bar.png",
"/com/fr/plugin/chart/bar/images/stack.png",
"/com/fr/plugin/chart/bar/images/percentstack.png",
"/com/fr/plugin/chart/bar/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String bar = Inter.getLocText("FR-Chart-Type_Bar");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewBar");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartColumnPlot) {
lastTypeIndex = ((VanChartColumnPlot)plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] barChart = BarIndependentVanChart.BarVanChartTypes;
for(int i = 0, len = barChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartColumnPlot)barChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ColumnChart");
}
return cloned;
}
public Chart getDefaultChart() {
return BarIndependentVanChart.BarVanChartTypes[0];
}
}

23
designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java

@ -0,0 +1,23 @@
package com.fr.plugin.chart.bar;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.axis.bar.VanChartBarAxisPane;
import java.util.List;
/**
* Created by Mitisky on 16/6/8.
*/
public class VanChartBarStylePane extends VanChartStylePane {
public VanChartBarStylePane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected void createVanChartAxisPane(List<BasicPane> paneList, VanChartAxisPlot plot) {
paneList.add(new VanChartBarAxisPane(plot, VanChartBarStylePane.this));
}
}

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/bar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/percentstack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

85
designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java

@ -0,0 +1,85 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI;
/**
* Created by Mitisky on 16/3/31.
*/
public class BubbleIndependentVanChartInterface extends AbstractIndependentVanChartUI {
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartBubblePlotPane();
}
/**
* 图标路径
*
* @return 图标路径
*/
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bubble.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartBubbleSeriesPane(parent, plot);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
if(((VanChartBubblePlot) plot).isForceBubble()){
return super.getTableDataSourcePane(plot, parent);
}
return new VanChartBubblePlotTableDataContentPane(parent);
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){
if(((VanChartBubblePlot) plot).isForceBubble()){
return super.getReportDataSourcePane(plot, parent);
}
return new BubblePlotReportDataContentPane(parent);
}
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartBubbleInteractivePane();
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartBubbleConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartBubblePlotPane.TITLE;
}
}

94
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java

@ -0,0 +1,94 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.other.condition.item.VanChartBubbleSetConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip;
import com.fr.plugin.chart.scatter.component.label.VanChartScatterLabelConditionPane;
import com.fr.plugin.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleConditionPane extends DataSeriesConditionPane {
private static final long serialVersionUID = -7180705321732069806L;
public VanChartBubbleConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
private boolean forceBubble() {
return plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble();
}
@Override
protected ChartConditionPane createListConditionPane() {
return forceBubble() ? new ChartConditionPane() : new VanChartBubbleConditionSelectionPane();
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(VanChartAttrBubble.class, new VanChartBubbleSetConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
if(forceBubble()){
addForceAction();
} else if(PlotFactory.largeDataModel(plot)){
addLargeAction();
} else {
addNormalAction();
}
}
private void addNormalAction() {
classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot));
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect()));
}
private void addForceAction() {
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect()));
}
private void addLargeAction() {
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot));
}
protected void addStyleAction() {
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartBubblePlot.class;
}
}

22
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java

@ -0,0 +1,22 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.ChartConstants;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.plugin.chart.scatter.VanChartScatterDataPoint;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleConditionSelectionPane extends ChartConditionPane {
public String[] columns2Populate() {
return new String[]{
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
VanChartScatterDataPoint.X,
VanChartScatterDataPoint.Y,
ChartConstants.VALUE
};
}
}

27
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java

@ -0,0 +1,27 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithOutSort;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort {
protected String[] getNameArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{Inter.getLocText("Plugin-ChartF_XYAxis"), Inter.getLocText("Chart-Use_None")};
}
return super.getNameArray();
}
protected String[] getValueArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
return super.getValueArray();
}
}

171
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java

@ -0,0 +1,171 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.vanchart.VanChart;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBubble");;
private static final long serialVersionUID = -3481633368542654247L;
private static final float FORCE_ALPHA = 1.0f;
private static final float ALPHA = 0.7f;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/bubble/images/bubble.png",
"/com/fr/plugin/chart/bubble/images/force.png"
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Inter.getLocText("FR-Chart-Chart_BubbleChart"),
Inter.getLocText("Plugin-ChartF_NewForceBubble")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewBubble");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot)plot).isForceBubble()){
lastTypeIndex = BubblePlotType.FORCE.ordinal();
} else {
lastTypeIndex = BubblePlotType.NORMAL.ordinal();
}
typeDemo.get(lastTypeIndex).isPressing = true;
checkDemosBackground();
}
private void removeDefaultAttr(ConditionAttr conditionAttr, Class <? extends DataSeriesCondition> targetClass) {
DataSeriesCondition attr = conditionAttr.getExisted(targetClass);
if (attr != null){
conditionAttr.remove(targetClass);
}
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartBubblePlot newPlot = null;
Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes;
for(int i = 0, len = bubbleChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In BubbleChart");
}
return cloned;
}
public Chart getDefaultChart() {
return BubbleIndependentVanChart.BubbleVanChartTypes[0];
}
@Override
/**
* 力學氣泡圖切換到其他氣泡圖時刪除條件屬性
* 并且将bubbleAttr属性重置
*/
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot);
}
@Override
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
if (oldPlot.getConditionCollection() != null) {
ConditionCollection newCondition = new ConditionCollection();
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone());
newPlot.setConditionCollection(newCondition);
ConditionAttr attrList = newCondition.getDefaultAttr();
//根据气泡图类型,重设透明度属性
removeDefaultAttr(attrList, AttrAlpha.class);
//删除标签属性(防止切换到大数据气泡图标签属性会拷贝过去)
removeDefaultAttr(attrList, ScatterAttrLabel.class);
AttrAlpha attrAlpha = new AttrAlpha();
attrAlpha.setAlpha(((VanChartBubblePlot)newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA);
attrList.addDataSeriesCondition(attrAlpha);
}
}
@Override
protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
if(oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot){
if(((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()){
super.cloneHotHyperLink(oldPlot, newPlot);
}
}
}
@Override
protected VanChartTools createVanChartTools() {
VanChartTools tools = new VanChartTools();
tools.setSort(false);
return tools;
}
/**
* 气泡图相同图表类型之间切换的时候chart的部分属性也需要重置
* @param chart
*/
@Override
protected void resetChartAttr4SamePlot(Chart chart){
VanChartZoom vanChartZoom = new VanChartZoom();
((VanChart)chart).setVanChartZoom(vanChartZoom);
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart);
}
}

92
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java

@ -0,0 +1,92 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.Inter;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.bubble.component.VanChartBubblePane;
import com.fr.plugin.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.plugin.chart.designer.style.series.VanChartCustomStackAndAxisEditPane;
import javax.swing.*;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L;
private VanChartBubblePane bubblePane;
public VanChartBubbleSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createBubblePane()},
new Component[]{new JSeparator()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createAlphaPane()},
new Component[]{new JSeparator()},
new Component[]{createLargeDataModelPane()}
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
@Override
//堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartCustomStackAndAxisEditPane(){
@Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class;
}
@Override
protected String getPaneTitle(){
return Inter.getLocText("Plugin-ChartF_Custom_Axis");
}
};
return stackAndAxisEditPane;
}
private JPanel createBubblePane() {
bubblePane = new VanChartBubblePane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Bubble"), bubblePane);
}
protected void populateCondition(ConditionAttr defaultAttr){
super.populateCondition(defaultAttr);
if(bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
protected void updateCondition(ConditionAttr defaultAttr){
super.updateCondition(defaultAttr);
if(bubblePane != null){
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
if (attrBubble != null) {
defaultAttr.remove(attrBubble);
}
defaultAttr.addDataSeriesCondition(bubblePane.updateBean());
}
}
}

57
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java

@ -0,0 +1,57 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleAreaPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleLabelPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleTooltipPane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaPane;
import com.fr.plugin.chart.scatter.component.VanChartScatterStylePane;
import java.util.List;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleStylePane extends VanChartScatterStylePane {
public VanChartBubbleStylePane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected void createVanChartLabelPane(List<BasicPane> paneList) {
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){
paneList.add(new VanChartForceBubbleLabelPane(VanChartBubbleStylePane.this));
} else {
super.createVanChartLabelPane(paneList);
}
}
protected void addVanChartTooltipPane(List<BasicPane> paneList){
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){
paneList.add(new VanChartForceBubbleTooltipPane(VanChartBubbleStylePane.this));
} else {
super.addVanChartTooltipPane(paneList);
}
}
@Override
protected void addVanChartAreaPane(List<BasicPane> paneList) {
if (((VanChartBubblePlot)getChart().getPlot()).isForceBubble()){
paneList.add(new VanChartForceBubbleAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this));
}else {
paneList.add(new VanChartAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this));
}
}
@Override
protected ChartSeriesPane createChartSeriesPane() {
return new ChartSeriesPane(VanChartBubbleStylePane.this);
}
}

74
designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java

@ -0,0 +1,74 @@
package com.fr.plugin.chart.bubble.component;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import javax.swing.*;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
* 气泡大小等设置界面
*/
public class VanChartBubblePane extends BasicBeanPane<VanChartAttrBubble> {
private UISpinner minDiameter;
private UISpinner maxDiameter;
private UIButtonGroup<Integer> shadow;
private UIButtonGroup<Integer> displayNegative;
public VanChartBubblePane(){
minDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
maxDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
shadow = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Open"),
Inter.getLocText("Plugin-ChartF_Close")});
displayNegative = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Open"),
Inter.getLocText("Plugin-ChartF_Close")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p};
double[] col = {p, f};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MinDiameter")), minDiameter},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MaxDiameter")), maxDiameter},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DisplayNegative")), displayNegative},
};
JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout());
this.add(content, BorderLayout.CENTER);
}
public void populateBean(VanChartAttrBubble bubble) {
if(bubble == null){
bubble = new VanChartAttrBubble();
}
minDiameter.setValue(bubble.getMinDiameter());
maxDiameter.setValue(bubble.getMaxDiameter());
shadow.setSelectedIndex(bubble.isShadow() ? 0 : 1);
displayNegative.setSelectedIndex(bubble.isDisplayNegative() ? 0 : 1);
}
public VanChartAttrBubble updateBean() {
VanChartAttrBubble bubble = new VanChartAttrBubble();
bubble.setMinDiameter(minDiameter.getValue());
bubble.setMaxDiameter(maxDiameter.getValue());
bubble.setShadow(shadow.getSelectedIndex() == 0);
bubble.setDisplayNegative(displayNegative.getSelectedIndex() == 0);
return bubble;
}
@Override
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_Bubble");
}
}

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

@ -0,0 +1,184 @@
package com.fr.plugin.chart.bubble.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.ChartConstants;
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;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.util.List;
public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane {
private static final Dimension PREFERRED_SIZE = new Dimension(100, 20);
protected UIComboBox seriesName;
protected UIComboBox xCombox;
protected UIComboBox yCombox;
protected UIComboBox bubbleSize;
private ChartDataFilterPane dataScreeningPane;
public VanChartBubblePlotTableDataContentPane(ChartDataPane parent) {
seriesName = new UIComboBox();
xCombox = new UIComboBox();
yCombox = new UIComboBox();
dataScreeningPane = new ChartDataFilterPane(new BubblePlot(), parent);
seriesName.setPreferredSize(PREFERRED_SIZE);
xCombox.setPreferredSize(PREFERRED_SIZE);
yCombox.setPreferredSize(PREFERRED_SIZE);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
initBubbleSize();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = { p, p,p,p};
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},
};
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}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
seriesName.addItemListener(tooltipListener);
xCombox.addItemListener(tooltipListener);
yCombox.addItemListener(tooltipListener);
bubbleSize.addItemListener(tooltipListener);
}
protected void initBubbleSize() {
bubbleSize = new UIComboBox();
bubbleSize.setPreferredSize(new Dimension(100, 20));
}
/**
* 检查box是否使用, donothing
* @param hasUse 是否使用.
*/
public void checkBoxUse(boolean hasUse) {
}
protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(seriesName, list);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
refreshBoxItems(xCombox, list);
refreshBoxItems(yCombox, list);
refreshBoxItems(bubbleSize, list);
}
/**
* 清空所有的box设置
*/
public void clearAllBoxList(){
clearBoxItems(seriesName);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
clearBoxItems(xCombox);
clearBoxItems(yCombox);
clearBoxItems(bubbleSize);
}
@Override
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if (!(top instanceof BubbleTableDefinition)) {
return;
}
BubbleTableDefinition definition = (BubbleTableDefinition) top;
if(definition.getSeriesName() == null || ComparatorUtils.equals(StringUtils.EMPTY, definition.getSeriesName())) {
seriesName.setSelectedItem(Inter.getLocText("Chart-Use_None"));
} else {
combineCustomEditValue(seriesName, definition.getSeriesName());
}
combineCustomEditValue(xCombox, definition.getBubbleX());
combineCustomEditValue(yCombox, definition.getBubbleY());
//气泡图不配置“无”
populateBubbleSize(definition);
dataScreeningPane.populateBean(collection);
}
protected void populateBubbleSize(BubbleTableDefinition definition) {
if (ComparatorUtils.equals(definition.getBubbleSize(), Inter.getLocText("Chart-Use_None"))){
combineCustomEditValue(bubbleSize, StringUtils.EMPTY);
}else {
combineCustomEditValue(bubbleSize, definition.getBubbleSize());
}
}
@Override
public void updateBean(ChartCollection collection) {
BubbleTableDefinition definition = new BubbleTableDefinition();
collection.getSelectedChart().setFilterDefinition(definition);
Object resultName = seriesName.getSelectedItem();
Object resultX = xCombox.getSelectedItem();
Object resultY = yCombox.getSelectedItem();
Object resultSize = bubbleSize.getSelectedItem();
if(resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) {
definition.setSeriesName(StringUtils.EMPTY);
} else {
definition.setSeriesName(resultName.toString());
}
if (resultX != null) {
definition.setBubbleX(resultX.toString());
}
if (resultY != null) {
definition.setBubbleY(resultY.toString());
}
if (resultSize != null) {
definition.setBubbleSize(resultSize.toString());
}
dataScreeningPane.updateBean(collection);
}
/**
* 重新布局
*/
public void redoLayoutPane(){
dataScreeningPane.relayoutPane(this.isNeedSummaryCaculateMethod());
}
}

28
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java

@ -0,0 +1,28 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane;
import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane;
import com.fr.plugin.chart.scatter.VanChartScatterRefreshTooltipContentPane;
/**
* Created by mengao on 2017/6/12.
*/
public class VanChartBubbleRefreshTooltipPane extends VanChartPlotRefreshTooltipPane {
public VanChartBubbleRefreshTooltipPane(Plot plot) {
super(plot);
}
@Override
protected VanChartTooltipContentPane getTooltipContentPane(Plot plot){
if (((VanChartBubblePlot)plot).isForceBubble()) {
return new VanChartRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this);
} else {
return new VanChartScatterRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this);
}
}
}

23
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java

@ -0,0 +1,23 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaBackgroundPane;
import java.awt.*;
//图表区|绘图区 边框和背景
public class VanChartForceBubbleAreaBackgroundPane extends VanChartAreaBackgroundPane {
public VanChartForceBubbleAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) {
super(isPlot, parent);
}
@Override
protected Component[][] initComponents() {
return new Component[][]{
new Component[]{chartBorderPane},
new Component[]{chartBackgroundPane},
};
}
}

26
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java

@ -0,0 +1,26 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaPane;
/**
* 属性表, 图表样式-背景界面.
*/
public class VanChartForceBubbleAreaPane extends VanChartAreaPane {
public VanChartForceBubbleAreaPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
@Override
protected void initPlotPane(boolean b, AbstractAttrNoScrollPane parent) {
plotPane = new VanChartForceBubbleAreaBackgroundPane(true, parent);
}
}

19
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java

@ -0,0 +1,19 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.label.VanChartLabelPane;
import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartForceBubbleLabelPane extends VanChartLabelPane {
public VanChartForceBubbleLabelPane(VanChartStylePane parent) {
super(parent);
}
protected VanChartPlotLabelPane getLabelPane(Plot plot) {
return new VanChartPlotLabelPane(plot, parent);
}
}

18
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java

@ -0,0 +1,18 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartTooltipPane;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartForceBubbleTooltipPane extends VanChartTooltipPane {
public VanChartForceBubbleTooltipPane(VanChartStylePane parent) {
super(parent);
}
protected VanChartPlotTooltipPane getTooltipPane(Plot plot) {
return new VanChartPlotTooltipPane(plot, parent);
}
}

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/bubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/force.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/large.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

43
designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java

@ -0,0 +1,43 @@
package com.fr.plugin.chart.column;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import java.awt.*;
/**
* Created by hufan on 2016/8/11.
*/
public class ColumnBorderAttriPane extends BorderAttriPane {
private UISpinner radius;
public ColumnBorderAttriPane() {
this(Inter.getLocText("plugin-ChartF_Radius"));
}
public ColumnBorderAttriPane(String radiusString) {
this.add(new UILabel(radiusString + ":"));
radius = new UISpinner(0,1000,1,0);
this.add(radius);
radius.setPreferredSize(new Dimension(60, 18));
}
public void setRadius(int value) {
this.radius.setValue(value);
}
public double getRadius() {
return this.radius.getValue();
}
@Override
protected String title4PopupWindow() {
return "Border";
}
}

36
designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java

@ -0,0 +1,36 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/9/24.
*/
public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/column.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartColumnPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartColumnConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartColumnSeriesPane(parent, plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartColumnPlotPane.TITLE;
}
}

93
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java

@ -0,0 +1,93 @@
package com.fr.plugin.chart.column;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrDataSheet;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrFloatColor;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartFloatColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesImageBackgroundConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane;
import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint;
import java.awt.*;
/**
* Created by Mitisky on 15/9/28.
*/
public class VanChartColumnConditionPane extends DataSeriesConditionPane{
private static final long serialVersionUID = -7180705321732069806L;
public VanChartColumnConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this));
classPaneMap.put(AttrSeriesImageBackground.class, new VanChartSeriesImageBackgroundConditionPane(this));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getColumnPlotDefaultEffect()));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
//是否使用数据表
//自定义柱形图设置多X坐标轴时,不支持数据表
if (plot.getDataSheet().isVisible() && ((VanChartColumnPlot) plot).getXAxisList().size() == 1) {
classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot));
}
}
protected void addStyleAction() {
}
@Override
protected ChartConditionPane createListConditionPane() {
return new ChartConditionPane(){
@Override
public String[] columns2Populate() {
return new String[]{
ChartConstants.CATEGORY_INDEX,
ChartConstants.CATEGORY_NAME,
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
ChartConstants.VALUE,
VanChartMultiCategoryDataPoint.CATEGORY_ARRAY,
};
}
};
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartColumnPlot.class;
}
}

34
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java

@ -0,0 +1,34 @@
package com.fr.plugin.chart.column;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.chart.series.SeriesCondition.LabelBorderPane;
import com.fr.design.condition.ConditionAttributesPane;
/**
* Created by hufan on 2016/8/11.
*/
public class VanChartColumnLabelBorderPane extends LabelBorderPane {
public VanChartColumnLabelBorderPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
}
@Override
protected BorderAttriPane initBorderAttrPane(){
return new ColumnBorderAttriPane();
}
public void populate(DataSeriesCondition condition) {
super.populate(condition);
if (condition instanceof AttrBorder) {
((ColumnBorderAttriPane)linePane).setRadius(attrBorder.getRoundRadius());
}
}
public DataSeriesCondition update() {
super.update();
attrBorder.setRoundRadius((int) ((ColumnBorderAttriPane)linePane).getRadius());
attrBorder.setRoundBorder(true);
return attrBorder;
}
}

96
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/9/24.
*/
public class VanChartColumnPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewColumn");
private static final long serialVersionUID = 5950923001789733745L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/column/images/column.png",
"/com/fr/plugin/chart/column/images/stack.png",
"/com/fr/plugin/chart/column/images/percentstack.png",
"/com/fr/plugin/chart/column/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String column = Inter.getLocText("FR-Chart-Type_Column");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
column,
stack + column,
percent + stack + column,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewColumn");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartColumnPlot) {
lastTypeIndex = ((VanChartColumnPlot)plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] columnChart = ColumnIndependentVanChart.ColumnVanChartTypes;
for(int i = 0, len = columnChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartColumnPlot)columnChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ColumnChart");
}
return cloned;
}
public Chart getDefaultChart() {
return ColumnIndependentVanChart.ColumnVanChartTypes[0];
}
}

194
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java

@ -0,0 +1,194 @@
package com.fr.plugin.chart.column;
import com.fr.base.background.ImageBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.border.VanChartBorderPane;
import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 新条形图系列界面
*/
public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = -8875943419420081420L;
private UIButtonGroup<Integer> isFixedWidth;//是否固定宽度
private UISpinner columnWidth;//宽度
private UINumberDragPane categoryGap;//分类间隔
private UINumberDragPane seriesGap;//系列间隔
private UIButtonGroup<Integer> isFillWithImage;//是否使用图片填充
private ImageBackgroundQuickPane imagePane;//填充图片选择界面
public VanChartColumnSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createStylePane()},
new Component[]{stylePane == null ? null : new JSeparator()},
new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{p,f})},
new Component[]{new JSeparator()},
new Component[]{createBorderPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return contentPane;
}
//边框(有圆角)
protected VanChartBorderPane createDiffBorderPane() {
return new VanChartBorderWithRadiusPane();
}
private JPanel createSeriesStylePane(double[] row, double[] col) {
isFixedWidth = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
columnWidth = new UISpinner(0,1000,1,0);
seriesGap = new UINumberDragPane(-100, 100);
categoryGap = new UINumberDragPane(0, 100);
isFillWithImage = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
imagePane = new ImageBackgroundQuickPane(false);
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Fixed_Column_Width")),isFixedWidth},
new Component[]{null,columnWidth},
};
JPanel panel1 = TableLayoutHelper.createTableLayoutPane(components1, row, col);
Component[][] components2 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Series")),seriesGap},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Category")),categoryGap},
};
JPanel panel2 = TableLayoutHelper.createTableLayoutPane(components2, row, col);
Component[][] components3 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Filled_With_Image")),isFillWithImage},
};
JPanel panel3 = TableLayoutHelper.createTableLayoutPane(components3, row, col);
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(panel1, BorderLayout.NORTH);
panel.add(panel2, BorderLayout.CENTER);
panel.add(panel3, BorderLayout.SOUTH);
JPanel borderPane = new JPanel(new BorderLayout());
borderPane.add(panel, BorderLayout.NORTH);
borderPane.add(imagePane, BorderLayout.CENTER);
isFixedWidth.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkColumnWidth();
}
});
isFillWithImage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkImagePane();
}
});
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), borderPane);
}
private void checkAll() {
checkColumnWidth();
checkImagePane();
}
private void checkColumnWidth() {
columnWidth.setEnabled(isFixedWidth.getSelectedIndex() == 0);
}
private void checkImagePane() {
GUICoreUtils.setEnabled(imagePane, isFillWithImage.getSelectedIndex() == 0);
}
public void populateBean(Plot plot) {
if(plot == null) {
return;
}
super.populateBean(plot);
if(plot instanceof VanChartColumnPlot){
VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot;
isFixedWidth.setSelectedIndex(columnPlot4VanChart.isFixedWidth() ? 0 : 1);
columnWidth.setValue(columnPlot4VanChart.getColumnWidth());
categoryGap.populateBean(columnPlot4VanChart.getCategoryIntervalPercent());
seriesGap.populateBean(columnPlot4VanChart.getSeriesOverlapPercent());
isFillWithImage.setSelectedIndex(columnPlot4VanChart.isFilledWithImage() ? 0 : 1);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
if(columnPlot4VanChart.isFilledWithImage()){
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground != null){
imagePane.populateBean(attrSeriesImageBackground.getSeriesBackground());
}
}
}
checkAll();
}
public void updateBean(Plot plot) {
if(plot == null) {
return;
}
super.updateBean(plot);
if(plot instanceof VanChartColumnPlot){
VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot;
columnPlot4VanChart.setFixedWidth(isFixedWidth.getSelectedIndex() == 0);
columnPlot4VanChart.setColumnWidth((int)columnWidth.getValue());
columnPlot4VanChart.setCategoryIntervalPercent(categoryGap.updateBean());
columnPlot4VanChart.setSeriesOverlapPercent(seriesGap.updateBean());
columnPlot4VanChart.setFilledWithImage(isFillWithImage.getSelectedIndex() == 0);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
if(isFillWithImage.getSelectedIndex() == 0){
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground == null){
attrSeriesImageBackground = new AttrSeriesImageBackground();
defaultAttr.addDataSeriesCondition(attrSeriesImageBackground);
}
attrSeriesImageBackground.setSeriesBackground(imagePane.updateBean());
//设置背景图片平铺方式
ImageBackground imageBackground = (ImageBackground) attrSeriesImageBackground.getSeriesBackground();
if (imageBackground != null){
imageBackground.setLayout(Constants.IMAGE_TILED);
}
} else {
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground != null){
defaultAttr.remove(attrSeriesImageBackground);
}
}
}
}
}

143
designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java

@ -0,0 +1,143 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.data.condition.AbstractCondition;
import com.fr.data.condition.ListCondition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.LiteConditionPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.AttrSeriesStackAndAxis;
import com.fr.plugin.chart.designer.style.series.VanChartSeriesConditionPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 堆积和坐标轴设置
*/
public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane<ConditionAttr> {
private static final long serialVersionUID = 2713124322060048526L;
protected UIButtonGroup<Integer> XAxis;
protected UIButtonGroup<Integer> YAxis;
protected UIButtonGroup<Integer> isStacked;
protected UIButtonGroup<Integer> isPercentStacked;
private LiteConditionPane liteConditionPane;
public VanChartCustomStackAndAxisConditionPane(){
}
private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//配置界面
JPanel deployPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(deployPane);
deployPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_Deploy") + ":", null));
deployPane.add(createDeployPane());
//条件界面
JPanel conditionPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(conditionPane);
conditionPane.setBorder(BorderFactory.createEmptyBorder());
conditionPane.add(liteConditionPane = new VanChartSeriesConditionPane());
liteConditionPane.setPreferredSize(new Dimension(300, 300));
}
private JPanel createDeployPane()
{
isStacked = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
isPercentStacked = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
double p = TableLayout.PREFERRED;
double[] columnSize = {p,p};
double[] rowSize = {p,p,p,p};
return TableLayoutHelper.createTableLayoutPane(getDeployComponents(), rowSize, columnSize);
}
protected Component[][] getDeployComponents() {
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("ChartF-X_Axis")),XAxis},
new Component[]{new UILabel(Inter.getLocText("ChartF-Y_Axis")),YAxis},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Type_Stacked")),isStacked},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_PercentStacked")),isPercentStacked},
};
isStacked.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkBox();
}
});
return components;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_StackAndSeries");
}
private void checkBox() {
isPercentStacked.setEnabled(isStacked.getSelectedIndex() == 0);
}
public void populateBean(ConditionAttr conditionAttr){
AttrSeriesStackAndAxis seriesStackAndAxis = (AttrSeriesStackAndAxis)conditionAttr.getExisted(AttrSeriesStackAndAxis.class);
XAxis = new UIButtonGroup<Integer>(seriesStackAndAxis.getXAxisNamesArray());
YAxis = new UIButtonGroup<Integer>(seriesStackAndAxis.getYAxisNameArray());
doLayoutPane();
XAxis.setSelectedIndex(seriesStackAndAxis.getXAxisIndex());
YAxis.setSelectedIndex(seriesStackAndAxis.getYAxisIndex());
isStacked.setSelectedIndex(seriesStackAndAxis.isStacked() ? 0 : 1);
isPercentStacked.setSelectedIndex(seriesStackAndAxis.isPercentStacked() ? 0 : 1);
if (conditionAttr.getCondition() == null) {
this.liteConditionPane.populateBean(new ListCondition());
} else {
this.liteConditionPane.populateBean(conditionAttr.getCondition());
}
checkBox();
}
public void updateBean(ConditionAttr conditionAttr){
AttrSeriesStackAndAxis seriesStackAndAxis = (AttrSeriesStackAndAxis)conditionAttr.getExisted(AttrSeriesStackAndAxis.class);
seriesStackAndAxis.setXAxisIndex(XAxis.getSelectedIndex());
seriesStackAndAxis.setYAxisIndex(YAxis.getSelectedIndex());
updateStackAndPercent(seriesStackAndAxis);
AbstractCondition con = (AbstractCondition) this.liteConditionPane.updateBean();
conditionAttr.setCondition(con);
}
protected void updateStackAndPercent(AttrSeriesStackAndAxis seriesStackAndAxis) {
seriesStackAndAxis.setStacked(isStacked.getSelectedIndex() == 0);
if(seriesStackAndAxis.isStacked()){
seriesStackAndAxis.setPercentStacked(isPercentStacked.getSelectedIndex() == 0);
} else {
seriesStackAndAxis.setPercentStacked(false);
}
}
public ConditionAttr updateBean(){
ConditionAttr conditionAttr = new ConditionAttr();
updateBean(conditionAttr);
return conditionAttr;
}
}

BIN
designer_chart/src/com/fr/plugin/chart/column/images/column.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/percentstack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

56
designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java

@ -0,0 +1,56 @@
package com.fr.plugin.chart.custom;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.custom.other.VanChartCustomOtherPane;
import com.fr.plugin.chart.custom.style.VanChartCustomStylePane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI;
/**
* Created by Mitisky on 16/2/16.
*/
public class CustomIndependentVanChartInterface extends AbstractIndependentVanChartUI {
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartCustomPlotPane();
}
/**
* 图标路径
*
* @return 图标路径
*/
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/custom.png";
}
@Override
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartCustomStylePane(listener);
VanChartOtherPane otherPane = new VanChartCustomOtherPane();
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new VanChartCustomDataPane(listener);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartCustomPlotPane.TITLE;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save