From 316c1eaecf02b1ba5d7fc8120fd8b1379f5ad927 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 6 Apr 2021 11:17:41 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-50664=20=20=E3=80=90=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E3=80=91body=E8=AE=BE=E7=BD=AE=E7=BB=9D?= =?UTF-8?q?=E5=AF=B9=E5=B8=83=E5=B1=80=EF=BC=8C=E7=BB=84=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BE=A7=E8=BE=B9=E5=AF=BC=E8=88=AA=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E8=83=BD=E8=AE=BE=E7=BD=AE=E7=BB=84=E4=BB=B6=E5=86=BB?= =?UTF-8?q?=E7=BB=93=EF=BC=8C=E4=B8=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 表单绝对布局下的组件结构和自适应布局下的组件结构不同,导致不能获取到body下的直接子组件名称, 从而无法获取启用了快速定位导航的组件,在移动端冻结设置面板看来就像是当前表单没有任何组件启用了 快速定位导航,所以没能在冻结组件列表中将相关组件排除出去. 【改动思路】 根据表单绝对布局的组件结构进行特殊处理,以获取Body布局组件. --- .../component/MobileComponentFrozenPane.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java index 0dd2fcc15..a06cb1cd0 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileComponentFrozenPane.java @@ -14,6 +14,8 @@ import com.fr.design.widget.FRWidgetFactory; import com.fr.form.main.Form; import com.fr.form.ui.FormWidgetHelper; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WBodyLayoutType; +import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.widget.CRBoundsWidget; @@ -123,9 +125,7 @@ public class MobileComponentFrozenPane extends BasicPane { } private List frozenWidgets() { - Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); - WLayout container = form.getContainer(); - WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1); + WSortLayout wSortLayout = getBodyWSortLayout(); List list = wSortLayout.getNonContainerWidgetList(); List widgets = new ArrayList<>(); for (String value : list) { @@ -137,6 +137,18 @@ public class MobileComponentFrozenPane extends BasicPane { return widgets; } + private WSortLayout getBodyWSortLayout() { + Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); + WLayout container = form.getContainer(); + WFitLayout wFitLayout = (WFitLayout) container.getWidget(container.getWidgetCount() - 1); + WSortLayout wSortLayout = wFitLayout; + if (wFitLayout.getBodyLayoutType() == WBodyLayoutType.ABSOLUTE) { + CRBoundsWidget boundsWidget = (CRBoundsWidget) wFitLayout.getWidget(0); + wSortLayout = (WSortLayout) boundsWidget.getWidget(); + } + return wSortLayout; + } + @Override protected String title4PopupWindow() { return "ComponentFrozenPane"; From 82fa6142d1235ef52dd8d0b9c6abc3e695caa81b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 7 Apr 2021 17:36:21 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-50096=20=E5=9C=A8=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E6=9B=B4=E6=94=B9=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=90=8E=20=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E5=AD=97=E6=AE=B5=E6=93=8D=E4=BD=9C=E5=92=8C?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 4d2003144..20187bd50 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -303,6 +303,8 @@ public class JDBCDefPane extends JPanel { urlTextField.setText(dus[i].getURL()); } } + // 更改数据库类型后 数据库名称置空和之前逻辑保持一致 + jdbcDatabase.setDatabase(StringUtils.EMPTY); } }; From 5fb883b5a2aa2b73f00fbc23a453dabcd3b59b80 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 8 Apr 2021 11:06:47 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=20REPORT-50788=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=9B=B4=E6=96=B0=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignModelAdapter.java | 18 ++++++++++++++++++ .../design/actions/TableDataSourceAction.java | 1 + 2 files changed, 19 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index 73d82f862..7a237ffb5 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -21,6 +21,8 @@ import com.fr.stable.StringUtils; import com.fr.stable.js.WidgetName; import com.fr.util.ParameterApplyHelper; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -338,6 +340,22 @@ public abstract class DesignModelAdapter allParameterList = new ArrayList<>(Arrays.asList(parameters)); + List tableDataParameterList = new ArrayList<>(); + for (ParameterProvider parameterProvider : tableDataParameters) { + tableDataParameterList.add((Parameter) parameterProvider); + } + allParameterList.removeAll(tableDataParameterList); + parameters = allParameterList.toArray(new Parameter[0]); + } + + + public void updateAllParameters() { + parameters = getLatestParameters(); + } + protected void addGlobalParameters(Map map) { // 添加全局参数 Parameter[] glbParas = ParameterConfig.getInstance().getGlobalParameters(); diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index 2903b12a1..8a6e7a7df 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -60,6 +60,7 @@ public class TableDataSourceAction extends TemplateComponentAction Date: Thu, 8 Apr 2021 11:34:54 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=20REPORT-50788=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=9B=B4=E6=96=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=20=E6=BC=8F=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/datapane/TableDataTreePane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 2356de6d4..230bf8a47 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -288,6 +288,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { fireDSChanged(); checkButtonEnabled(); DesignTableDataManager.removeSelectedColumnNames(selectedNO.getName()); + DesignModelAdapter.getCurrentModelAdapter().removeTableDataParameters(selectedNO.getName()); } } } From c7aabf51f929b80d5ca1e7383d660f2e02de28eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 8 Apr 2021 15:02:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=09CHART-18761=20=E4=BB=AA=E8=A1=A8?= =?UTF-8?q?=E7=9B=98=E6=A0=87=E7=AD=BE=E5=A2=9E=E5=8A=A0=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TargetValueFormatPaneWithCheckBox.java | 22 +++++ .../label/LabelContentPaneWithCateValue.java | 64 ++++++++++++-- ...efreshTooltipContentPaneWithOutSeries.java | 19 ++--- .../TooltipContentPaneWithOutSeries.java | 85 +++++++++++++++++-- .../VanChartFieldListPaneWithOutSeries.java | 35 ++++++++ 5 files changed, 201 insertions(+), 24 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/designer/component/format/TargetValueFormatPaneWithCheckBox.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/TargetValueFormatPaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/TargetValueFormatPaneWithCheckBox.java new file mode 100644 index 000000000..469fcb33b --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/format/TargetValueFormatPaneWithCheckBox.java @@ -0,0 +1,22 @@ +package com.fr.van.chart.designer.component.format; + +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-04-06 + */ +public class TargetValueFormatPaneWithCheckBox extends VanChartFormatPaneWithCheckBox { + + public TargetValueFormatPaneWithCheckBox(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + @Override + protected String getCheckBoxText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Target_Value"); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/label/LabelContentPaneWithCateValue.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/label/LabelContentPaneWithCateValue.java index 4b8f8013d..21fc0c0bf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/label/LabelContentPaneWithCateValue.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/label/LabelContentPaneWithCateValue.java @@ -1,6 +1,11 @@ package com.fr.van.chart.designer.component.label; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.gauge.attr.GaugeValueTooltipContent; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.format.TargetValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -11,9 +16,11 @@ import java.awt.Component; */ public class LabelContentPaneWithCateValue extends GaugeLabelContentPane { + private TargetValueFormatPaneWithCheckBox targetValueFormatPane; + private static final long serialVersionUID = -8286902939543416431L; - public LabelContentPaneWithCateValue(VanChartStylePane parent, JPanel showOnPane){ + public LabelContentPaneWithCateValue(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } @@ -21,14 +28,59 @@ public class LabelContentPaneWithCateValue extends GaugeLabelContentPane { return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, panel); } - protected double[] getRowSize(double p){ - return new double[]{p,p}; + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initFormatPane(parent, showOnPane); + setValueFormatPane(new ValueFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"); + } + }); + this.targetValueFormatPane = new TargetValueFormatPaneWithCheckBox(parent, showOnPane); + } + + protected double[] getRowSize(double p) { + return new double[]{p, p, p}; } - protected Component[][] getPaneComponents(){ + protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{getCategoryNameFormatPane(),null}, - new Component[]{getValueFormatPane(),null}, + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{targetValueFormatPane, null}, }; } + + @Override + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + super.populateFormatPane(attrTooltipContent); + if (attrTooltipContent instanceof GaugeValueTooltipContent) { + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) attrTooltipContent; + targetValueFormatPane.populate(gaugeValueTooltipContent.getTargetValueFormat()); + } + } + + @Override + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + super.updateFormatPane(attrTooltipContent); + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) attrTooltipContent; + targetValueFormatPane.update(gaugeValueTooltipContent.getTargetValueFormat()); + } + + @Override + public void setDirty(boolean isDirty) { + super.setDirty(isDirty); + targetValueFormatPane.setDirty(isDirty); + } + + + @Override + public boolean isDirty() { + return super.isDirty() || targetValueFormatPane.isDirty(); + } + + protected AttrTooltipContent createAttrTooltip() { + return new GaugeValueTooltipContent(); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java index 48d2e55cb..810b4235d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/RefreshTooltipContentPaneWithOutSeries.java @@ -1,9 +1,7 @@ package com.fr.van.chart.designer.component.tooltip; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; -import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithoutCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -29,17 +27,18 @@ public class RefreshTooltipContentPaneWithOutSeries extends TooltipContentPaneWi setChangedPercentFormatPane(new ChangedPercentFormatPaneWithCheckBox(parent, showOnPane)); } - protected double[] getRowSize(double p){ - return new double[]{p,p,p,p,p}; + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p, p, p}; } - protected Component[][] getPaneComponents(){ + protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{getCategoryNameFormatPane(),null}, - new Component[]{getValueFormatPane(),null}, - new Component[]{getChangedValueFormatPane(),null}, - new Component[]{getPercentFormatPane(),null}, - new Component[]{getChangedPercentFormatPane(),null}, + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{getTargetValueFormatPane(), null}, + new Component[]{getChangedValueFormatPane(), null}, + new Component[]{getPercentFormatPane(), null}, + new Component[]{getChangedPercentFormatPane(), null}, }; } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java index ab2f0a179..f8d238d3a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/TooltipContentPaneWithOutSeries.java @@ -6,8 +6,12 @@ import com.fr.plugin.chart.base.AttrTooltipContent; import com.fr.plugin.chart.base.format.AttrTooltipCategoryFormat; import com.fr.plugin.chart.base.format.AttrTooltipFormat; import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat; +import com.fr.plugin.chart.base.format.AttrTooltipTargetValueFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.plugin.chart.gauge.attr.GaugeValueTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; +import com.fr.van.chart.designer.component.format.TargetValueFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.ValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; @@ -24,19 +28,38 @@ public class TooltipContentPaneWithOutSeries extends VanChartTooltipContentPane private static final long serialVersionUID = -1973565663365672717L; - public TooltipContentPaneWithOutSeries(VanChartStylePane parent, JPanel showOnPane){ + private TargetValueFormatPaneWithCheckBox targetValueFormatPane; + + public TooltipContentPaneWithOutSeries(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } - protected double[] getRowSize(double p){ - return new double[]{p,p,p}; + public TargetValueFormatPaneWithCheckBox getTargetValueFormatPane() { + return targetValueFormatPane; + } + + @Override + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + super.initFormatPane(parent, showOnPane); + setValueFormatPane(new ValueFormatPaneWithCheckBox(parent, showOnPane) { + @Override + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"); + } + }); + this.targetValueFormatPane = new TargetValueFormatPaneWithCheckBox(parent, showOnPane); + } + + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p}; } - protected Component[][] getPaneComponents(){ + protected Component[][] getPaneComponents() { return new Component[][]{ - new Component[]{getCategoryNameFormatPane(),null}, - new Component[]{getValueFormatPane(),null}, - new Component[]{getPercentFormatPane(),null}, + new Component[]{getCategoryNameFormatPane(), null}, + new Component[]{getValueFormatPane(), null}, + new Component[]{targetValueFormatPane, null}, + new Component[]{getPercentFormatPane(), null} }; } @@ -57,7 +80,8 @@ public class TooltipContentPaneWithOutSeries extends VanChartTooltipContentPane protected String[] getRichTextFieldNames() { return new String[]{ Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"), - Toolkit.i18nText("Fine-Design_Chart_Use_Value"), + Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"), + Toolkit.i18nText("Fine-Design_Chart_Target_Value"), Toolkit.i18nText("Fine-Design_Chart_Use_Percent") }; } @@ -66,7 +90,52 @@ public class TooltipContentPaneWithOutSeries extends VanChartTooltipContentPane return new AttrTooltipFormat[]{ new AttrTooltipCategoryFormat(), new AttrTooltipValueFormat(), + new AttrTooltipTargetValueFormat(), new AttrTooltipPercentFormat() }; } + + @Override + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + super.populateFormatPane(attrTooltipContent); + if (attrTooltipContent instanceof GaugeValueTooltipContent) { + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) attrTooltipContent; + targetValueFormatPane.populate(gaugeValueTooltipContent.getTargetValueFormat()); + } + } + + @Override + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + super.updateFormatPane(attrTooltipContent); + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) attrTooltipContent; + targetValueFormatPane.update(gaugeValueTooltipContent.getTargetValueFormat()); + } + + protected void updateTooltipFormat(AttrTooltipContent target, AttrTooltipContent source) { + super.updateTooltipFormat(target, source); + + if (target instanceof GaugeValueTooltipContent && source instanceof GaugeValueTooltipContent) { + GaugeValueTooltipContent targetGauge = (GaugeValueTooltipContent) target; + GaugeValueTooltipContent sourceGauge = (GaugeValueTooltipContent) source; + targetGauge.setRichTextTargetValueFormat(sourceGauge.getRichTextTargetValueFormat()); + } + } + + @Override + public void setDirty(boolean isDirty) { + super.setDirty(isDirty); + targetValueFormatPane.setDirty(isDirty); + } + + @Override + public boolean isDirty() { + return super.isDirty() || targetValueFormatPane.isDirty(); + } + + protected AttrTooltipContent createAttrTooltip() { + GaugeValueTooltipContent gaugeValueTooltipContent = new GaugeValueTooltipContent(); + gaugeValueTooltipContent.getTargetValueFormat().setEnable(true); + gaugeValueTooltipContent.getRichTextTargetValueFormat().setEnable(true); + return gaugeValueTooltipContent; + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java index c651dbf89..7e67886ac 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/tooltip/VanChartFieldListPaneWithOutSeries.java @@ -1,9 +1,15 @@ package com.fr.van.chart.designer.component.tooltip; +import com.fr.design.i18n.Toolkit; import com.fr.design.ui.ModernUIPane; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.base.format.AttrTooltipTargetValueFormat; +import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; +import com.fr.plugin.chart.gauge.attr.GaugeValueTooltipContent; import com.fr.van.chart.designer.component.richText.VanChartFieldAttrPane; import com.fr.van.chart.designer.component.richText.VanChartFieldButton; import com.fr.van.chart.designer.component.richText.VanChartFieldListPane; +import com.fr.van.chart.designer.component.richText.VanChartFieldListener; import com.fr.van.chart.designer.component.richText.VanChartRichEditorModel; import javax.swing.JPanel; @@ -12,13 +18,26 @@ import java.util.List; public class VanChartFieldListPaneWithOutSeries extends VanChartFieldListPane { + private VanChartFieldButton targetValueButton; + public VanChartFieldListPaneWithOutSeries(VanChartFieldAttrPane fieldAttrPane, ModernUIPane richEditorPane) { super(fieldAttrPane, richEditorPane); } + protected void initDefaultFieldButton() { + super.initDefaultFieldButton(); + + VanChartFieldListener listener = getFieldListener(); + setValueButton(new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"), + new AttrTooltipValueFormat(), false, listener)); + targetValueButton = new VanChartFieldButton(Toolkit.i18nText("Fine-Design_Chart_Target_Value"), + new AttrTooltipTargetValueFormat(), false, listener); + } + protected void addDefaultFieldButton(JPanel fieldPane) { fieldPane.add(getCategoryNameButton()); fieldPane.add(getValueButton()); + fieldPane.add(targetValueButton); fieldPane.add(getPercentButton()); } @@ -27,8 +46,24 @@ public class VanChartFieldListPaneWithOutSeries extends VanChartFieldListPane { fieldButtonList.add(getCategoryNameButton()); fieldButtonList.add(getValueButton()); + fieldButtonList.add(targetValueButton); fieldButtonList.add(getPercentButton()); return fieldButtonList; } + + public void populateDefaultField(AttrTooltipContent tooltipContent) { + super.populateDefaultField(tooltipContent); + + if (tooltipContent instanceof GaugeValueTooltipContent) { + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) tooltipContent; + populateButtonFormat(targetValueButton, gaugeValueTooltipContent.getRichTextTargetValueFormat()); + } + } + + public void updateDefaultField(AttrTooltipContent tooltipContent) { + super.updateDefaultField(tooltipContent); + GaugeValueTooltipContent gaugeValueTooltipContent = (GaugeValueTooltipContent) tooltipContent; + updateButtonFormat(targetValueButton, gaugeValueTooltipContent.getRichTextTargetValueFormat()); + } }