From 83c85c6a09845757eb703be29420237881863057 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 11:47:38 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartColumnPlotLabelDetailPane.java | 17 ++++++ .../column/VanChartColumnPlotLabelPane.java | 20 +++++++ .../fr/van/chart/designer/PlotFactory.java | 2 + .../label/VanChartGaugeLabelDetailPane.java | 5 +- .../label/VanChartGaugePlotLabelPane.java | 57 +++++++++++++++++-- .../label/VanChartPlotLabelDetailPane.java | 42 ++++++++++---- 6 files changed, 126 insertions(+), 17 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java 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 new file mode 100644 index 0000000000..3243bad711 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.column; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelDetailPane; + +public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPane { + + public VanChartColumnPlotLabelDetailPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected boolean hasLabelOrientationPane() { + return !((VanChartColumnPlot) this.getPlot()).isBar(); + } +} 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 new file mode 100644 index 0000000000..e80f6310d5 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelPane.java @@ -0,0 +1,20 @@ +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 aeaefa5b3a..b518b1ec86 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 @@ -23,6 +23,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.designer.component.VanChartLabelContentPane; import com.fr.van.chart.designer.component.VanChartRefreshTooltipContentPane; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; @@ -95,6 +96,7 @@ public class PlotFactory { private static Map, Class> labelMap = new HashMap, Class>(); 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); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index f06e7c1c7c..e1febb26b8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -114,8 +114,9 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { }; } - protected JPanel getLabelPositionPane(Component[][] comps, double[] row, double[] col) { - return TableLayoutHelper.createTableLayoutPane(comps, row, col); + // 仪表盘标签内无布局tab + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return panel; } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java index bd1b9a1757..9bc21a0446 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java @@ -1,13 +1,15 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; - +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.attr.GaugeDetailStyle; import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.design.i18n.Toolkit; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -18,6 +20,9 @@ import java.awt.BorderLayout; public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { private static final long serialVersionUID = -322148616244458359L; + private UIButtonGroup orientation; + private JPanel layoutPane; + private VanChartPlotLabelDetailPane gaugeValueLabelPane; public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) { @@ -41,23 +46,65 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane { } JPanel cateOrPercentPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(cateTitle, getLabelDetailPane()); JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(valueTitle, gaugeValueLabelPane); + + layoutPane = createGaugeLabelLayoutPane(); + getLabelPane().add(cateOrPercentPane, BorderLayout.NORTH); - getLabelPane().add(valuePane, BorderLayout.SOUTH); + getLabelPane().add(valuePane, BorderLayout.CENTER); + getLabelPane().add(layoutPane, BorderLayout.SOUTH); + + checkLayoutPaneVisible(); + } + + private void checkLayoutPaneVisible() { + layoutPane.setVisible(showLayoutPane()); + } + + private boolean showLayoutPane() { + VanChartGaugePlot plot = (VanChartGaugePlot) this.getPlot(); + GaugeDetailStyle gaugeDetailStyle = plot.getGaugeDetailStyle(); + + return plot.getGaugeStyle() == GaugeStyle.THERMOMETER && gaugeDetailStyle != null && gaugeDetailStyle.isHorizontalLayout(); + } + + // 试管仪表盘横行布局时,正常标签外增加布局tab,同时控制百分比和值标签的文本方向 + private JPanel createGaugeLabelLayoutPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); } public void populate(AttrLabel attr) { super.populate(attr); if(gaugeValueLabelPane != null && attr != null){ - gaugeValueLabelPane.populate(attr.getGaugeValueLabelDetail()); + AttrLabelDetail labelDetail = attr.getGaugeValueLabelDetail(); + gaugeValueLabelPane.populate(labelDetail); + orientation.setSelectedIndex(labelDetail.isHorizontal() ? 0 : 1); + + checkLayoutPaneVisible(); } } public AttrLabel update() { AttrLabel attrLabel = super.update(); + if(gaugeValueLabelPane != null && attrLabel != null){ - gaugeValueLabelPane.update(attrLabel.getGaugeValueLabelDetail()); + AttrLabelDetail defaultLabelDetail = attrLabel.getAttrLabelDetail(); + AttrLabelDetail valueLabelDetail = attrLabel.getGaugeValueLabelDetail(); + + gaugeValueLabelPane.update(valueLabelDetail); + + boolean horizontal = orientation.getSelectedIndex() == 0; + defaultLabelDetail.setHorizontal(horizontal); + valueLabelDetail.setHorizontal(horizontal); } + return attrLabel; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 576d0211c8..253a6f8322 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -28,9 +28,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * Created by Mitisky on 15/12/7. @@ -42,6 +39,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIButtonGroup position; private UIButtonGroup autoAdjust; + private UIButtonGroup orientation; private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; @@ -157,8 +155,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { positionPane = new JPanel(); checkPositionPane(title); - panel.add(positionPane, BorderLayout.CENTER); + panel.add(positionPane, BorderLayout.NORTH); + if (hasLabelOrientationPane()) { + panel.add(createLabelOrientationPane(), BorderLayout.CENTER); + } if (plot.isSupportLeadLine()) { tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); @@ -168,7 +169,25 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); } - return panel; + + return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); + } + + protected JPanel getLabelLayoutPane(JPanel panel, String title) { + return createTableLayoutPaneWithTitle(title, panel); + } + + protected boolean hasLabelOrientationPane() { + return false; + } + + private JPanel createLabelOrientationPane() { + orientation = new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), + Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), + }); + + return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Text_Orientation"), orientation); } protected void checkPositionPane(String title) { @@ -205,13 +224,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } } - protected JPanel getLabelPositionPane (Component[][] comps, double[] row, double[] col){ - JPanel panel = TableLayoutHelper.createTableLayoutPane(comps,row,col); - return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Form_Attr_Layout"), panel); + return TableLayoutHelper.createTableLayoutPane(comps, row, col); } - protected void initPositionListener() { position.addChangeListener(new ChangeListener() { @Override @@ -267,11 +283,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(position != null){ position.setSelectedItem(detail.getPosition()); } + if(orientation != null){ + orientation.setSelectedIndex(detail.isHorizontal() ? 0 : 1); + } if(tractionLine != null){ tractionLine.setSelected(detail.isShowGuidLine()); } if(autoAdjust != null){ - autoAdjust.setSelectedIndex(detail.isAutoAdjust() == true ? 0 : 1); + autoAdjust.setSelectedIndex(detail.isAutoAdjust() ? 0 : 1); } if(backgroundColor != null){ @@ -294,6 +313,9 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setAutoAdjust(autoAdjust != null && autoAdjust.getSelectedItem()); + if(orientation != null){ + detail.setHorizontal(orientation.getSelectedIndex() == 0); + } if(tractionLine != null){ detail.setShowGuidLine(tractionLine.isSelected() && detail.getPosition() == Constants.OUTSIDE); } From 5b952eb12466b5ce65a4be0118a9c3a5d713fce4 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 22 Sep 2020 15:22:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E5=92=8C=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/van/chart/designer/PlotFactory.java | 18 +++++- .../label/VanChartPlotLabelDetailPane.java | 61 +++++++++++++++++-- 2 files changed, 73 insertions(+), 6 deletions(-) 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 b518b1ec86..9ea26a5c5b 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 @@ -7,6 +7,7 @@ import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.style.FormatPane; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.column.VanChartColumnPlot; @@ -77,7 +78,7 @@ import java.util.Set; */ public class PlotFactory { - private static Set> autoAdjustLabelPlots = new HashSet>(); + private static Set> autoAdjustLabelPlots = new HashSet<>(); static { autoAdjustLabelPlots.add(VanChartColumnPlot.class); @@ -90,10 +91,23 @@ public class PlotFactory { return autoAdjustLabelPlots.contains(plot.getClass()); } + private static Set> borderAndBackgroundLabelPlots = new HashSet<>(); + + static { + borderAndBackgroundLabelPlots.add(PiePlot4VanChart.class); + borderAndBackgroundLabelPlots.add(VanChartColumnPlot.class); + borderAndBackgroundLabelPlots.add(VanChartLinePlot.class); + borderAndBackgroundLabelPlots.add(VanChartAreaPlot.class); + } + + public static boolean hasBorderAndBackgroundPlotLabel(Plot plot) { + return borderAndBackgroundLabelPlots.contains(plot.getClass()); + } + /** * 标签Map */ - private static Map, Class> labelMap = new HashMap, Class>(); + private static Map, Class> labelMap = new HashMap<>(); static { labelMap.put(VanChartColumnPlot.class, VanChartColumnPlotLabelPane.class); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index 253a6f8322..b159af7558 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -20,6 +20,8 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -43,6 +45,8 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; + private VanChartBorderWithRadiusPane borderPane; + private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; private JPanel positionPane; @@ -98,15 +102,48 @@ public class VanChartPlotLabelDetailPane extends BasicPane { protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { if(hasLabelPosition(plot)){ + + // 仅饼图、柱形图、条形图、折线图、面积图含有边框和背景 + if (hasBorderAndBackground(plot)) { + return new Component[][]{ + new Component[]{dataLabelContentPane,null}, + new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, + new Component[]{createLabelBorderPane(), null}, + new Component[]{createLabelBackgroundPane(), null} + }; + } + return new Component[][]{ new Component[]{dataLabelContentPane,null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null} }; - } else { - return new Component[][]{ - new Component[]{dataLabelContentPane,null} - }; } + + return new Component[][]{ + new Component[]{dataLabelContentPane,null} + }; + } + + private JPanel createLabelBorderPane() { + borderPane = new VanChartBorderWithRadiusPane(); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); + } + + private JPanel createLabelBackgroundPane() { + backgroundPane = new VanChartBackgroundWithOutImagePane(){ + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), typeComboBox}, + new Component[]{null, centerPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}, + }; + } + }; + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); } protected double[] getLabelStyleRowSize(double p) { @@ -121,6 +158,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { return plot instanceof VanChartLabelPositionPlot; } + private boolean hasBorderAndBackground(Plot plot) { + return PlotFactory.hasBorderAndBackgroundPlotLabel(plot); + } + protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); } @@ -296,6 +337,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ backgroundColor.setSelectObject(detail.getBackgroundColor()); } + if(borderPane != null){ + borderPane.populate(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.populate(detail.getGeneralInfo()); + } checkAllUse(); } @@ -322,6 +369,12 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if(backgroundColor != null){ detail.setBackgroundColor(backgroundColor.getSelectObject()); } + if(borderPane != null){ + borderPane.update(detail.getGeneralInfo()); + } + if(backgroundPane != null){ + backgroundPane.update(detail.getGeneralInfo()); + } } } From f3c2c203a860e1d06f748fdf5c9415e497bce178 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 11:34:46 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=BE=B9=E6=A1=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BD=A2=E7=8A=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/border/VanChartBorderPane.java | 14 +++-- .../border/VanChartBorderWithRadiusPane.java | 12 ++-- .../border/VanChartBorderWithShapePane.java | 58 +++++++++++++++++++ .../label/VanChartPlotLabelDetailPane.java | 17 +++--- 4 files changed, 83 insertions(+), 18 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java index 478929662d..4514e39b9c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java @@ -6,6 +6,7 @@ import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.UIComponentUtils; @@ -30,20 +31,18 @@ public class VanChartBorderPane extends BasicPane { protected void initComponents() { currentLineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); currentLineColorPane = new ColorSelectBox(100); - double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p}; Component[][] components = getUseComponent(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); } protected Component[][] getUseComponent() { - UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")); - UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")); + UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")); + UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color")); return new Component[][]{ new Component[]{null,null}, @@ -52,6 +51,11 @@ public class VanChartBorderPane extends BasicPane { }; } + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p}; + } + /** * 标题 * @return 标题 diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java index 63eff90477..fabf1e669c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java @@ -4,10 +4,10 @@ import com.fr.chart.base.AttrBorder; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; - import javax.swing.JSeparator; import java.awt.BorderLayout; import java.awt.Component; @@ -19,6 +19,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { private static final long serialVersionUID = -3937853702118283803L; private UISpinner radius; + public UISpinner getRadius() { + return radius; + } + @Override protected void initComponents() { radius = new UISpinner(0,1000,1,0); @@ -31,11 +35,11 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane { return new Component[][]{ new Component[]{null,null}, new Component[]{ - FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo) }, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")),radius} } ; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java new file mode 100644 index 0000000000..5361495872 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithShapePane.java @@ -0,0 +1,58 @@ +package com.fr.van.chart.designer.component.border; + +import com.fr.chart.base.AttrBorder; +import com.fr.chart.chartglyph.Marker; +import com.fr.chart.chartglyph.MarkerFactory; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.xcombox.MarkerComboBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.utils.gui.UIComponentUtils; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.plugin.chart.base.AttrBorderWithShape; +import com.fr.plugin.chart.marker.type.MarkerType; + +import java.awt.Component; + +public class VanChartBorderWithShapePane extends VanChartBorderWithRadiusPane { + + private MarkerComboBox shapePane; + + protected void initComponents() { + shapePane = new MarkerComboBox(MarkerFactory.getLabelShapeMarkers()); + super.initComponents(); + } + + protected Component[][] getUseComponent() { + return new Component[][]{ + new Component[]{null, null}, + new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), + UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), currentLineColorPane}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Shape")), + UIComponentUtils.wrapWithBorderLayoutPane(shapePane)}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Radius")), getRadius()} + }; + } + + protected double[] getRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p, p, p, p}; + } + + public void populate(AttrBorder border) { + super.populate(border); + + if (border instanceof AttrBorderWithShape) { + shapePane.setSelectedMarker((Marker.createMarker(((AttrBorderWithShape) border).getShape()))); + } + } + + public void update(AttrBorder border) { + super.update(border); + + if (border instanceof AttrBorderWithShape) { + ((AttrBorderWithShape) border).setShape(MarkerType.parse(shapePane.getSelectedMarkder().getMarkerType())); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index b159af7558..22f8ace786 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java @@ -7,12 +7,11 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.style.color.ColorSelectBox; -import com.fr.design.i18n.Toolkit; - import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.attr.plot.VanChartLabelPositionPlot; import com.fr.plugin.chart.base.AttrLabelDetail; @@ -21,7 +20,7 @@ import com.fr.stable.Constants; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; -import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; +import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -45,7 +44,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private UIToggleButton tractionLine; private ColorSelectBox backgroundColor; - private VanChartBorderWithRadiusPane borderPane; + private VanChartBorderWithShapePane borderPane; private VanChartBackgroundWithOutImagePane backgroundPane; private JPanel tractionLinePane; @@ -125,7 +124,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private JPanel createLabelBorderPane() { - borderPane = new VanChartBorderWithRadiusPane(); + borderPane = new VanChartBorderWithShapePane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); } @@ -338,10 +337,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { backgroundColor.setSelectObject(detail.getBackgroundColor()); } if(borderPane != null){ - borderPane.populate(detail.getGeneralInfo()); + borderPane.populate(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.populate(detail.getGeneralInfo()); + backgroundPane.populate(detail.getBackground()); } checkAllUse(); @@ -370,10 +369,10 @@ public class VanChartPlotLabelDetailPane extends BasicPane { detail.setBackgroundColor(backgroundColor.getSelectObject()); } if(borderPane != null){ - borderPane.update(detail.getGeneralInfo()); + borderPane.update(detail.getBorder()); } if(backgroundPane != null){ - backgroundPane.update(detail.getGeneralInfo()); + backgroundPane.update(detail.getBackground()); } } From 12abfe93d64c1612bfc61ab26709a09bed5a5974 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 23 Sep 2020 15:40:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AF=8C=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/rich_editor.css | 22 +++++++++++++++++++ .../com/fr/design/editor/rich_editor.html | 1 + 2 files changed, 23 insertions(+) create mode 100644 designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css new file mode 100644 index 0000000000..27eb74d9b2 --- /dev/null +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.css @@ -0,0 +1,22 @@ +.editor-insert-param-inactivated-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-inactivated-font .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-inactivated-font.disabled .b-font:before { + content: "\e6ea"; + color: inherit; +} +.editor-insert-param-active-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.editor-insert-param-active-font .b-font:before { + content: "\e6ea"; + color: #23beef; +} +.editor-insert-param-active-font.disabled .b-font:before { + content: "\e6ea"; + color: #23beef; +} \ No newline at end of file diff --git a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html index 3189374dad..1f50c2ddfd 100644 --- a/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html +++ b/designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html @@ -4,6 +4,7 @@ +