From 1b5c8835827033a758b2a6ee2b65352ff80badb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 23 Oct 2020 13:57:57 +0800 Subject: [PATCH] =?UTF-8?q?CHART-16366=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bubble/VanChartBubbleConditionPane.java | 3 +- .../chart/bubble/VanChartBubbleStylePane.java | 12 ---- .../force/VanChartForceBubbleLabelPane.java | 19 ------ .../column/VanChartColumnConditionPane.java | 2 +- .../VanChartColumnLabelConditionPane.java | 17 ----- .../VanChartColumnPlotLabelDetailPane.java | 6 +- .../VanChartColumnPlotLabelNoCheckPane.java | 25 ------- .../column/VanChartColumnPlotLabelPane.java | 20 ------ .../fr/van/chart/designer/PlotFactory.java | 64 ++++++++--------- .../component/VanChartLabelContentPane.java | 31 ++++++++- .../component/VanChartTooltipContentPane.java | 62 ++++++++++++----- .../label/GaugeLabelContentPane.java | 2 +- .../item/VanChartLabelConditionPane.java | 5 +- .../label/VanChartGaugeLabelDetailPane.java | 2 +- .../label/VanChartPlotLabelDetailPane.java | 68 ++++++++++--------- .../label/VanChartPlotLabelNoCheckPane.java | 30 -------- .../style/label/VanChartPlotLabelPane.java | 47 ++++++++----- .../style/VanChartFunnelLabelContentPane.java | 4 +- .../other/VanChartGanttConditionPane.java | 4 +- .../VanChartGanttLabelConditionPane.java | 17 ----- .../label/VanChartGanttLabelContentPane.java | 4 +- .../VanChartGanttPlotLabelDetailPane.java | 16 ----- .../VanChartGanttPlotLabelNoCheckPane.java | 25 ------- .../label/VanChartGanttPlotLabelPane.java | 20 ------ .../label/VanChartMapLabelContentPane.java | 4 +- .../VanChartMultiPieLabelContentPane.java | 4 +- .../scatter/VanChartScatterConditionPane.java | 4 +- .../VanChartScatterLabelContentPane.java | 31 ++++++++- .../VanChartScatterTooltipContentPane.java | 4 ++ .../VanChartScatterLabelConditionPane.java | 18 ----- .../VanChartScatterPlotLabelDetailPane.java | 24 ------- .../VanChartScatterPlotLabelNoCheckPane.java | 30 -------- .../label/VanChartScatterPlotLabelPane.java | 25 ------- .../other/VanChartStructureConditionPane.java | 4 +- .../VanChartStructureLabelConditionPane.java | 17 ----- .../VanChartStructureLabelContentPane.java | 4 +- .../VanChartStructurePlotLabelDetailPane.java | 16 ----- ...VanChartStructurePlotLabelNoCheckPane.java | 25 ------- .../style/VanChartStructurePlotLabelPane.java | 20 ------ 39 files changed, 232 insertions(+), 503 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionPane.java index 4ee071987..18408d7e7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionPane.java @@ -20,7 +20,6 @@ import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPan import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; -import com.fr.van.chart.scatter.component.label.VanChartScatterLabelConditionPane; import com.fr.van.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; import java.awt.Dimension; @@ -66,7 +65,7 @@ public class VanChartBubbleConditionPane extends DataSeriesConditionPane { } private void addNormalAction() { - classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); + classPaneMap.put(ScatterAttrLabel.class, new VanChartLabelConditionPane(this, plot)); classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot)); classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect())); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java index 63ebd17bb..de4e88070 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java @@ -6,7 +6,6 @@ import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.van.chart.bubble.force.VanChartForceBubbleAreaPane; -import com.fr.van.chart.bubble.force.VanChartForceBubbleLabelPane; import com.fr.van.chart.bubble.force.VanChartForceBubbleTooltipPane; import com.fr.van.chart.designer.style.background.VanChartAreaPane; import com.fr.van.chart.scatter.component.VanChartScatterStylePane; @@ -22,17 +21,6 @@ public class VanChartBubbleStylePane extends VanChartScatterStylePane { super(listener); } - @Override - protected void createVanChartLabelPane(List paneList) { - Plot plot = getChart().getPlot(); - - if(((VanChartBubblePlot) plot).isForceBubble()){ - paneList.add(new VanChartForceBubbleLabelPane(VanChartBubbleStylePane.this)); - } else { - super.createVanChartLabelPane(paneList); - } - } - protected void addVanChartTooltipPane(List paneList){ Plot plot = getChart().getPlot(); if(((VanChartBubblePlot) plot).isForceBubble()){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java deleted file mode 100644 index 13bcac26e..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.fr.van.chart.bubble.force; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartLabelPane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -/** - * Created by Mitisky on 16/3/31. - */ -public class VanChartForceBubbleLabelPane extends VanChartLabelPane { - public VanChartForceBubbleLabelPane(VanChartStylePane parent) { - super(parent); - } - - protected VanChartPlotLabelPane getLabelPane(Plot plot) { - return new VanChartPlotLabelPane(plot, parent); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java index 3f9978f75..c4184f3b1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java @@ -49,7 +49,7 @@ public class VanChartColumnConditionPane extends DataSeriesConditionPane{ classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this)); - classPaneMap.put(AttrLabel.class, new VanChartColumnLabelConditionPane(this, plot)); + classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this)); classPaneMap.put(AttrSeriesImageBackground.class, new VanChartSeriesImageBackgroundConditionPane(this)); diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java deleted file mode 100644 index ec870a98f..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fr.van.chart.column; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -public class VanChartColumnLabelConditionPane extends VanChartLabelConditionPane { - - public VanChartColumnLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { - super(conditionAttributesPane, plot); - } - - protected VanChartPlotLabelPane createLabelPane() { - return new VanChartColumnPlotLabelNoCheckPane(getPlot(),null); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java index a2be5f290..b2b287087 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -12,12 +12,12 @@ import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { - public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); + public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) { + super(plot, parent, inCondition); } protected void initToolTipContentPane(Plot plot) { - VanChartLabelContentPane dataLabelContentPane = new VanChartLabelContentPane(getParentPane(), VanChartColumnPlotLabelDetailPane.this) { + VanChartLabelContentPane dataLabelContentPane = new VanChartLabelContentPane(getParentPane(), VanChartColumnPlotLabelDetailPane.this, isInCondition()) { protected void checkCardPane() { super.checkCardPane(); checkOrientationPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java deleted file mode 100644 index b08734782..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.van.chart.column; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; - -import java.awt.BorderLayout; - -public class VanChartColumnPlotLabelNoCheckPane extends VanChartColumnPlotLabelPane { - - public VanChartColumnPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void addComponents() { - this.setLayout(new BorderLayout()); - this.add(getLabelPane(), BorderLayout.CENTER); - } - - public void populate(AttrLabel attr) { - super.populate(attr); - getLabelShowCheckBox().setSelected(true); - getLabelPane().setVisible(true); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java deleted file mode 100644 index e80f6310d..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.van.chart.column; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -import java.awt.BorderLayout; - -public class VanChartColumnPlotLabelPane extends VanChartPlotLabelPane { - - public VanChartColumnPlotLabelPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void createLabelPane() { - VanChartColumnPlotLabelDetailPane labelDetailPane = new VanChartColumnPlotLabelDetailPane(getPlot(), getParentPane()); - setLabelDetailPane(labelDetailPane); - getLabelPane().add(labelDetailPane, BorderLayout.CENTER); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java index 93d8b0289..46126d277 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java @@ -24,7 +24,7 @@ import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.van.chart.bubble.force.VanChartBubbleRefreshTooltipPane; -import com.fr.van.chart.column.VanChartColumnPlotLabelPane; +import com.fr.van.chart.column.VanChartColumnPlotLabelDetailPane; import com.fr.van.chart.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -35,13 +35,14 @@ import com.fr.van.chart.designer.style.VanChartRangeLegendPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanLegendPaneWidthOutHighlight; import com.fr.van.chart.designer.style.label.VanChartGaugePlotLabelPane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelLabelContentPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelRefreshTooltipContentPane; import com.fr.van.chart.funnel.designer.style.VanChartFunnelTooltipContentPane; -import com.fr.van.chart.gantt.designer.style.label.VanChartGanttPlotLabelPane; +import com.fr.van.chart.gantt.designer.style.label.VanChartGanttLabelContentPane; import com.fr.van.chart.gantt.designer.style.tooltip.VanChartGanttPlotTooltipPane; import com.fr.van.chart.gantt.designer.style.tooltip.VanChartGanttTooltipContentPane; import com.fr.van.chart.gauge.VanChartGaugePlotRefreshTooltipPane; @@ -53,10 +54,10 @@ import com.fr.van.chart.multilayer.style.VanChartMultiPieLabelContentPane; import com.fr.van.chart.multilayer.style.VanChartMultiPiePlotTooltipPane; import com.fr.van.chart.multilayer.style.VanChartMultiPieTooltipContentPane; import com.fr.van.chart.multilayer.style.VanChartMutiPieRefreshTooltipContentPane; +import com.fr.van.chart.scatter.VanChartScatterLabelContentPane; import com.fr.van.chart.scatter.VanChartScatterPlotTooltipPane; import com.fr.van.chart.scatter.VanChartScatterRefreshTooltipContentPane; -import com.fr.van.chart.scatter.component.label.VanChartScatterPlotLabelPane; -import com.fr.van.chart.structure.desinger.style.VanChartStructurePlotLabelPane; +import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelContentPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureRefreshTooltipContentPane; import com.fr.van.chart.structure.desinger.style.VanChartStructureTooltipContentPane; import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudRefreshTooltipContentPane; @@ -105,20 +106,6 @@ public class PlotFactory { return borderAndBackgroundLabelPlots.contains(plot.getClass()); } - /** - * 标签Map - */ - private static Map, Class> labelMap = new HashMap<>(); - - static { - labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); - labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class); - labelMap.put(VanChartScatterPlot.class, VanChartScatterPlotLabelPane.class); - labelMap.put(VanChartBubblePlot.class, VanChartScatterPlotLabelPane.class); - labelMap.put(VanChartGanttPlot.class, VanChartGanttPlotLabelPane.class); - labelMap.put(VanChartStructurePlot.class, VanChartStructurePlotLabelPane.class); - } - /** * 图例Map */ @@ -158,6 +145,10 @@ public class PlotFactory { labelContentMap.put(VanChartTreeMapPlot.class, VanChartMultiPieLabelContentPane.class); labelContentMap.put(VanChartFunnelPlot.class, VanChartFunnelLabelContentPane.class); labelContentMap.put(VanChartHeatMapPlot.class, VanChartMapLabelContentPane.class); + labelContentMap.put(VanChartBubblePlot.class, VanChartScatterLabelContentPane.class); + labelContentMap.put(VanChartScatterPlot.class, VanChartScatterLabelContentPane.class); + labelContentMap.put(VanChartStructurePlot.class, VanChartStructureLabelContentPane.class); + labelContentMap.put(VanChartGanttPlot.class, VanChartGanttLabelContentPane.class); } private static Map, Class> tooltipContentMap = new HashMap, Class>(); @@ -212,19 +203,24 @@ public class PlotFactory { * @return 标签界面 */ public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) { - Class key = plot.getClass(); - if (labelMap.containsKey(key)) { - try { - Class cl = labelMap.get(key); - Constructor constructor = cl.getConstructor(Plot.class, VanChartStylePane.class); - return constructor.newInstance(plot, stylePane); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + return createPlotLabelPane(plot, stylePane, false); + } + + public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { + if (plot instanceof VanChartGaugePlot) { + return new VanChartGaugePlotLabelPane(plot, stylePane); + } + return new VanChartPlotLabelPane(plot, stylePane, inCondition); + } + + public static VanChartPlotLabelDetailPane createPlotLabelDetailPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { + if (plot instanceof VanChartColumnPlot) { + return new VanChartColumnPlotLabelDetailPane(plot, stylePane, inCondition); } - return new VanChartPlotLabelPane(plot, stylePane); + return new VanChartPlotLabelDetailPane(plot, stylePane, inCondition); } + /** * 根据图表类型创建图例界面 * @@ -275,18 +271,22 @@ public class PlotFactory { * @param showOnPane formatpane用到 * @return 标签的具体内容界面 */ - public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane) { + public static VanChartTooltipContentPane createPlotLabelContentPane(Plot plot, VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { Class key = plot.getClass(); + //力学气泡图特殊 + if (plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) { + return new VanChartLabelContentPane(parent, showOnPane, inCondition); + } if (labelContentMap.containsKey(key)) { try { Class cl = labelContentMap.get(key); - Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class); - return constructor.newInstance(parent, showOnPane); + Constructor constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class, boolean.class); + return constructor.newInstance(parent, showOnPane, inCondition); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - return new VanChartLabelContentPane(parent, showOnPane); + return new VanChartLabelContentPane(parent, showOnPane, inCondition); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 957fcdaf7..18745f915 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -1,17 +1,19 @@ package com.fr.van.chart.designer.component; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.type.TextAlign; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; +import java.awt.BorderLayout; public class VanChartLabelContentPane extends VanChartTooltipContentPane { private static final long serialVersionUID = 5630276526789839288L; - public VanChartLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } protected VanChartHtmlLabelPane createHtmlLabelPane() { @@ -21,4 +23,29 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { protected AttrTooltipContent createAttrTooltip() { return new AttrTooltipContent(TextAlign.CENTER); } + + public JPanel createCommonStylePane() { + if (isInCondition()) { + return super.createCommonStylePane(); + } + setTextAttrPane(new ChartTextAttrPaneWithPreStyle()); + + JPanel stylePanel = new JPanel(new BorderLayout()); + stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); + + return stylePanel; + } + + public void updateTextAttr(AttrTooltipContent attrTooltipContent) { + if (isInCondition()) { + super.updateTextAttr(attrTooltipContent); + return; + } + if (hasTextStylePane()) { + this.getTextAttrPane().update(attrTooltipContent.getTextAttr()); + if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) { + attrTooltipContent.setCustom(true); + } + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b890232fe..cc04d9c51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -93,8 +93,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Custom") @@ -374,7 +392,9 @@ public class VanChartTooltipContentPane extends BasicBeanPane getDataLabelContentPane() { return dataLabelContentPane; } @@ -77,11 +83,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return parent; } - protected void initLabelDetailPane (Plot plot) { + protected void initLabelDetailPane(Plot plot) { this.setLayout(new BorderLayout()); initToolTipContentPane(plot); JPanel contentPane = createLabelPane(plot); - this.add(contentPane,BorderLayout.CENTER); + this.add(contentPane, BorderLayout.CENTER); } public Plot getPlot() { @@ -94,7 +100,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { //默认从factory中取 protected void initToolTipContentPane(Plot plot) { - dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this); + dataLabelContentPane = PlotFactory.createPlotLabelContentPane(plot, parent, VanChartPlotLabelDetailPane.this, inCondition); } private JPanel createLabelPane(Plot plot) { @@ -109,12 +115,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { - if(hasLabelPosition(plot)){ + if (hasLabelPosition(plot)) { // 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景 if (hasBorderAndBackground(plot)) { return new Component[][]{ - new Component[]{dataLabelContentPane,null}, + new Component[]{dataLabelContentPane, null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, new Component[]{createLabelBorderPane(), null}, new Component[]{createLabelBackgroundPane(), null} @@ -122,25 +128,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } return new Component[][]{ - new Component[]{dataLabelContentPane,null}, + new Component[]{dataLabelContentPane, null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} }; } - return new Component[][]{ - new Component[]{dataLabelContentPane,null} + return new Component[][]{ + new Component[]{dataLabelContentPane, null} }; } private JPanel createLabelBorderPane() { - borderPane = new VanChartBorderWithShapePane(); + borderPane = new VanChartBorderWithShapePane(); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); return borderPaneWithTitle; } private JPanel createLabelBackgroundPane() { - backgroundPane = new VanChartBackgroundWithOutImagePane(){ + backgroundPane = new VanChartBackgroundWithOutImagePane() { protected Component[][] getPaneComponents() { return new Component[][]{ @@ -162,7 +168,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected double[] getLabelPaneRowSize(Plot plot, double p) { - return hasLabelPosition(plot) ? new double[]{p,p,p,p,p} : new double[]{p,p,p}; + return hasLabelPosition(plot) ? new double[]{p, p, p, p, p} : new double[]{p, p, p}; } protected boolean hasLabelPosition(Plot plot) { @@ -282,7 +288,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } } - protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ + protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { return TableLayoutHelper.createTableLayoutPane(comps, row, col); } @@ -295,8 +301,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { }); } - protected ChartTextAttrPane initTextFontPane () { - return new ChartTextAttrPane(){ + protected ChartTextAttrPane initTextFontPane() { + return new ChartTextAttrPane() { protected Component[][] getComponents(JPanel buttonPane) { return new Component[][]{ new Component[]{null, null}, @@ -317,7 +323,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkAllUse() { - if(tractionLine == null){ + if (tractionLine == null) { return; } checkPositionEnabled(); @@ -341,33 +347,33 @@ public class VanChartPlotLabelDetailPane extends BasicPane { tractionLinePane.setVisible(position.getSelectedItem() == Constants.OUTSIDE); } - protected void checkPane(){ + protected void checkPane() { checkPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")); } public void populate(AttrLabelDetail detail) { checkPane(); dataLabelContentPane.populateBean(detail.getContent()); - if(position != null){ + if (position != null) { position.setSelectedItem(detail.getPosition()); } - if(orientation != null){ + if (orientation != null) { orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); } - if(tractionLine != null){ + if (tractionLine != null) { tractionLine.setSelected(detail.isShowGuidLine()); } - if(autoAdjust != null){ + if (autoAdjust != null) { autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); } - if(backgroundColor != null){ + if (backgroundColor != null) { backgroundColor.setSelectObject(detail.getBackgroundColor()); } - if(borderPane != null){ + if (borderPane != null) { borderPane.populate(detail.getBorder()); } - if(backgroundPane != null){ + if (backgroundPane != null) { backgroundPane.populate(detail.getBackground()); } @@ -379,28 +385,28 @@ public class VanChartPlotLabelDetailPane extends BasicPane { public void update(AttrLabelDetail detail) { detail.setContent(dataLabelContentPane.updateBean()); - if(position != null && position.getSelectedItem() != null){ + if (position != null && position.getSelectedItem() != null) { detail.setPosition(position.getSelectedItem()); - } else if(position != null){ + } else if (position != null) { position.setSelectedItem(detail.getPosition()); } detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); - if(orientation != null){ + if (orientation != null) { detail.setHorizontal(orientation.getSelectedIndex() == 0); } - if(tractionLine != null){ + if (tractionLine != null) { detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); } - if(backgroundColor != null){ + if (backgroundColor != null) { detail.setBackgroundColor(backgroundColor.getSelectObject()); } - if(borderPane != null){ + if (borderPane != null) { borderPane.update(detail.getBorder()); } - if(backgroundPane != null){ + if (backgroundPane != null) { backgroundPane.update(detail.getBackground()); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java deleted file mode 100644 index beb89e5d7..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fr.van.chart.designer.style.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; - -import java.awt.BorderLayout; - -/** - * 条件属性中用到 - */ -public class VanChartPlotLabelNoCheckPane extends VanChartPlotLabelPane { - - private static final long serialVersionUID = 8124894034484334810L; - - public VanChartPlotLabelNoCheckPane(Plot plot,VanChartStylePane parent) { - super(plot, parent); - } - - protected void addComponents() { - this.setLayout(new BorderLayout()); - this.add(getLabelPane(),BorderLayout.CENTER); - } - - public void populate(AttrLabel attr) { - super.populate(attr); - getLabelShowCheckBox().setSelected(true); - getLabelPane().setVisible(true); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java index f1fa6f0f1..71ad599fd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java @@ -6,7 +6,6 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrLabel; import com.fr.van.chart.designer.PlotFactory; @@ -29,19 +28,22 @@ public class VanChartPlotLabelPane extends BasicPane { private JPanel labelPane; + private boolean inCondition; + public VanChartPlotLabelPane(Plot plot, VanChartStylePane parent) { + this(plot, parent, false); + } + + public VanChartPlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) { this.parent = parent; this.plot = plot; + this.inCondition = inCondition; isLabelShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Label")); labelPane = new JPanel(new BorderLayout(0, 4)); createLabelPane(); addComponents(); } - public UICheckBox getLabelShowCheckBox() { - return isLabelShow; - } - public VanChartPlotLabelDetailPane getLabelDetailPane() { return labelDetailPane; } @@ -67,31 +69,38 @@ public class VanChartPlotLabelPane extends BasicPane { } protected void createLabelPane() { - labelDetailPane = new VanChartPlotLabelDetailPane(this.plot, this.parent); + labelDetailPane = createPlotLabelDetailPane(); labelPane.add(labelDetailPane, BorderLayout.CENTER); } protected void addComponents() { + this.setLayout(new BorderLayout()); + this.add(getCenterPane(), BorderLayout.CENTER); + } + + private JPanel getCenterPane() { + if (inCondition) { + return labelPane; + } double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p,p}; + double[] rowSize = {p, p}; Component[][] components = new Component[][]{ new Component[]{isLabelShow}, new Component[]{labelPane} }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - this.setLayout(new BorderLayout()); - this.add(panel,BorderLayout.CENTER); - isLabelShow.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { checkBoxUse(); } }); + + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return panel; } + @Override protected String title4PopupWindow() { return null; @@ -99,7 +108,7 @@ public class VanChartPlotLabelPane extends BasicPane { private void checkBoxUse() { labelPane.setVisible(isLabelShow.isSelected()); - if(checkEnabled4Large()) { + if (checkEnabled4Large()) { isLabelShow.setEnabled(!PlotFactory.largeDataModel(plot)); } } @@ -109,10 +118,11 @@ public class VanChartPlotLabelPane extends BasicPane { } public void populate(AttrLabel attr) { - if(attr == null) { - attr = ((VanChartPlot)this.plot).getDefaultAttrLabel(); + if (attr == null) { + attr = ((VanChartPlot) this.plot).getDefaultAttrLabel(); } - isLabelShow.setSelected(attr.isEnable()); + + isLabelShow.setSelected(inCondition ? true : attr.isEnable()); labelDetailPane.populate(attr.getAttrLabelDetail()); @@ -121,7 +131,7 @@ public class VanChartPlotLabelPane extends BasicPane { public AttrLabel update() { //刪除返回null,否則無法保存不顯示標籤的屬性 - AttrLabel attrLabel = ((VanChartPlot)this.plot).getDefaultAttrLabel(); + AttrLabel attrLabel = ((VanChartPlot) this.plot).getDefaultAttrLabel(); attrLabel.setEnable(isLabelShow.isSelected()); labelDetailPane.update(attrLabel.getAttrLabelDetail()); @@ -129,4 +139,7 @@ public class VanChartPlotLabelPane extends BasicPane { return attrLabel; } + public VanChartPlotLabelDetailPane createPlotLabelDetailPane() { + return PlotFactory.createPlotLabelDetailPane(plot, parent, inCondition); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java index d7b9f9da4..a97225d55 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java @@ -22,8 +22,8 @@ import java.awt.Component; * Created by Mitisky on 16/10/10. */ public class VanChartFunnelLabelContentPane extends VanChartLabelContentPane { - public VanChartFunnelLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartFunnelLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } protected double[] getRowSize(double p){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java index 09d7a4b81..24a5d45fe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java @@ -13,11 +13,11 @@ import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.PlotFactory; +import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipNoCheckPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import com.fr.van.chart.gantt.designer.style.label.VanChartGanttLabelConditionPane; import java.awt.Dimension; @@ -42,7 +42,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); if (!PlotFactory.largeDataModel(plot)) { - classPaneMap.put(AttrGanttLabel.class, new VanChartGanttLabelConditionPane(this, plot)); + classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); } classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java deleted file mode 100644 index 86c3ba942..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fr.van.chart.gantt.designer.style.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -public class VanChartGanttLabelConditionPane extends VanChartLabelConditionPane { - - public VanChartGanttLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { - super(conditionAttributesPane, plot); - } - - protected VanChartPlotLabelPane createLabelPane() { - return new VanChartGanttPlotLabelNoCheckPane(getPlot(), null); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java index cfb1e63a8..69409d34b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java @@ -24,8 +24,8 @@ public class VanChartGanttLabelContentPane extends VanChartLabelContentPane { private VanChartFormatComBoxWithCheckBox durationFormatPane; private VanChartFormatPaneWithCheckBox progressFormatPane; - public VanChartGanttLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartGanttLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java deleted file mode 100644 index e00e0afd4..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fr.van.chart.gantt.designer.style.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; - -public class VanChartGanttPlotLabelDetailPane extends VanChartPlotLabelDetailPane { - - public VanChartGanttPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void initToolTipContentPane(Plot plot) { - setDataLabelContentPane(new VanChartGanttLabelContentPane(getParentPane(), VanChartGanttPlotLabelDetailPane.this)); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java deleted file mode 100644 index 4743a545d..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.van.chart.gantt.designer.style.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; - -import java.awt.BorderLayout; - -public class VanChartGanttPlotLabelNoCheckPane extends VanChartGanttPlotLabelPane { - - public VanChartGanttPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void addComponents() { - this.setLayout(new BorderLayout()); - this.add(getLabelPane(), BorderLayout.CENTER); - } - - public void populate(AttrLabel attr) { - super.populate(attr); - getLabelShowCheckBox().setSelected(true); - getLabelPane().setVisible(true); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java deleted file mode 100644 index 546f772dd..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.van.chart.gantt.designer.style.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -import java.awt.BorderLayout; - -public class VanChartGanttPlotLabelPane extends VanChartPlotLabelPane { - - public VanChartGanttPlotLabelPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void createLabelPane() { - VanChartGanttPlotLabelDetailPane labelDetailPane = new VanChartGanttPlotLabelDetailPane(getPlot(), getParentPane()); - setLabelDetailPane(labelDetailPane); - getLabelPane().add(labelDetailPane, BorderLayout.CENTER); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java index 95e286458..084953c99 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java @@ -21,8 +21,8 @@ import javax.swing.JPanel; * Created by Mitisky on 16/5/20. */ public class VanChartMapLabelContentPane extends VanChartLabelContentPane { - public VanChartMapLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartMapLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java index 09093b099..73e766afc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java @@ -16,8 +16,8 @@ import javax.swing.JPanel; * Created by Fangjie on 2016/6/15. */ public class VanChartMultiPieLabelContentPane extends VanChartLabelContentPane { - public VanChartMultiPieLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartMultiPieLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java index c1e7886c9..4bd463c80 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java @@ -17,11 +17,11 @@ import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip; import com.fr.van.chart.bubble.VanChartBubbleConditionSelectionPane; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.other.condition.item.VanChartEffectConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTrendLineConditionPane; import com.fr.van.chart.scatter.component.VanChartScatterLineTypeConditionPane; import com.fr.van.chart.scatter.component.VanChartScatterMarkerConditionPane; -import com.fr.van.chart.scatter.component.label.VanChartScatterLabelConditionPane; import com.fr.van.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane; import com.fr.van.chart.scatter.large.VanChartScatterLargeModelMarkerConditionPane; @@ -57,7 +57,7 @@ public class VanChartScatterConditionPane extends DataSeriesConditionPane { } else { classPaneMap.put(VanChartAttrLine.class, new VanChartScatterLineTypeConditionPane(this)); classPaneMap.put(VanChartAttrMarker.class, new VanChartScatterMarkerConditionPane(this)); - classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot)); + classPaneMap.put(ScatterAttrLabel.class, new VanChartLabelConditionPane(this, plot)); classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getScatterPlotDefaultEffect())); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java index 160cfb25e..9a48756cc 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java @@ -1,10 +1,13 @@ package com.fr.van.chart.scatter; +import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithPreStyle; +import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.van.chart.designer.component.VanChartHtmlLabelPane; import com.fr.van.chart.designer.component.VanChartHtmlLabelPaneWithBackGroundLabel; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; +import java.awt.BorderLayout; /** * 散点图标签界面 @@ -12,8 +15,8 @@ import javax.swing.JPanel; public class VanChartScatterLabelContentPane extends VanChartScatterTooltipContentPane{ private static final long serialVersionUID = 5595016643808487922L; - public VanChartScatterLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartScatterLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } @Override @@ -21,4 +24,28 @@ public class VanChartScatterLabelContentPane extends VanChartScatterTooltipCont return new VanChartHtmlLabelPaneWithBackGroundLabel(); } + public JPanel createCommonStylePane() { + if (isInCondition()) { + return super.createCommonStylePane(); + } + setTextAttrPane(new ChartTextAttrPaneWithPreStyle()); + + JPanel stylePanel = new JPanel(new BorderLayout()); + stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); + + return stylePanel; + } + + public void updateTextAttr(AttrTooltipContent attrTooltipContent) { + if (isInCondition()) { + super.updateTextAttr(attrTooltipContent); + return; + } + if (hasTextStylePane()) { + this.getTextAttrPane().update(attrTooltipContent.getTextAttr()); + if (!attrTooltipContent.getTextAttr().isPredefinedStyle()) { + attrTooltipContent.setCustom(true); + } + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java index 0933ce8a5..39b20bedb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java @@ -58,6 +58,10 @@ public class VanChartScatterTooltipContentPane extends VanChartTooltipContentPa super(parent, showOnPane); } + public VanChartScatterTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition){ + super(parent, showOnPane, inCondition); + } + @Override protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java deleted file mode 100644 index 2ff71ee0c..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.van.chart.scatter.component.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -public class VanChartScatterLabelConditionPane extends VanChartLabelConditionPane { - - public VanChartScatterLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { - super(conditionAttributesPane, plot); - } - - @Override - protected VanChartPlotLabelPane createLabelPane() { - return new VanChartScatterPlotLabelNoCheckPane(getPlot(), null); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java deleted file mode 100644 index a78261f65..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.fr.van.chart.scatter.component.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; -import com.fr.van.chart.scatter.VanChartScatterLabelContentPane; - - - -/** - * 散点图的分类,多x、y标签 - */ -public class VanChartScatterPlotLabelDetailPane extends VanChartPlotLabelDetailPane { - - private static final long serialVersionUID = 5176535960949074940L; - public VanChartScatterPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - @Override - protected void initToolTipContentPane(Plot plot) { - setDataLabelContentPane(new VanChartScatterLabelContentPane(getParentPane(),VanChartScatterPlotLabelDetailPane.this)); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java deleted file mode 100644 index a40918073..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.fr.van.chart.scatter.component.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; - -import java.awt.BorderLayout; - -/** - * 条件属性中用到 - */ -public class VanChartScatterPlotLabelNoCheckPane extends VanChartScatterPlotLabelPane { - - private static final long serialVersionUID = 8124894034484334810L; - - public VanChartScatterPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void addComponents() { - this.setLayout(new BorderLayout()); - this.add(getLabelPane(), BorderLayout.CENTER); - } - - public void populate(AttrLabel attr) { - super.populate(attr); - getLabelShowCheckBox().setSelected(true); - getLabelPane().setVisible(true); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java deleted file mode 100644 index 2830b4c3b..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.van.chart.scatter.component.label; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -import java.awt.BorderLayout; - -/** - * Created by Mitisky on 16/3/1. - */ -public class VanChartScatterPlotLabelPane extends VanChartPlotLabelPane { - private static final long serialVersionUID = 7405875523954797047L; - - public VanChartScatterPlotLabelPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - @Override - protected void createLabelPane() { - VanChartScatterPlotLabelDetailPane labelDetailPane = new VanChartScatterPlotLabelDetailPane(getPlot(), getParentPane()); - setLabelDetailPane(labelDetailPane); - getLabelPane().add(labelDetailPane, BorderLayout.CENTER); - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java index 9a8cf4e45..7fac3034b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java @@ -11,10 +11,10 @@ import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartStructureNodeConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; -import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelConditionPane; import java.awt.Dimension; @@ -47,7 +47,7 @@ public class VanChartStructureConditionPane extends DataSeriesConditionPane { protected void addBasicAction() { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); - classPaneMap.put(AttrLabel.class, new VanChartStructureLabelConditionPane(this, plot)); + classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); classPaneMap.put(AttrNode.class, new VanChartStructureNodeConditionPane(this)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java deleted file mode 100644 index c5c9cf320..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.fr.van.chart.structure.desinger.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.condition.ConditionAttributesPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -public class VanChartStructureLabelConditionPane extends VanChartLabelConditionPane { - - public VanChartStructureLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { - super(conditionAttributesPane, plot); - } - - protected VanChartPlotLabelPane createLabelPane() { - return new VanChartStructurePlotLabelNoCheckPane(getPlot(), null); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java index 4e2036465..beeb7efe9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java @@ -19,8 +19,8 @@ import java.awt.Component; * Created by shine on 2017/2/15. */ public class VanChartStructureLabelContentPane extends VanChartLabelContentPane { - public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane) { - super(parent, showOnPane); + public VanChartStructureLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) { + super(parent, showOnPane, inCondition); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java deleted file mode 100644 index 20e784c52..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.fr.van.chart.structure.desinger.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; - -public class VanChartStructurePlotLabelDetailPane extends VanChartPlotLabelDetailPane { - - public VanChartStructurePlotLabelDetailPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void initToolTipContentPane(Plot plot) { - setDataLabelContentPane(new VanChartStructureLabelContentPane(getParentPane(), VanChartStructurePlotLabelDetailPane.this)); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java deleted file mode 100644 index e7dfb1873..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.van.chart.structure.desinger.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.base.AttrLabel; -import com.fr.van.chart.designer.style.VanChartStylePane; - -import java.awt.BorderLayout; - -public class VanChartStructurePlotLabelNoCheckPane extends VanChartStructurePlotLabelPane { - - public VanChartStructurePlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void addComponents() { - this.setLayout(new BorderLayout()); - this.add(getLabelPane(), BorderLayout.CENTER); - } - - public void populate(AttrLabel attr) { - super.populate(attr); - getLabelShowCheckBox().setSelected(true); - getLabelPane().setVisible(true); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java deleted file mode 100644 index e4cdc99e1..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.van.chart.structure.desinger.style; - -import com.fr.chart.chartattr.Plot; -import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; - -import java.awt.BorderLayout; - -public class VanChartStructurePlotLabelPane extends VanChartPlotLabelPane { - - public VanChartStructurePlotLabelPane(Plot plot, VanChartStylePane parent) { - super(plot, parent); - } - - protected void createLabelPane() { - VanChartStructurePlotLabelDetailPane labelDetailPane = new VanChartStructurePlotLabelDetailPane(getPlot(), getParentPane()); - setLabelDetailPane(labelDetailPane); - getLabelPane().add(labelDetailPane, BorderLayout.CENTER); - } -}