Browse Source

CHART-16366 预定义样式标签

persist/11.0
白岳 4 years ago
parent
commit
1b5c883582
  1. 3
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleConditionPane.java
  2. 12
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubbleStylePane.java
  3. 19
      designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java
  4. 2
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnConditionPane.java
  5. 17
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java
  6. 6
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  7. 25
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java
  8. 20
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java
  9. 62
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  10. 31
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java
  11. 50
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  12. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/label/GaugeLabelContentPane.java
  13. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java
  14. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  15. 64
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  16. 30
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java
  17. 47
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java
  18. 4
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/style/VanChartFunnelLabelContentPane.java
  19. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java
  20. 17
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java
  21. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelContentPane.java
  22. 16
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java
  23. 25
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java
  24. 20
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java
  25. 4
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java
  26. 4
      designer-chart/src/main/java/com/fr/van/chart/multilayer/style/VanChartMultiPieLabelContentPane.java
  27. 4
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterConditionPane.java
  28. 31
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterLabelContentPane.java
  29. 4
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterTooltipContentPane.java
  30. 18
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java
  31. 24
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java
  32. 30
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java
  33. 25
      designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java
  34. 4
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java
  35. 17
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java
  36. 4
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelContentPane.java
  37. 16
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java
  38. 25
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java
  39. 20
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java

3
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()));
}

12
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<BasicPane> paneList) {
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){
paneList.add(new VanChartForceBubbleLabelPane(VanChartBubbleStylePane.this));
} else {
super.createVanChartLabelPane(paneList);
}
}
protected void addVanChartTooltipPane(List<BasicPane> paneList){
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){

19
designer-chart/src/main/java/com/fr/van/chart/bubble/force/VanChartForceBubbleLabelPane.java

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

2
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));

17
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnLabelConditionPane.java

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

6
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();

25
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelNoCheckPane.java

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

20
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java

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

62
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<? extends Plot>, Class<? extends VanChartPlotLabelPane>> 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<? extends Plot>, Class<? extends VanChartTooltipContentPane>> tooltipContentMap = new HashMap<Class<? extends Plot>, Class<? extends VanChartTooltipContentPane>>();
@ -212,19 +203,24 @@ public class PlotFactory {
* @return 标签界面
*/
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane) {
Class<? extends Plot> key = plot.getClass();
if (labelMap.containsKey(key)) {
try {
Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key);
Constructor<? extends VanChartPlotLabelPane> 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<? extends Plot> key = plot.getClass();
//力学气泡图特殊
if (plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new VanChartLabelContentPane(parent, showOnPane, inCondition);
}
if (labelContentMap.containsKey(key)) {
try {
Class<? extends VanChartTooltipContentPane> cl = labelContentMap.get(key);
Constructor<? extends VanChartTooltipContentPane> constructor = cl.getConstructor(VanChartStylePane.class, JPanel.class);
return constructor.newInstance(parent, showOnPane);
Constructor<? extends VanChartTooltipContentPane> 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);
}
/**

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

50
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -93,8 +93,14 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private JPanel showOnPane;
private AttrTooltipRichText richText;
private boolean inCondition;
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane){
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) {
this(parent, showOnPane, false);
}
public VanChartTooltipContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) {
this.inCondition = inCondition;
this.parent = parent;
this.showOnPane = showOnPane;
this.richText = new AttrTooltipRichText();
@ -103,7 +109,19 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
initRichTextFormatPane(parent, showOnPane);
this.setLayout(new BorderLayout());
this.add(createLabelContentPane(),BorderLayout.CENTER);
this.add(createLabelContentPane(), BorderLayout.CENTER);
}
public boolean isInCondition() {
return inCondition;
}
public ChartTextAttrPane getTextAttrPane() {
return textAttrPane;
}
public void setTextAttrPane(ChartTextAttrPane textAttrPane) {
this.textAttrPane = textAttrPane;
}
public CategoryNameFormatPaneWithCheckBox getCategoryNameFormatPane() {
@ -336,7 +354,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{f, e});
}
private JPanel createCommonStylePane() {
public JPanel createCommonStylePane() {
styleButton = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Automatic"),
Toolkit.i18nText("Fine-Design_Chart_Custom")
@ -374,7 +392,9 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
private void checkStylePane() {
if (hasTextStylePane()) {
stylePanel.setVisible(true);
if (styleButton != null) {
textAttrPane.setVisible(styleButton.getSelectedIndex() == TEXT_ATTR_CUSTOM_INDEX);
}
} else {
stylePanel.setVisible(false);
}
@ -485,8 +505,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
}
protected double[] getRowSize(double p){
return new double[]{p,p,p,p};
protected double[] getRowSize(double p) {
return new double[]{p, p, p, p};
}
protected Component[][] getPaneComponents() {
@ -595,8 +615,8 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
@Override
public void populateBean(AttrTooltipContent attrTooltipContent){
if(attrTooltipContent == null){
public void populateBean(AttrTooltipContent attrTooltipContent) {
if (attrTooltipContent == null) {
return;
}
@ -606,11 +626,13 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
populateRichEditor(attrTooltipContent);
}
if (hasTextStylePane()) {
if (styleButton != null) {
if (attrTooltipContent.isCustom()) {
styleButton.setSelectedIndex(TEXT_ATTR_CUSTOM_INDEX);
} else {
styleButton.setSelectedIndex(TEXT_ATTR_AUTO_INDEX);
}
}
this.textAttrPane.populate(attrTooltipContent.getTextAttr());
}
@ -735,16 +757,22 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
updateRichEditor(attrTooltipContent);
updateTooltipRichText(attrTooltipContent);
}
if (hasTextStylePane()) {
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == TEXT_ATTR_CUSTOM_INDEX);
attrTooltipContent.setTextAttr(this.textAttrPane.update());
}
updateTextAttr(attrTooltipContent);
htmlLabelPane.update(attrTooltipContent.getHtmlLabel());
return attrTooltipContent;
}
public void updateTextAttr(AttrTooltipContent attrTooltipContent) {
if (hasTextStylePane()) {
if (styleButton != null) {
attrTooltipContent.setCustom(styleButton.getSelectedIndex() == TEXT_ATTR_CUSTOM_INDEX);
}
attrTooltipContent.setTextAttr(this.textAttrPane.update());
}
}
private void updateLabelType(AttrTooltipContent attrTooltipContent) {
if (supportRichEditor()) {
attrTooltipContent.setCommon(content.getSelectedIndex() == COMMON_INDEX);

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

@ -13,7 +13,7 @@ import javax.swing.JPanel;
public class GaugeLabelContentPane extends VanChartLabelContentPane {
public GaugeLabelContentPane(VanChartStylePane parent, JPanel showOnPane) {
super(parent, showOnPane);
super(parent, showOnPane, false);
}
protected String getLabelContentTitle() {

5
designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java

@ -4,7 +4,7 @@ import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Plot;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelNoCheckPane;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane;
import javax.swing.JPanel;
@ -26,7 +26,7 @@ public class VanChartLabelConditionPane extends AbstractNormalMultiLineCondition
}
protected VanChartPlotLabelPane createLabelPane() {
return new VanChartPlotLabelNoCheckPane(getPlot(),null);
return PlotFactory.createPlotLabelPane(getPlot(), null, true);
}
public VanChartLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) {
@ -35,6 +35,7 @@ public class VanChartLabelConditionPane extends AbstractNormalMultiLineCondition
/**
* 条件属性item的名称
*
* @return item的名称
*/
public String nameForPopupMenuItem() {

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -41,7 +41,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
private ChartTextAttrPane textFontPane;
public VanChartGaugeLabelDetailPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
super(plot, parent, false);
}
protected void initLabelDetailPane(Plot plot) {

64
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -58,13 +58,19 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private VanChartStylePane parent;
private Plot plot;
private boolean inCondition;
public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent) {
public VanChartPlotLabelDetailPane(Plot plot, VanChartStylePane parent, boolean inCondition) {
this.inCondition = inCondition;
this.parent = parent;
this.plot = plot;
initLabelDetailPane(plot);
}
public boolean isInCondition() {
return inCondition;
}
public BasicBeanPane<AttrTooltipContent> 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,13 +128,13 @@ 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}
new Component[]{dataLabelContentPane, null}
};
}
@ -140,7 +146,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}
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());
}
}

30
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelNoCheckPane.java

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

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

4
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){

4
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) {

17
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java

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

4
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) {

16
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelDetailPane.java

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

25
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java

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

20
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelPane.java

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

4
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

4
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

4
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()));
}
}

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

4
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){

18
designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterLabelConditionPane.java

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

24
designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelDetailPane.java

@ -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;
/**
* 散点图的分类多xy标签
*/
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));
}
}

30
designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelNoCheckPane.java

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

25
designer-chart/src/main/java/com/fr/van/chart/scatter/component/label/VanChartScatterPlotLabelPane.java

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

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

17
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java

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

4
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

16
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelDetailPane.java

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

25
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java

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

20
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelPane.java

@ -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);
}
}
Loading…
Cancel
Save