diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 8480d2464..b50c740a3 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -49,6 +49,7 @@ import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; +import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; @@ -79,6 +80,7 @@ import com.fr.stable.StringUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.area.AreaIndependentVanChartInterface; import com.fr.van.chart.bar.BarIndependentVanChartInterface; +import com.fr.van.chart.box.BoxIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.van.chart.column.VanColumnChartTypeUI; import com.fr.van.chart.custom.CustomIndependentVanChartInterface; @@ -202,6 +204,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBoxPlot.VAN_CHART_BOX_PLOT_ID, new BoxIndependentVanChartInterface()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java new file mode 100644 index 000000000..655ce7cae --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -0,0 +1,85 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.Plot; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.van.chart.bar.VanChartBarStylePane; +import com.fr.van.chart.designer.other.VanChartInteractivePane; +import com.fr.van.chart.designer.other.VanChartOtherPane; +import com.fr.van.chart.designer.other.zoom.ZoomPane; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI; + +import java.awt.Component; + +public class BoxIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { + + public String getName() { + return Toolkit.i18nText("Fine-Design_Chart_New_Box"); + } + + public String[] getSubName() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_New_Box") + }; + } + + public String[] getDemoImagePath() { + return new String[]{ + "com/fr/plugin/chart/demo/image/box.png" + }; + } + + public String getIconPath() { + return "com/fr/design/images/form/toolbar/box.png"; + } + + public AbstractChartTypePane getPlotTypePane() { + return new VanChartBoxPlotPane(); + } + + public ConditionAttributesPane getPlotConditionPane(Plot plot) { + return new VanChartBoxConditionPane(plot); + } + + public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { + return new VanChartBoxSeriesPane(parent, plot); + } + + public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) { + VanChartStylePane stylePane = new VanChartBarStylePane(listener); + VanChartOtherPane otherPane = new VanChartOtherPane() { + + protected BasicBeanPane createInteractivePane() { + return new VanChartInteractivePane() { + + protected Component[][] createToolBarComponents() { + return new Component[][]{ + new Component[]{null, exportImages}, + new Component[]{null, fullScreenDisplay} + }; + } + + protected double[] getToolBarRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p}; + } + + protected ZoomPane createZoomPane() { + return new ZoomPane(); + } + }; + } + }; + + return new AbstractChartAttrPane[]{stylePane, otherPane}; + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java new file mode 100644 index 000000000..c0412a9f3 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java @@ -0,0 +1,53 @@ +package com.fr.van.chart.box; + +import com.fr.chart.base.AttrAlpha; +import com.fr.chart.base.AttrBackground; +import com.fr.chart.base.AttrBorder; +import com.fr.chart.chartattr.Plot; +import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; +import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; +import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.plugin.chart.type.ConditionKeyType; +import com.fr.van.chart.column.VanChartColumnLabelBorderPane; +import com.fr.van.chart.designer.other.condition.item.VanChartColumnSeriesColorConditionPane; + +import java.awt.Dimension; + +public class VanChartBoxConditionPane extends DataSeriesConditionPane { + + public VanChartBoxConditionPane(Plot plot) { + super(plot); + } + + protected void initComponents() { + super.initComponents(); + + liteConditionPane.setPreferredSize(new Dimension(300, 400)); + } + + protected void addBasicAction() { + classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this)); + classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); + classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this)); + } + + protected void addStyleAction() { + } + + protected ChartConditionPane createListConditionPane() { + + return new ChartConditionPane() { + + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.BOX_CONDITION_KEY_TYPES; + } + }; + } + + + public Class class4Correspond() { + return VanChartBoxPlot.class; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java new file mode 100644 index 000000000..2679f7eba --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java @@ -0,0 +1,45 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.Plot; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.box.BoxIndependentVanChart; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.van.chart.designer.type.AbstractVanChartTypePane; + +public class VanChartBoxPlotPane extends AbstractVanChartTypePane { + + protected String[] getTypeIconPath() { + return new String[]{"/com/fr/van/chart/box.images/box.png" + }; + } + + protected Plot getSelectedClonedPlot() { + VanChartBoxPlot newPlot = null; + + Chart[] boxChartGroup = BoxIndependentVanChart.BoxVanChartTypes; + + for (int i = 0, len = boxChartGroup.length; i < len; i++) { + if (typeDemo.get(i).isPressing) { + newPlot = boxChartGroup[i].getPlot(); + } + } + + Plot cloned = null; + + try { + if (newPlot != null) { + cloned = (Plot) newPlot.clone(); + } + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In ColumnChart"); + } + + return cloned; + } + + public Chart getDefaultChart() { + return BoxIndependentVanChart.BoxVanChartTypes[0]; + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java new file mode 100644 index 000000000..867f7ec9e --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java @@ -0,0 +1,12 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.van.chart.column.VanChartColumnSeriesPane; + +public class VanChartBoxSeriesPane extends VanChartColumnSeriesPane { + + public VanChartBoxSeriesPane(ChartStylePane parent, Plot plot) { + super(parent, plot); + } +} diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png new file mode 100755 index 000000000..ba9101b2d Binary files /dev/null and b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png b/designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png new file mode 100755 index 000000000..c0ad22d3c Binary files /dev/null and b/designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png differ