Browse Source

Merge pull request #1144 in DESIGN/design from ~ZHENG/c-design:refactor/19.4.3 to refactor/19.4.3

* commit '9ce28c7b1cdefa8707cb944ad84c9ca7e85c4ae6':
  大数据模式 reset一些属性
  CHART-10225 属性兼容:大数据相关
  CHART-10225 折现线型 配置界面
research/11.0
zheng 5 years ago
parent
commit
df522cd65f
  1. 7
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java
  2. 12
      designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java
  3. 23
      designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java
  4. 28
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java
  5. 121
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  6. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java
  7. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  8. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java
  9. 213
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  10. 199
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  11. 38
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  12. 18
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java
  13. 9
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  14. 159
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java
  15. 27
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java
  16. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java
  17. 18
      designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java
  18. 22
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java
  19. 9
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java
  20. 18
      designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

7
designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java

@ -15,15 +15,15 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
private static final long serialVersionUID = 5497989595104913025L;
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType(){
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p};
double[] row = {p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
@ -32,7 +32,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
new Component[]{createMarkerPane()},
new Component[]{createAreaFillColorPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

12
designer-chart/src/main/java/com/fr/van/chart/bar/BarIndependentVanChartInterface.java

@ -60,19 +60,20 @@ public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanCha
return new VanChartBarPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartColumnConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartColumnSeriesPane(parent, plot);
}
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBarStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
@ -82,6 +83,11 @@ public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanCha
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};

23
designer-chart/src/main/java/com/fr/van/chart/bubble/BubbleIndependentVanChartInterface.java

@ -65,22 +65,23 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bubble.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
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()){
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()){
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
if (((VanChartBubblePlot) plot).isForceBubble()) {
return super.getReportDataSourcePane(plot, parent);
}
return new BubblePlotReportDataContentPane(parent);
@ -88,24 +89,30 @@ public class BubbleIndependentVanChartInterface extends AbstractIndependentVanCh
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort() {
@Override
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartBubbleConditionPane(plot);
}
}

28
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleSeriesPane.java

@ -6,8 +6,6 @@ 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.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.van.chart.bubble.component.VanChartBubblePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
@ -44,35 +42,31 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{null}
};
if (!((VanChartBubblePlot)plot).isForceBubble()) {
components[3] = new Component[]{createLargeDataModelPane()};
}
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
//设置色彩面板内容
@Override
protected void setColorPaneContent (JPanel panel) {
protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER);
}
@Override
//堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(){
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane() {
@Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class;
}
@Override
public String getPaneTitle(){
public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
}
};
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
return stackAndAxisEditExpandablePane;
}
@ -81,18 +75,18 @@ public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bubble"), bubblePane);
}
protected void populateCondition(ConditionAttr defaultAttr){
super.populateCondition(defaultAttr);
if(bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
protected void populateCondition(ConditionAttr defaultAttr) {
super.populateCondition(defaultAttr);
if (bubblePane != null) {
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
protected void updateCondition(ConditionAttr defaultAttr){
protected void updateCondition(ConditionAttr defaultAttr) {
super.updateCondition(defaultAttr);
if(bubblePane != null){
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
if (bubblePane != null) {
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
if (attrBubble != null) {
defaultAttr.remove(attrBubble);
}

121
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -7,7 +7,6 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.style.FormatPane;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.VanChartColumnPlot;
@ -86,14 +85,15 @@ public class PlotFactory {
autoAdjustLabelPlots.add(VanChartStructurePlot.class);
}
public static boolean plotAutoAdjustLabelPosition(Plot plot){
public static boolean plotAutoAdjustLabelPosition(Plot plot) {
return autoAdjustLabelPlots.contains(plot.getClass());
}
/**
*
* 标签Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>>();
static {
labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class);
labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class);
@ -104,6 +104,7 @@ public class PlotFactory {
* 图例Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>> legendMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotLegendPane>>();
static {
legendMap.put(VanChartGaugePlot.class, VanLegendPaneWidthOutHighlight.class);
legendMap.put(VanChartMultiPiePlot.class, VanLegendPaneWidthOutHighlight.class);
@ -119,6 +120,7 @@ public class PlotFactory {
* 数据点提示Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> toolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static {
toolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotTooltipPane.class);
toolTipMap.put(VanChartScatterPlot.class, VanChartScatterPlotTooltipPane.class);
@ -156,18 +158,19 @@ public class PlotFactory {
}
/**
* 监控刷新 自动数据点提示Map
*/
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>> refreshToolTipMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartPlotTooltipPane>>();
static {
refreshToolTipMap.put(VanChartGaugePlot.class, VanChartGaugePlotRefreshTooltipPane.class);
refreshToolTipMap.put(VanChartBubblePlot.class, VanChartBubbleRefreshTooltipPane.class);
}
private static Map<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>> refreshTooltipContentMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>>();
static {
@ -186,18 +189,19 @@ public class PlotFactory {
/**
* 根据图表类型创建标签界面
* @param plot 图表
*
* @param plot 图表
* @param stylePane 样式界面
* @return 标签界面
*/
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass();
if(labelMap.containsKey(key)){
try{
if (labelMap.containsKey(key)) {
try {
Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key);
Constructor<? extends VanChartPlotLabelPane > constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
Constructor<? extends VanChartPlotLabelPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
return constructor.newInstance(plot, stylePane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -206,18 +210,19 @@ public class PlotFactory {
/**
* 根据图表类型创建图例界面
* @param plot 图表
*
* @param plot 图表
* @param stylePane 样式界面
* @return 图例界面
*/
public static VanChartPlotLegendPane createPlotLegendPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass();
if(legendMap.containsKey(key)){
try{
if (legendMap.containsKey(key)) {
try {
Class<? extends VanChartPlotLegendPane> cl = legendMap.get(key);
Constructor<? extends VanChartPlotLegendPane > constructor = cl.getConstructor(VanChartStylePane.class);
Constructor<? extends VanChartPlotLegendPane> constructor = cl.getConstructor(VanChartStylePane.class);
return constructor.newInstance(stylePane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -226,18 +231,19 @@ public class PlotFactory {
/**
* 根据图表类型创建数据点提示界面
* @param plot 图表
*
* @param plot 图表
* @param stylePane 样式界面
* @return 数据点提示界面
*/
public static VanChartPlotTooltipPane createPlotTooltipPane(Plot plot, VanChartStylePane stylePane) {
public static VanChartPlotTooltipPane createPlotTooltipPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass();
if(toolTipMap.containsKey(key)){
try{
if (toolTipMap.containsKey(key)) {
try {
Class<? extends VanChartPlotTooltipPane> cl = toolTipMap.get(key);
Constructor<? extends VanChartPlotTooltipPane > constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
Constructor<? extends VanChartPlotTooltipPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class);
return constructor.newInstance(plot, stylePane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -246,19 +252,20 @@ public class PlotFactory {
/**
* 根据图表类型创建标签的具体内容界面.分类名系列名等
* @param plot 图表
* @param parent 样式界面
*
* @param plot 图表
* @param parent 样式界面
* @param showOnPane formatpane用到
* @return 标签的具体内容界面
*/
public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){
public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass();
if(labelContentMap.containsKey(key)){
try{
if (labelContentMap.containsKey(key)) {
try {
Class<? extends VanChartTooltipContentPane> cl = labelContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -267,19 +274,20 @@ public class PlotFactory {
/**
* 根据图表类型创建数据点提示的具体内容界面.分类名系列名等
* @param plot 图表
* @param parent 样式界面
*
* @param plot 图表
* @param parent 样式界面
* @param showOnPane formatpane用到
* @return 数据点提示的具体内容界面
*/
public static VanChartTooltipContentPane createPlotTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){
public static VanChartTooltipContentPane createPlotTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass();
if(tooltipContentMap.containsKey(key)){
try{
if (tooltipContentMap.containsKey(key)) {
try {
Class<? extends VanChartTooltipContentPane> cl = tooltipContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
@ -287,56 +295,59 @@ public class PlotFactory {
}
/**
* 根据图表类型创建数据点提示界面
*
* @param plot 图表
* @return 数据点提示界面
*/
public static VanChartPlotTooltipPane createPlotRefreshTooltipPane(Plot plot) {
Class<? extends Plot> key = plot.getClass();
if(refreshToolTipMap.containsKey(key)){
try{
if (refreshToolTipMap.containsKey(key)) {
try {
Class<? extends VanChartPlotTooltipPane> cl = refreshToolTipMap.get(key);
Constructor<? extends VanChartPlotTooltipPane > constructor = cl.getConstructor(Plot.class);
Constructor<? extends VanChartPlotTooltipPane> constructor = cl.getConstructor(Plot.class);
return constructor.newInstance(plot);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new VanChartPlotRefreshTooltipPane(plot);
}
/**
* 根据图表类型创建监控刷新中数据点提示的具体内容界面.分类名系列名等
* @param plot 图表
* @param parent 交互属性界面
*
* @param plot 图表
* @param parent 交互属性界面
* @param showOnPane formatpane用到
* @return 数据点提示的具体内容界面
*/
public static VanChartTooltipContentPane createPlotRefreshTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane){
public static VanChartTooltipContentPane createPlotRefreshTooltipContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) {
Class<? extends Plot> key = plot.getClass();
if(refreshTooltipContentMap.containsKey(key)){
try{
if (refreshTooltipContentMap.containsKey(key)) {
try {
Class<? extends VanChartTooltipContentPane> cl = refreshTooltipContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane > constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane);
} catch (Exception e){
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new VanChartRefreshTooltipContentPane(parent, showOnPane);
}
public static FormatPane createAutoFormatPane(){
FormatPane formatPane = new FormatPane(){
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
public static FormatPane createAutoFormatPane() {
FormatPane formatPane = new FormatPane() {
protected Component[][] getComponent(JPanel fontPane, JPanel centerPane, JPanel typePane) {
typePane.setBorder(BorderFactory.createEmptyBorder());
return new Component[][]{
new Component[]{typePane,null},
new Component[]{typePane, null},
new Component[]{centerPane, null},
};
}
protected UIComboBoxRenderer createComBoxRender(){
protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
@ -361,12 +372,8 @@ public class PlotFactory {
/**
* 判断是否为大数据模式
*/
public static boolean largeDataModel(Plot plot){
return plot != null && plot.getDataProcessor().getMark() == LargeDataModel.MARK;
}
public static boolean lineMapLargeModel(Plot plot){
return plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getLineMapDataProcessor().getMark() == LargeDataModel.MARK;
public static boolean largeDataModel(Plot plot) {
return plot != null && plot.convertDataProcessor().getMark() == LargeDataModel.MARK;
}
}

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/LineTypeComboBox.java

@ -30,7 +30,7 @@ public class LineTypeComboBox extends UIComboBox {
this.setRenderer(new CellRenderer());
}
private class CellRenderer extends UIComboBoxRenderer {
private static class CellRenderer extends UIComboBoxRenderer {
private LineType lineType;

64
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -32,10 +32,11 @@ public class VanChartLineTypePane extends BasicPane {
protected UIButtonGroup<LineStyle> lineStyle;//形态
private UIButtonGroup nullValueBreak;//空值断开
private JPanel lineWidthPane;
public VanChartLineTypePane() {
lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
JPanel typeAndWidthPane = createTypeAndWidthPane();
createLineStyle();
@ -52,14 +53,10 @@ public class VanChartLineTypePane extends BasicPane {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
Component[] lineTypeComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox},
lineWidthComponent = new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)},
lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
Component[] lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak};
Component[][] components = createContentComponent(lineTypeComponent, lineWidthComponent, lineStyleComponent, nullValueBreakComponent);
Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent);
double[] row = new double[components.length];
Arrays.fill(row, p);
@ -67,16 +64,45 @@ public class VanChartLineTypePane extends BasicPane {
JPanel contentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout());
this.setLayout(new BorderLayout(0, 6));
this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(contentPane, BorderLayout.CENTER);
}
private JPanel createTypeAndWidthPane() {
//todo@shinerefactor:当前兼容工作到这边,因为finekit和移动端,暂停
JPanel panel = new JPanel(new BorderLayout(0, 6));
lineTypeComboBox = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.NORMAL, LineType.DASH});
lineWidthSpinner = new UISpinner(0.5, Integer.MAX_VALUE, 0.5, 2);
lineTypeComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLineWidth();
}
});
Component[][] lineTypeComps = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox}
};
Component[][] lineWidthComps = new Component[][]{
new Component[]{
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)}
};
double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] row = {p}, col = {f, e};
JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, row, col);
lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, row, col);
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(lineTypePane, BorderLayout.CENTER);
contentPane.add(lineWidthPane, BorderLayout.SOUTH);
return panel;
return contentPane;
}
protected void createLineStyle() {
@ -85,25 +111,21 @@ public class VanChartLineTypePane extends BasicPane {
lineStyle = new UIButtonGroup<LineStyle>(textArray, LineStyle.values());
}
protected Component[][] createContentComponent(Component[] lineTypeComponent, Component[] lineWidthComponent,
Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
new Component[]{null,null},
lineTypeComponent,
lineWidthComponent,
lineStyleComponent,
nullValueBreakComponent
};
}
private void checkLineWidth() {
if (lineWidthSpinner != null && lineTypeComboBox != null) {
lineWidthSpinner.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE));
if (lineWidthPane != null && lineTypeComboBox != null) {
lineWidthPane.setVisible(!ComparatorUtils.equals(lineTypeComboBox.getSelectedItem(), LineType.NONE));
}
}
public void checkLarge(boolean large){
if(large){
public void checkLarge(boolean large) {
if (large) {
lineTypeComboBox.setSelectedItem(LineType.NONE);
}
lineTypeComboBox.setEnabled(!large);

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineWidthPane.java

@ -9,10 +9,8 @@ public class VanChartLineWidthPane extends VanChartLineTypePane {
private static final long serialVersionUID = 4537158946119294689L;
@Override
protected Component[][] createContentComponent(Component[] lineTypeComponent, Component[] lineWidthComponent, Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
lineTypeComponent,
lineWidthComponent,
nullValueBreakComponent
};
}

213
designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java

@ -2,18 +2,30 @@ package com.fr.van.chart.designer.other;
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.chartx.attr.LargeDataAttribute;
import com.fr.chartx.attr.LargeDataModeType;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.axis.type.AxisPlotType;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.RefreshMoreLabel;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.custom.component.VanChartHyperLinkPane;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
@ -22,7 +34,10 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.zoom.ZoomPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
@ -34,6 +49,10 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected UICheckBox fullScreenDisplay;
protected UIToggleButton collapse;
protected VanChart chart;
private UIComboBox largeDataMode;
private UISpinner largeModeThresholdNumber;
protected UIButtonGroup isChartAnimation;
//坐标轴翻转属性
@ -44,12 +63,12 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private ZoomPane zoomPane;
protected VanChartHyperLinkPane superLink;
protected Chart chart;
private JPanel largeModeThresholdNumberPane;
protected JPanel interactivePane;
/**
* 界面标题.
*
* @return 返回标题.
*/
@ -63,7 +82,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return new JPanel();
}
private void reLayoutContentPane(VanChartPlot plot){
private void reLayoutContentPane(VanChartPlot plot) {
if (interactivePane != null) {
interactivePane.removeAll();
}
@ -71,26 +90,64 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
reloaPane(interactivePane);
}
protected JPanel getInteractivePane(VanChartPlot plot){
protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p,p,p,p,p,p};
double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize),null},
new Component[]{createAnimationPane(),null},
new Component[]{createAxisRotationPane(new double[]{p,p}, columnSize, plot),null},
new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null},
new Component[]{createAutoRefreshPane(plot),null},
new Component[]{createHyperlinkPane(),null}
new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null},
new Component[]{createLargeDataModePane(), null},
new Component[]{createAnimationPane(), null},
new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null},
new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null},
new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
private JPanel createLargeDataModePane() {
if (!isCurrentChartSupportLargeDataMode()) {
return null;
}
largeDataMode = new UIComboBox(new LargeDataModeType[]{LargeDataModeType.CLOSE, LargeDataModeType.OPEN_BEYOND_THRESHOLD});
largeModeThresholdNumber = new UISpinner(0, Integer.MAX_VALUE, 100, chart.getPlot().getLargeDataAttribute().getLargeModeThresholdNumber());
largeDataMode.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkLargeDataMode();
}
});
Component[][] comps1 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataMode}
};
Component[][] comps2 = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Threshold_Number")), largeModeThresholdNumber}
};
double[] row = {TableLayout.PREFERRED}, col = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(TableLayout4VanChartHelper.createGapTableLayoutPane(comps1, row, col), BorderLayout.CENTER);
largeModeThresholdNumberPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps2, row, col);
contentPane.add(largeModeThresholdNumberPane, BorderLayout.SOUTH);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), contentPane);
}
protected boolean isCurrentChartSupportLargeDataMode() {
return false;
}
protected JPanel createZoomPane(double[] row, double[] col, VanChartPlot plot) {
zoomPane = createZoomPane();
if (zoomPane == null) {
@ -103,23 +160,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return null;
}
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot){
if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)){
private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) {
if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)) {
return null;
}
axisRotation = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
Component[][] components = new Component[][]{
new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")),axisRotation}
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation}
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel);
}
protected JPanel createToolBarPane(double[] row, double[] col){
protected JPanel createToolBarPane(double[] row, double[] col) {
isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort"));
exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image"));
fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display"));
@ -131,17 +188,17 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel);
}
protected double[] getToolBarRowSize () {
protected double[] getToolBarRowSize() {
double p = TableLayout.PREFERRED;
return new double[]{p,p,p,p,p};
return new double[]{p, p, p, p, p};
}
protected Component[][] createToolBarComponents() {
return new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")),isSort},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), isSort},
new Component[]{null, exportImages},
new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),collapse},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse},
};
}
@ -149,18 +206,18 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content")), exportImages},
new Component[]{null, fullScreenDisplay},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")),collapse}
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout")), collapse}
};
}
protected JPanel createAnimationPane(){
protected JPanel createAnimationPane() {
isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation_Effects"), isChartAnimation);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel);
}
protected JPanel createAutoRefreshPane(VanChartPlot plot){
protected JPanel createAutoRefreshPane(VanChartPlot plot) {
autoRefreshPane = getMoreLabelPane(plot);
@ -169,7 +226,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot);
return new AutoRefreshPane((VanChart) chart, isLargeModel);
return new AutoRefreshPane(chart, isLargeModel);
}
protected JPanel createHyperlinkPane() {
@ -177,31 +234,69 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink);
}
private void checkLargeDataMode() {
largeModeThresholdNumberPane.setVisible(largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD);
resetAttr();
}
private void resetAttr() {
if (largeDataMode.getSelectedItem() == LargeDataModeType.OPEN_BEYOND_THRESHOLD) {
VanChartPlot plot = this.chart.getPlot();
AttrLabel attrLabel = plot.getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = plot.getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection());
}
}
private void resetCustomCondition(ConditionCollection conditionCollection) {
for (int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++) {
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
if (attrMarker != null && !attrMarker.isCommon()) {
conditionAttr.remove(VanChartAttrMarker.class);
}
}
}
@Override
public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
this.chart = chart;
this.chart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if(interactivePane == null){
if (interactivePane == null) {
this.remove(leftcontentPane);
reLayoutContentPane(plot);
}
if (zoomPane != null) {
zoomPane.populateBean(((VanChart) chart).getZoomAttribute());
zoomPane.populateBean(this.chart.getZoomAttribute());
}
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE){
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
populateChartAxisRotation(plot);
}
populateChartTools((VanChart) chart);
populateChartAnimate(chart, plot);
populateAutoRefresh((VanChart)chart);
populateChartTools(this.chart);
populateLargeMode(plot);
populateChartAnimate(this.chart, plot);
populateAutoRefresh(this.chart);
populateHyperlink(plot);
}
@ -219,12 +314,21 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
collapse.setSelected(vanChartTools.isHidden());
}
private void populateLargeMode(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = plot.getLargeDataAttribute();
largeDataMode.setSelectedItem(attribute.getLargeDataModeType());
largeModeThresholdNumber.setValue(attribute.getLargeModeThresholdNumber());
}
}
private void populateChartAxisRotation(VanChartPlot plot) {
axisRotation.setSelectedIndex(plot.isAxisRotation() ? 0 : 1);
}
private void populateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) {
if (plot.isSupportAnimate()) {
isChartAnimation.setSelectedIndex(chart.isJSDraw() ? 0 : 1);
isChartAnimation.setEnabled(!largeModel(plot));
}
@ -235,11 +339,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected void populateAutoRefresh(VanChart chart) {
VanChartPlot plot = (VanChartPlot)chart.getPlot();
VanChartPlot plot = chart.getPlot();
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if(refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot)chart.getPlot()).getAutoAttrTooltip());
if (refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot) chart.getPlot()).getAutoAttrTooltip());
}
autoRefreshPane.populateBean(refreshMoreLabel);
@ -252,22 +356,24 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
return;
}
VanChart vanChart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if (zoomPane != null) {
((VanChart) chart).setZoomAttribute(zoomPane.updateBean());
vanChart.setZoomAttribute(zoomPane.updateBean());
}
if(plot.getAxisPlotType() == AxisPlotType.RECTANGLE){
updateChartAxisRotation((VanChart)chart);
if (plot.getAxisPlotType() == AxisPlotType.RECTANGLE) {
updateChartAxisRotation(vanChart);
}
updateChartTools((VanChart)chart);
updateChartAnimate(chart, plot);
updateAutoRefresh((VanChart)chart);
updateChartTools(vanChart);
updateChartAnimate(vanChart, plot);
updateLargeData(plot);
updateAutoRefresh(vanChart);
updateHyperlink(plot);
}
protected void updateHyperlink(Plot plot){
protected void updateHyperlink(Plot plot) {
superLink.update(plot);
}
@ -282,7 +388,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private void updateChartAxisRotation(VanChart chart) {
//坐标轴和plot都需要这个属性,因为坐标轴和plot是分开画的
VanChartPlot plot = (VanChartPlot) chart.getPlot();
VanChartPlot plot = chart.getPlot();
plot.setAxisRotation(axisRotation.getSelectedIndex() == 0);
//同时更新坐标轴旋转属性
for (VanChartAxis axis : ((VanChartRectanglePlot) plot).getXAxisList()) {
@ -294,14 +400,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
//更新数据表属性
if (plot.isAxisRotation()){
if (plot.isAxisRotation()) {
plot.getDataSheet().setVisible(false);
}
}
private void updateLargeData(Plot plot) {
if (largeDataMode != null) {
LargeDataAttribute attribute = new LargeDataAttribute();
attribute.setLargeDataModeType((LargeDataModeType) largeDataMode.getSelectedItem());
attribute.setLargeModeThresholdNumber(largeModeThresholdNumber.getValue());
plot.setLargeDataAttribute(attribute);
}
}
private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.getSelectedIndex()==0);
if (plot.isSupportAnimate()) {
chart.setJSDraw(isChartAnimation.getSelectedIndex() == 0);
}
}
@ -309,15 +424,15 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
private void updateAutoRefresh(VanChart chart) {
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if(refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot)chart.getPlot()).getAutoAttrTooltip());
if (refreshMoreLabel == null) {
refreshMoreLabel = new RefreshMoreLabel(((VanChartPlot) chart.getPlot()).getAutoAttrTooltip());
chart.setRefreshMoreLabel(refreshMoreLabel);
}
autoRefreshPane.updateBean(refreshMoreLabel);
}
@Override
public Chart updateBean() {
public VanChart updateBean() {
return null;
}

199
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -1,8 +1,5 @@
package com.fr.van.chart.designer.style.series;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel;
import com.fr.base.chart.chartdata.model.NormalDataModel;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
@ -10,11 +7,9 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
@ -28,6 +23,7 @@ import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.van.chart.custom.style.VanChartCustomStylePane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
@ -41,8 +37,6 @@ import com.fr.van.chart.pie.RadiusCardLayoutPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
/**
@ -73,11 +67,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
private RadiusCardLayoutPane radiusPane;//半径设置界面
private JPanel radiusPaneWithTitle;
private UIButtonGroup<DataProcessor> largeDataModelGroup;//大数据模式
protected JPanel contentPane;
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot){
public VanChartAbstractPlotSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
@ -110,17 +102,17 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
}
//获取颜色面板
protected JPanel getColorPane () {
protected JPanel getColorPane() {
JPanel panel = new JPanel(new BorderLayout());
stylePane = createStylePane();
setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel.getComponentCount() == 0 ? null : colorPane;
}
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
protected void setColorPaneContent(JPanel panel) {
if (stylePane != null) {
panel.add(stylePane, BorderLayout.CENTER);
}
@ -165,80 +157,26 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
protected JPanel createRadiusPane() {
radiusPane = initRadiusPane();
radiusPaneWithTitle = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Radius_Set"), radiusPane);
return ((VanChartPlot)plot).isInCustom() ? null : radiusPaneWithTitle;
return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle;
}
protected JPanel createLargeDataModelPane() {
largeDataModelGroup = createLargeDataModelGroup();
largeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup);
return createLargeDataModelPane(panel);
}
protected void checkLarge() {
if(largeModel()) {
AttrLabel attrLabel = ((VanChartPlot) plot).getAttrLabelFromConditionCollection();
if (attrLabel == null) {
attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel();
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
defaultAttr.addDataSeriesCondition(attrLabel);
}
attrLabel.setEnable(false);
resetCustomCondition(plot.getConditionCollection());
}
checkCompsEnabledWithLarge();
}
protected void checkCompsEnabledWithLarge() {
if(markerPane != null && largeDataModelGroup != null){
markerPane.checkLargePlot(largeModel());
protected void checkCompsEnabledWithLarge(Plot plot) {
if (markerPane != null) {
markerPane.checkLargePlot(largeModel(plot));
}
}
protected void checkLinePane() {
if(lineTypePane != null && largeDataModelGroup != null){
lineTypePane.checkLarge(largeModel());
if (lineTypePane != null) {
lineTypePane.checkLarge(largeModel(plot));
}
}
protected boolean largeModel() {
return largeDataModelGroup != null && largeDataModelGroup.getSelectedIndex() == 0;
protected boolean largeModel(Plot plot) {
return PlotFactory.largeDataModel(plot);
}
protected void resetCustomCondition(ConditionCollection conditionCollection) {
for(int i = 0, len = conditionCollection.getConditionAttrSize(); i < len; i++){
ConditionAttr conditionAttr = conditionCollection.getConditionAttr(i);
conditionAttr.remove(AttrLabel.class);
conditionAttr.remove(ScatterAttrLabel.class);
conditionAttr.remove(AttrEffect.class);
conditionAttr.remove(AttrLineEffect.class);
VanChartAttrMarker attrMarker = conditionAttr.getExisted(VanChartAttrMarker.class);
if(attrMarker != null && !attrMarker.isCommon()){
conditionAttr.remove(VanChartAttrMarker.class);
}
}
}
protected JPanel createLargeDataModelPane(JPanel jPanel) {
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel);
return panel;
}
protected UIButtonGroup<DataProcessor> createLargeDataModelGroup() {
String[] strings = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")};
DataProcessor[] values = new DataProcessor[]{new LargeDataModel(), new NormalDataModel()};
return new UIButtonGroup<DataProcessor>(strings, values);
}
protected RadiusCardLayoutPane initRadiusPane() {
return new RadiusCardLayoutPane();
@ -258,7 +196,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane();
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
return stackAndAxisEditExpandablePane;
}
@ -272,7 +210,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 更新Plot的属性到系列界面
*/
public void populateBean(Plot plot) {
if(plot == null) {
if (plot == null) {
return;
}
@ -280,24 +218,20 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
super.populateBean(plot);//配色
if(stylePane != null){//风格
if (stylePane != null) {//风格
stylePane.populateBean(plot.getPlotStyle());
}
if(largeDataModelGroup != null){
largeDataModelGroup.setSelectedItem(plot.getDataProcessor());
}
if(stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot){//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot;
if(rectanglePlot.isCustomChart()){
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {
stackAndAxisEditPane.populate(rectanglePlot);
} else {
removeStackWholePane();
}
}
if(radiusPane != null && plot instanceof VanChartRadiusPlot){
if (radiusPane != null && plot instanceof VanChartRadiusPlot) {
radiusPane.populateBean(plot);
checkRadiusPane(plot);
}
@ -306,17 +240,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkAreaSeriesFillColorPane(plot.getPlotStyle());
checkCompsEnabledWithLarge();
checkCompsEnabledWithLarge(plot);
}
/**
* radius界面是否显示
*
* @param plot
*/
private void checkRadiusPane(Plot plot) {
radiusPaneWithTitle.setVisible(true);
if (plot instanceof VanChartPlot){
if (((VanChartPlot) plot).isInCustom()){
if (plot instanceof VanChartPlot) {
if (((VanChartPlot) plot).isInCustom()) {
radiusPaneWithTitle.setVisible(false);
}
}
@ -326,7 +261,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
* 保存 系列界面的属性到Plot
*/
public void updateBean(Plot plot) {
if(plot == null) {
if (plot == null) {
return;
}
@ -335,22 +270,18 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
super.updateBean(plot);//配色
if(stylePane != null){//风格
if (stylePane != null) {//风格
plot.setPlotStyle(stylePane.updateBean());
}
if(largeDataModelGroup != null){
plot.setDataProcessor(largeDataModelGroup.getSelectedItem());
}
if(stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot){//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot)plot;
if(rectanglePlot.isCustomChart()){
if (stackAndAxisEditPane != null && plot instanceof VanChartRectanglePlot) {//堆积和坐标轴
VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot;
if (rectanglePlot.isCustomChart()) {
stackAndAxisEditPane.update(rectanglePlot);
}
}
if (radiusPane != null && plot instanceof VanChartRadiusPlot){
if (radiusPane != null && plot instanceof VanChartRadiusPlot) {
radiusPane.updateBean(plot);
checkRadiusPane(plot);
}
@ -360,47 +291,47 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
checkAreaSeriesFillColorPane(plot.getPlotStyle());
}
protected void checkoutMapType(Plot plot){
protected void checkoutMapType(Plot plot) {
}
protected void checkAreaSeriesFillColorPane(int plotStyle){
protected void checkAreaSeriesFillColorPane(int plotStyle) {
if (areaSeriesFillColorPane != null) {
areaSeriesFillColorPane.checkoutAlpha(plotStyle == ChartConstants.STYLE_NONE);
}
}
protected void populateCondition(ConditionAttr defaultAttr){
if(trendLinePane != null){//趋势线
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class);
protected void populateCondition(ConditionAttr defaultAttr) {
if (trendLinePane != null) {//趋势线
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
trendLinePane.populate(attrTrendLine);
}
if(lineTypePane != null){//线-线型、控制断开等
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class);
if (lineTypePane != null) {//线-线型、控制断开等
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
lineTypePane.populate(attrLine);
}
if(markerPane != null){//标记点
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class);
if (markerPane != null) {//标记点
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
markerPane.populate(attrMarker);
}
if(areaSeriesFillColorPane != null){//填充颜色
AttrAreaSeriesFillColorBackground seriesFillColorBackground = (AttrAreaSeriesFillColorBackground)defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
if (areaSeriesFillColorPane != null) {//填充颜色
AttrAreaSeriesFillColorBackground seriesFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
areaSeriesFillColorPane.populate(seriesFillColorBackground);
}
if(borderPane != null){//边框
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class);
if(attrBorder != null){
if (borderPane != null) {//边框
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder != null) {
borderPane.populate(attrBorder);
}
}
populateAlpha(defaultAttr);
}
protected void populateAlpha(ConditionAttr defaultAttr){
if(transparent != null){//不透明度
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class);
if(attrAlpha != null){
protected void populateAlpha(ConditionAttr defaultAttr) {
if (transparent != null) {//不透明度
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if (attrAlpha != null) {
transparent.populateBean(attrAlpha.getAlpha() * VanChartAttrHelper.PERCENT);
} else {
//初始值为100
@ -409,35 +340,35 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
}
}
protected void updateCondition(ConditionAttr defaultAttr){
if(trendLinePane != null){
protected void updateCondition(ConditionAttr defaultAttr) {
if (trendLinePane != null) {
VanChartAttrTrendLine newTrendLine = trendLinePane.update();
VanChartAttrTrendLine attrTrendLine =(VanChartAttrTrendLine)defaultAttr.getExisted(VanChartAttrTrendLine.class);
VanChartAttrTrendLine attrTrendLine = defaultAttr.getExisted(VanChartAttrTrendLine.class);
defaultAttr.remove(attrTrendLine);
defaultAttr.addDataSeriesCondition(newTrendLine);
}
if(lineTypePane != null){
VanChartAttrLine attrLine = (VanChartAttrLine)defaultAttr.getExisted(VanChartAttrLine.class);
if (lineTypePane != null) {
VanChartAttrLine attrLine = defaultAttr.getExisted(VanChartAttrLine.class);
defaultAttr.remove(attrLine);
defaultAttr.addDataSeriesCondition(lineTypePane.update());
}
if(markerPane != null){
if (markerPane != null) {
VanChartAttrMarker newMarker = markerPane.update();
VanChartAttrMarker attrMarker = (VanChartAttrMarker)defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker);
defaultAttr.addDataSeriesCondition(newMarker);
}
if(areaSeriesFillColorPane != null){
if (areaSeriesFillColorPane != null) {
AttrAreaSeriesFillColorBackground newFillColorBackground = areaSeriesFillColorPane.update();
AttrAreaSeriesFillColorBackground oldFillColorBackground = defaultAttr.getExisted(AttrAreaSeriesFillColorBackground.class);
if(oldFillColorBackground != null){
if (oldFillColorBackground != null) {
defaultAttr.remove(oldFillColorBackground);
}
defaultAttr.addDataSeriesCondition(newFillColorBackground);
}
if(borderPane != null){
AttrBorder attrBorder = (AttrBorder)defaultAttr.getExisted(AttrBorder.class);
if(attrBorder == null){
if (borderPane != null) {
AttrBorder attrBorder = defaultAttr.getExisted(AttrBorder.class);
if (attrBorder == null) {
attrBorder = new AttrBorder();
defaultAttr.addDataSeriesCondition(attrBorder);
}
@ -446,14 +377,14 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
updateAlpha(defaultAttr);
}
protected void updateAlpha(ConditionAttr defaultAttr){
if(transparent != null){
AttrAlpha attrAlpha = (AttrAlpha)defaultAttr.getExisted(AttrAlpha.class);
if(attrAlpha == null){
protected void updateAlpha(ConditionAttr defaultAttr) {
if (transparent != null) {
AttrAlpha attrAlpha = defaultAttr.getExisted(AttrAlpha.class);
if (attrAlpha == null) {
attrAlpha = new AttrAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha);
}
attrAlpha.setAlpha((float)(transparent.updateBean()/VanChartAttrHelper.PERCENT));
attrAlpha.setAlpha((float) (transparent.updateBean() / VanChartAttrHelper.PERCENT));
}
}
}

38
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java

@ -6,9 +6,9 @@ import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow;
import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom;
@ -32,31 +32,31 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
private JPanel drillPane;
@Override
protected JPanel getInteractivePane(VanChartPlot plot){
protected JPanel getInteractivePane(VanChartPlot plot) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize),null},
new Component[]{createAnimationPane(),null},
new Component[]{createZoomPane(new double[]{p,p,p}, columnSize, plot),null},
new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createAnimationPane(), null},
new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null},
new Component[]{createDrillToolsPane(), null},
new Component[]{createAutoRefreshPane(plot),null},
new Component[]{createHyperlinkPane(),null}
new Component[]{createAutoRefreshPane(plot), null},
new Component[]{createHyperlinkPane(), null}
};
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
private JPanel createDrillToolsPane() {
openOrClose = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")});
JPanel openOrClosePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill_Dir"), openOrClose);
textAttrPane = new ChartTextAttrPane(){
textAttrPane = new ChartTextAttrPane() {
@Override
protected JPanel getContentPane (JPanel buttonPane) {
protected JPanel getContentPane(JPanel buttonPane) {
double p = TableLayout.PREFERRED;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {e};
@ -80,7 +80,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p};
double[] rowSize = {p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{null},
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)},
@ -88,7 +88,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Select_Color"), selectBackgroundPane)},
new Component[]{catalogSuperLink}
};
drillPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize);
drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(openOrClosePane, BorderLayout.NORTH);
@ -102,13 +102,13 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
});
JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Drill"), panel);
panel.setBorder(BorderFactory.createEmptyBorder(10,5,0,0));
panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0));
return panel1;
}
private JPanel createTitlePane(String title, Component component) {
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
panel.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
panel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
return panel;
}
@ -123,9 +123,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
if (chart == null || chart.getPlot() == null) {
return;
}
this.chart = chart;
VanChartPlot plot = (VanChartPlot)chart.getPlot();
if(plot instanceof VanChartDrillMapPlot){
this.chart = (VanChart) chart;
VanChartPlot plot = chart.getPlot();
if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();
openOrClose.setSelectedIndex(drillMapTools.isEnable() ? 0 : 1);
textAttrPane.populate(drillMapTools.getTextAttr());
@ -145,9 +145,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith
return;
}
VanChartPlot plot = (VanChartPlot) chart.getPlot();
VanChartPlot plot = chart.getPlot();
if(plot instanceof VanChartDrillMapPlot){
if (plot instanceof VanChartDrillMapPlot) {
DrillMapTools drillMapTools = ((VanChartDrillMapPlot) plot).getDrillMapTools();
drillMapTools.setEnable(openOrClose.getSelectedIndex() == 0);
drillMapTools.setTextAttr(textAttrPane.update());

18
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java

@ -50,27 +50,33 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI
}
@Override
protected boolean areaPlot(Plot plot){
protected boolean areaPlot(Plot plot) {
return false;
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartHeatMapSeriesPane(parent, plot);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartHeatMapConditionPane(plot);
}
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartMapStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){
VanChartOtherPane otherPane = new VanChartOtherPane() {
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithMapZoom();
return new VanChartInteractivePaneWithMapZoom() {
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};

9
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -12,24 +12,23 @@ import java.awt.Component;
/**
* 折线图的系列界面
*/
public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane{
public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L;
public VanChartLineSeriesPane(ChartStylePane parent, Plot plot){
public VanChartLineSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType(){
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p};
double[] row = {p, p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};

159
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -1,6 +1,5 @@
package com.fr.van.chart.map;
import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
@ -12,7 +11,6 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.base.AttrBorderWithAlpha;
import com.fr.plugin.chart.base.AttrEffect;
@ -21,7 +19,6 @@ import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.attr.AttrMapLabel;
import com.fr.plugin.chart.map.line.condition.AttrCurve;
import com.fr.plugin.chart.map.line.condition.AttrLineEffect;
import com.fr.plugin.chart.type.MapMarkerType;
@ -79,7 +76,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
//line
private VanChartCurvePane curvePane;
private VanChartLineMapEffectPane lineMapEffectPane;
private UIButtonGroup<DataProcessor> lineMapLargeDataModelGroup;//大数据模式
private MapType mapType = MapType.AREA;
@ -87,53 +83,20 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
super(parent, plot);
}
@Override
protected void checkLarge() {
if(largeModel()) {
if(plot instanceof VanChartMapPlot) {
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
AttrMapLabel attrMapLabel = defaultAttr.getExisted(AttrMapLabel.class);
if(attrMapLabel == null){
attrMapLabel = new AttrMapLabel();
defaultAttr.addDataSeriesCondition(attrMapLabel);
}
attrMapLabel.getPointLabel().setEnable(false);
resetCustomCondition(((VanChartMapPlot) plot).getPointConditionCollection());
}
}
checkPointCompsEnabledWithLarge();
protected void checkCompsEnabledWithLarge(Plot plot) {
checkPointCompsEnabledWithLarge(plot);
checkLineCompsEnabledWithLarge(plot);
}
protected void checkCompsEnabledWithLarge() {
checkPointCompsEnabledWithLarge();
checkLineCompsEnabledWithLarge();
}
private void checkPointCompsEnabledWithLarge() {
if(pointEffectPane != null) {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel());
private void checkPointCompsEnabledWithLarge(Plot plot) {
if (pointEffectPane != null) {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel(plot));
}
}
private boolean lineMapLargeModel() {
return lineMapLargeDataModelGroup != null && lineMapLargeDataModelGroup.getSelectedIndex() == 0;
}
private void checkLineMapLarge() {
if(lineMapLargeModel()) {
if(plot instanceof VanChartMapPlot) {
resetCustomCondition(((VanChartMapPlot) plot).getLineConditionCollection());
}
}
checkLineCompsEnabledWithLarge();
}
private void checkLineCompsEnabledWithLarge() {
if(lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !lineMapLargeModel());
private void checkLineCompsEnabledWithLarge(Plot plot) {
if (lineMapEffectPane != null) {
GUICoreUtils.setEnabled(lineMapEffectPane, !largeModel(plot));
}
}
@ -195,7 +158,6 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), createPointAlphaPane())},
new Component[]{createMarkerComPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createPointEffectPane()},
};
@ -212,25 +174,12 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
Component[][] components = new Component[][]{
new Component[]{createCurvePane()},
new Component[]{createLineMapLargeDataModelPane()},
new Component[]{createAnimationPane()}
};
return TableLayoutHelper.createTableLayoutPane(components, row, col);
}
private JPanel createLineMapLargeDataModelPane() {
lineMapLargeDataModelGroup = createLargeDataModelGroup();
lineMapLargeDataModelGroup.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
checkLineMapLarge();
}
});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Large_Model"), lineMapLargeDataModelGroup);
return createLargeDataModelPane(panel);
}
private Component createCurvePane() {
curvePane = new VanChartCurvePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve"), curvePane);
@ -257,8 +206,8 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
commonMarkerPane = new VanChartMapScatterMarkerPane();
commonMarkerPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);
bubblePane = new VanChartBubblePane(){
protected JPanel getContentPane () {
bubblePane = new VanChartBubblePane() {
protected JPanel getContentPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
@ -304,7 +253,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
JPanel pointPane = createPointPane();
JPanel linePane = createLinePane();
JPanel panel = createGroupPane(plot, areaPane, pointPane, linePane);
JPanel panel = createGroupPane(plot, areaPane, pointPane, linePane);
return panel;
}
@ -313,7 +262,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
JPanel panel;
if (ComparatorUtils.equals(plot.getClass(), VanChartDrillMapPlot.class)) {
panel = createDrillMapCustomGroupPane(areaPane, pointPane);
}else {
} else {
panel = createMapCustomGroupPane(areaPane, pointPane, linePane);
}
return panel;
@ -334,7 +283,7 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
public void stateChanged(ChangeEvent e) {
if (areaPointAndLineGroup.getSelectedIndex() == 0) {
cardLayout.show(centerPane, AREA_STRING);
} else if (areaPointAndLineGroup.getSelectedIndex() == 1){
} else if (areaPointAndLineGroup.getSelectedIndex() == 1) {
cardLayout.show(centerPane, POINT_STRING);
} else {
cardLayout.show(centerPane, LINE_STRING);
@ -375,36 +324,30 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
}
public void populateBean(Plot plot) {
if(plot != null && plot instanceof VanChartMapPlot){
if(markerTypeCom != null){
if (plot != null && plot instanceof VanChartMapPlot) {
if (markerTypeCom != null) {
markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString());
}
if(nullValueColorBox != null){
if (nullValueColorBox != null) {
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
}
if(lineMapLargeDataModelGroup != null){
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor());
}
}
super.populateBean(plot);
}
public void updateBean(Plot plot) {
if(plot != null && plot instanceof VanChartMapPlot){
if(markerTypeCom != null){
if (plot != null && plot instanceof VanChartMapPlot) {
if (markerTypeCom != null) {
((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parseInt(markerTypeCom.getSelectedIndex()));
}
if(nullValueColorBox != null){
if (nullValueColorBox != null) {
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject());
}
if(lineMapLargeDataModelGroup != null){
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem());
}
}
super.updateBean(plot);
}
@Override
@Override
protected void populateCondition(ConditionAttr defaultAttr) {
switch (mapType) {
case AREA:
@ -427,50 +370,50 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
protected void populateArea(ConditionAttr defaultAttr) {
populateAlpha(defaultAttr);
if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class);
AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
borderWithAlphaPane.populate(attrBorderWithAlpha);
}
}
private void populatePoint(ConditionAttr defaultAttr) {
if(pointAlphaPane != null){
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class);
if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
double alpha = VanChartAttrHelper.PERCENT * (attrAlpha == null ? 1 : attrAlpha.getAlpha());
pointAlphaPane.populateBean(alpha);
}
if(pointEffectPane != null){
if (pointEffectPane != null) {
AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class);
if(attrEffect == null){//老的模板做界面上的兼容
if (attrEffect == null) {//老的模板做界面上的兼容
attrEffect = new AttrEffect(3.2);
attrEffect.setEnabled(false);
}
pointEffectPane.populateBean(attrEffect);
}
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class);
if(commonMarkerPane != null) {
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
if (commonMarkerPane != null) {
commonMarkerPane.populateBean(attrMarker);
}
if(imageMarkerPane != null) {
if (imageMarkerPane != null) {
imageMarkerPane.populateBean(attrMarker);
}
if(bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
if (bubblePane != null) {
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
private void populateLine(ConditionAttr defaultAttr) {
if (curvePane != null){
if (defaultAttr.getExisted(AttrCurve.class) == null){
if (curvePane != null) {
if (defaultAttr.getExisted(AttrCurve.class) == null) {
defaultAttr.addDataSeriesCondition(new AttrCurve());
}
curvePane.populateBean((AttrCurve) defaultAttr.getExisted(AttrCurve.class));
curvePane.populateBean(defaultAttr.getExisted(AttrCurve.class));
}
if (lineMapEffectPane != null){
if (defaultAttr.getExisted(AttrLineEffect.class) == null){
if (lineMapEffectPane != null) {
if (defaultAttr.getExisted(AttrLineEffect.class) == null) {
defaultAttr.addDataSeriesCondition(new AttrLineEffect());
}
AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class);
@ -498,40 +441,40 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
}
}
protected void checkoutMapType(Plot plot){
this.mapType = ((VanChartMapPlot)plot).getMapType();
protected void checkoutMapType(Plot plot) {
this.mapType = ((VanChartMapPlot) plot).getMapType();
}
protected void updateArea(ConditionAttr defaultAttr) {
updateAlpha(defaultAttr);
if (borderWithAlphaPane != null) {
AttrBorderWithAlpha attrBorderWithAlpha = (AttrBorderWithAlpha) defaultAttr.getExisted(AttrBorderWithAlpha.class);
AttrBorderWithAlpha attrBorderWithAlpha = defaultAttr.getExisted(AttrBorderWithAlpha.class);
defaultAttr.remove(attrBorderWithAlpha);
defaultAttr.addDataSeriesCondition(borderWithAlphaPane.update());
}
}
private void updatePoint(ConditionAttr defaultAttr) {
if(pointAlphaPane != null){
AttrMarkerAlpha attrAlpha = (AttrMarkerAlpha)defaultAttr.getExisted(AttrMarkerAlpha.class);
if(attrAlpha == null){
if (pointAlphaPane != null) {
AttrMarkerAlpha attrAlpha = defaultAttr.getExisted(AttrMarkerAlpha.class);
if (attrAlpha == null) {
attrAlpha = new AttrMarkerAlpha();
defaultAttr.addDataSeriesCondition(attrAlpha);
}
attrAlpha.setAlpha((float)(pointAlphaPane.updateBean()/VanChartAttrHelper.PERCENT));
attrAlpha.setAlpha((float) (pointAlphaPane.updateBean() / VanChartAttrHelper.PERCENT));
}
if(pointEffectPane != null){
if (pointEffectPane != null) {
AttrEffect attrEffect = defaultAttr.getExisted(AttrEffect.class);
defaultAttr.remove(attrEffect);
defaultAttr.addDataSeriesCondition(pointEffectPane.updateBean());
}
VanChartAttrMarker attrMarker = (VanChartAttrMarker) defaultAttr.getExisted(VanChartAttrMarker.class);
VanChartAttrMarker attrMarker = defaultAttr.getExisted(VanChartAttrMarker.class);
defaultAttr.remove(attrMarker);
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
VanChartAttrBubble attrBubble = defaultAttr.getExisted(VanChartAttrBubble.class);
defaultAttr.remove(attrBubble);
if(markerTypeCom != null) {
if (markerTypeCom != null) {
if (markerTypeCom.getSelectedIndex() == 1) {
defaultAttr.addDataSeriesCondition(commonMarkerPane.updateBean());
} else if (markerTypeCom.getSelectedIndex() == 2) {
@ -543,17 +486,17 @@ public class VanChartMapSeriesPane extends VanChartAbstractPlotSeriesPane {
}
private void updateLine(ConditionAttr defaultAttr) {
if(curvePane != null){
if (curvePane != null) {
AttrCurve attrCurve = defaultAttr.getExisted(AttrCurve.class);
if(attrCurve != null){
if (attrCurve != null) {
defaultAttr.remove(AttrCurve.class);
}
attrCurve = curvePane.updateBean();
defaultAttr.addDataSeriesCondition(attrCurve);
}
if (lineMapEffectPane != null){
if (lineMapEffectPane != null) {
AttrLineEffect attrLineEffect = defaultAttr.getExisted(AttrLineEffect.class);
if (attrLineEffect != null){
if (attrLineEffect != null) {
defaultAttr.remove(AttrLineEffect.class);
}
attrLineEffect = (AttrLineEffect) lineMapEffectPane.updateBean();

27
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java

@ -1,12 +1,9 @@
package com.fr.van.chart.map.designer.other;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.other.AutoRefreshPane;
import com.fr.van.chart.designer.other.AutoRefreshPaneWithoutTooltip;
@ -20,11 +17,13 @@ import javax.swing.JPanel;
public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZoom {
private static final int HYPERLINK_LEFT_GAP = 36;
private VanChartMapHyperLinkPane hyperlinkPane;
@Override
protected JPanel createHyperlinkPane() {
hyperlinkPane = new VanChartMapHyperLinkPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperlinkPane);
}
@Override
protected void populateHyperlink(Plot plot) {
hyperlinkPane.populateBean(plot);
@ -36,26 +35,22 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo
}
@Override
protected boolean largeModel(Plot plot) {
if(plot instanceof VanChartMapPlot){
VanChartMapPlot mapPlot = (VanChartMapPlot)plot;
switch (mapPlot.getMapType()){
case LINE:
return PlotFactory.lineMapLargeModel(mapPlot);
default:
return PlotFactory.largeDataModel(mapPlot);
}
protected boolean isCurrentChartSupportLargeDataMode() {
if (this.chart == null || this.chart.getPlot() == null) {
return false;
}
return false;
VanChartMapPlot mapPlot = this.chart.getPlot();
return mapPlot.getMapType() == MapType.POINT || mapPlot.getMapType() == MapType.LINE;
}
protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) {
boolean isLargeModel = largeModel(plot);
VanChartMapPlot mapPlot = (VanChartMapPlot)plot;
VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
if (mapPlot.getMapType().equals(MapType.LINE)) {
return new AutoRefreshPaneWithoutTooltip((VanChart) chart, isLargeModel);
return new AutoRefreshPaneWithoutTooltip(chart, isLargeModel);
}
return new AutoRefreshPane((VanChart) chart, isLargeModel);
return new AutoRefreshPane(chart, isLargeModel);
}
}

3
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/pane/VanChartLineMapConditionPane.java

@ -46,7 +46,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(AttrCurve.class, new VanChartCurveConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartLineMapTooltipConditionPane(this, plot));
if(!PlotFactory.lineMapLargeModel(plot)){
if (!PlotFactory.largeDataModel(plot)) {
classPaneMap.put(AttrLineEffect.class, new VanChartLineEffectConditionPane(this, EffectHelper.getLineMapDefaultLineEffect()));
}
}
@ -56,6 +56,7 @@ public class VanChartLineMapConditionPane extends DataSeriesConditionPane {
/**
* 返回图表class对象
*
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {

18
designer-chart/src/main/java/com/fr/van/chart/scatter/ScatterIndependentVanChartInterface.java

@ -57,18 +57,19 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
public String getIconPath() {
return "com/fr/design/images/form/toolbar/scatter.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return new VanChartScatterSeriesPane(parent, plot);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return new VanChartScatterPlotTableDataContentPane(parent);
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return new BubblePlotReportDataContentPane(parent);
}
@ -77,9 +78,9 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) {
VanChartStylePane stylePane = new VanChartScatterStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){
VanChartOtherPane otherPane = new VanChartOtherPane() {
@Override
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartInteractivePaneWithOutSort() {
@ -87,6 +88,11 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
@ -94,7 +100,7 @@ public class ScatterIndependentVanChartInterface extends AbstractIndependentVanC
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return new VanChartScatterConditionPane(plot);
}
}

22
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -5,7 +5,6 @@ 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.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
@ -20,19 +19,19 @@ import java.awt.Component;
/**
* 散点图的系列界面
*/
public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L;
public VanChartScatterSeriesPane(ChartStylePane parent, Plot plot){
public VanChartScatterSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType(){
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p,p,p};
double[] row = {p, p, p, p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
@ -40,7 +39,6 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{createTrendLinePane()},
};
@ -49,25 +47,25 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
}
//设置色彩面板内容
protected void setColorPaneContent (JPanel panel) {
protected void setColorPaneContent(JPanel panel) {
panel.add(createAlphaPane(), BorderLayout.CENTER);
}
@Override
//堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(){
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane() {
@Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class;
}
@Override
public String getPaneTitle(){
public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
}
};
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
return stackAndAxisEditExpandablePane;
}
@ -77,8 +75,8 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane{
}
@Override
protected void checkCompsEnabledWithLarge() {
super.checkCompsEnabledWithLarge();
protected void checkCompsEnabledWithLarge(Plot plot) {
super.checkCompsEnabledWithLarge(this.plot);
checkLinePane();
}

9
designer-chart/src/main/java/com/fr/van/chart/scatter/component/VanChartScatterLineTypePane.java

@ -16,23 +16,20 @@ public class VanChartScatterLineTypePane extends VanChartLineTypePane {
@Override
protected void createLineStyle() {
String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Normal_Line"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_CurveLine")};
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_CurveLine")};
lineStyle = new UIButtonGroup<LineStyle>(textArray, new LineStyle[]{LineStyle.NORMAL, LineStyle.CURVE});
}
@Override
protected Component[][] createContentComponent(Component[] lineTypeComponent, Component[] lineWidthComponent, Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
protected Component[][] createContentComponent(Component[] lineStyleComponent, Component[] nullValueBreakComponent) {
return new Component[][]{
new Component[]{null, null},
lineTypeComponent,
lineWidthComponent,
lineStyleComponent
};
}
@Override
protected VanChartAttrLine initVanChartAttrLine() {
VanChartAttrLine attrLine = new VanChartAttrLine();
VanChartAttrLine attrLine = new VanChartAttrLine();
//默认为无线型,且默認空值不斷開
attrLine.setLineType(LineType.NONE);
attrLine.setNullValueBreak(false);

18
designer-chart/src/main/java/com/fr/van/chart/vanchart/AbstractMultiCategoryVanChartUI.java

@ -21,17 +21,18 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
/**
* Created by mengao on 2017/7/6.
*/
public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependentVanChartUI {
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndependentVanChartUI {
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
//自定义组合图特殊处理
if (((VanChartPlot)plot).isInCustom() && ((VanChartPlot)plot).getCustomType().equals("CUSTOM")) {
if (((VanChartPlot) plot).isInCustom() && ((VanChartPlot) plot).getCustomType().equals("CUSTOM")) {
return new CategoryPlotTableDataContentPane(parent);
}
return new VanChartMoreCateTableDataContentPane(parent); }
return new VanChartMoreCateTableDataContentPane(parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
//自定义组合图特殊处理
if (((VanChartPlot)plot).isInCustom() && ((VanChartPlot)plot).getCustomType().equals("CUSTOM")) {
if (((VanChartPlot) plot).isInCustom() && ((VanChartPlot) plot).getCustomType().equals("CUSTOM")) {
return new CategoryPlotReportDataContentPane(parent);
}
return new VanChartMoreCateReportDataContentPane(parent);
@ -49,6 +50,11 @@ public abstract class AbstractMultiCategoryVanChartUI extends AbstractIndepende
protected ZoomPane createZoomPane() {
return new ZoomPane();
}
@Override
protected boolean isCurrentChartSupportLargeDataMode() {
return true;
}
};
}
};

Loading…
Cancel
Save