diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java index 29c89e0f4..a0d664fc0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java @@ -44,13 +44,25 @@ public class VanChartBackgroundPane extends BasicPane { protected JPanel centerPane; + private boolean hasAuto; + public VanChartBackgroundPane() { + this(false); + } + + public VanChartBackgroundPane(boolean hasAuto) { + this.hasAuto = hasAuto; initComponents(); JPanel panel = initContentPanel(); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); } + + public boolean isHasAuto() { + return hasAuto; + } + protected JPanel initContentPanel() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithAutoColor.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithAutoColor.java deleted file mode 100644 index cd5d26d4a..000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithAutoColor.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.fr.van.chart.designer.component.background; - -import com.fr.chart.chartglyph.GeneralInfo; -import com.fr.design.i18n.Toolkit; -import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.design.mainframe.backgroundpane.VanChartGradientPane; - -/** - * @author Bjorn - * @version 10.0 - * Created by Bjorn on 2020-09-11 - */ -public class VanChartBackgroundPaneWithAutoColor extends VanChartBackgroundPane { - - private static final int AUTO = 0; - - public VanChartBackgroundPaneWithAutoColor() { - super(); - } - - protected void initList() { - paneList.add(new NullBackgroundQuickPane() { - public String title4PopupWindow() { - return Toolkit.i18nText("Fine-Design_Chart_Automatic"); - } - }); - paneList.add(new NullBackgroundQuickPane()); - paneList.add(new ColorBackgroundQuickPane()); - paneList.add(new VanChartGradientPane()); - } - - public void populateBackground(GeneralInfo attr, int begin) { - if (attr.isAutoBackground()) { - typeComboBox.setSelectedIndex(AUTO); - return; - } - super.populateBackground(attr, begin + 1); - } - - public void updateBackground(GeneralInfo attr) { - if (typeComboBox.getSelectedIndex() == AUTO) { - attr.setAutoBackground(true); - return; - } - attr.setAutoBackground(false); - super.updateBackground(attr); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java index cf9530547..06c7aba70 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutImagePane.java @@ -1,5 +1,7 @@ package com.fr.van.chart.designer.component.background; +import com.fr.chart.chartglyph.GeneralInfo; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.VanChartGradientPane; @@ -11,13 +13,49 @@ import com.fr.design.mainframe.backgroundpane.VanChartGradientPane; public class VanChartBackgroundWithOutImagePane extends VanChartBackgroundPane { private static final long serialVersionUID = 1322979785605013853L; + private static final int AUTO = 0; + public VanChartBackgroundWithOutImagePane() { - super(); + this(false); + } + + public VanChartBackgroundWithOutImagePane(boolean hasAuto) { + super(hasAuto); } protected void initList() { + if (isHasAuto()) { + paneList.add(new NullBackgroundQuickPane() { + public String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Automatic"); + } + }); + } paneList.add(new NullBackgroundQuickPane()); paneList.add(new ColorBackgroundQuickPane()); paneList.add(new VanChartGradientPane()); } + + public void populateBackground(GeneralInfo attr, int begin) { + if (isHasAuto()) { + if (attr.isAutoBackground()) { + typeComboBox.setSelectedIndex(AUTO); + return; + } + super.populateBackground(attr, begin + 1); + } else { + super.populateBackground(attr, begin); + } + } + + public void updateBackground(GeneralInfo attr) { + if (isHasAuto()) { + if (typeComboBox.getSelectedIndex() == AUTO) { + attr.setAutoBackground(true); + return; + } + attr.setAutoBackground(false); + } + super.updateBackground(attr); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java index dadd754d6..902d10ad7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundWithOutShadowWithRadiusPane.java @@ -19,6 +19,10 @@ public class VanChartBackgroundWithOutShadowWithRadiusPane extends VanChartBackg super(); } + public VanChartBackgroundWithOutShadowWithRadiusPane(boolean hasAuto){ + super(hasAuto); + } + protected Component[][] getPaneComponents() { radius = new UISpinner(0,1000,1,0); return new Component[][]{ diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java index 7c88c088a..c2b1620b4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/MapRangeLegendPane.java @@ -1,7 +1,7 @@ package com.fr.van.chart.designer.style; import com.fr.van.chart.designer.component.background.VanChartBackgroundPane; -import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithAutoColor; +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; /** * @author Bjorn @@ -20,6 +20,6 @@ public class MapRangeLegendPane extends VanChartRangeLegendPane { @Override protected VanChartBackgroundPane creatBackgroundPane(){ - return new VanChartBackgroundPaneWithAutoColor(); + return new VanChartBackgroundWithOutImagePane(true); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java index 4dc9b6ba5..32a4f8e54 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java @@ -25,8 +25,8 @@ public class VanChartStylePane extends ChartStylePane { protected java.util.List getPaneList() { java.util.List paneList = new ArrayList(); Plot plot = getChart().getPlot(); - paneList.add(new VanChartTitlePane(VanChartStylePane.this)); - if(plot.isSupportLegend()){ + paneList.add(createVanChartTitlePane()); + if (plot.isSupportLegend()) { paneList.add(new VanChartLegendPane(VanChartStylePane.this)); } @@ -34,14 +34,14 @@ public class VanChartStylePane extends ChartStylePane { paneList.add(createChartSeriesPane()); - if(plot.isHaveAxis()){ - if(plot instanceof VanChartAxisPlot) { + if (plot.isHaveAxis()) { + if (plot instanceof VanChartAxisPlot) { createVanChartAxisPane(paneList, (VanChartAxisPlot) plot); } addOtherAxisPane(paneList, plot); - if(plot.isSupportDataSheet()) { + if (plot.isSupportDataSheet()) { paneList.add(new VanChartDataSheetPane()); } } @@ -53,6 +53,10 @@ public class VanChartStylePane extends ChartStylePane { return paneList; } + protected VanChartTitlePane createVanChartTitlePane() { + return new VanChartTitlePane(VanChartStylePane.this); + } + protected void addOtherAxisPane(java.util.List paneList, Plot plot) { } @@ -68,7 +72,7 @@ public class VanChartStylePane extends ChartStylePane { paneList.add(new VanChartLabelPane(VanChartStylePane.this)); } - protected void addVanChartTooltipPane(List paneList){ + protected void addVanChartTooltipPane(List paneList) { paneList.add(new VanChartTooltipPane(VanChartStylePane.this)); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index d5dba9df8..cfcb0debb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -112,7 +112,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { } private JPanel createTitlePane() { - backgroundPane = new VanChartBackgroundWithOutShadowWithRadiusPane(); + backgroundPane = createBackgroundPane(); double p = TableLayout.PREFERRED; @@ -132,6 +132,10 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } + protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() { + return new VanChartBackgroundWithOutShadowWithRadiusPane(); + } + private JPanel createTitleContentPane(double[] row, double[] col) { titleContent = new TinyFormulaPane(); useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java new file mode 100644 index 000000000..eb87f4363 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitleWithAutoBackground.java @@ -0,0 +1,19 @@ +package com.fr.van.chart.designer.style; + +import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-10-20 + */ +public class VanChartTitleWithAutoBackground extends VanChartTitlePane { + + public VanChartTitleWithAutoBackground(VanChartStylePane parent) { + super(parent); + } + + protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() { + return new VanChartBackgroundWithOutShadowWithRadiusPane(true); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index cc912cf3f..f25802130 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -3,8 +3,11 @@ package com.fr.van.chart.drillmap.designer.other; import com.fr.chart.base.DrillMapTools; import com.fr.chart.chartattr.Chart; import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; +import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; @@ -12,7 +15,6 @@ import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom; -import com.fr.design.i18n.Toolkit; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -74,7 +76,20 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith }; } }; - backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); + + backgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow() { + @Override + protected void initList() { + paneList.add(new NullBackgroundQuickPane() { + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"); + } + }); + paneList.add(new ColorBackgroundQuickPane()); + } + }; + selectBackgroundPane = new VanChartBackgroundPaneWithOutImageAndShadow(); catalogSuperLink = new VanChartCatalogHyperLinkPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java index 24a5d45fe..09d7a4b81 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/other/VanChartGanttConditionPane.java @@ -13,11 +13,11 @@ import com.fr.plugin.chart.gantt.attr.AttrGanttTooltip; import com.fr.plugin.chart.gantt.attr.AttrGanttTooltipContent; import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.PlotFactory; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipNoCheckPane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; +import com.fr.van.chart.gantt.designer.style.label.VanChartGanttLabelConditionPane; import java.awt.Dimension; @@ -42,7 +42,7 @@ public class VanChartGanttConditionPane extends DataSeriesConditionPane { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); if (!PlotFactory.largeDataModel(plot)) { - classPaneMap.put(AttrGanttLabel.class, new VanChartLabelConditionPane(this, plot)); + classPaneMap.put(AttrGanttLabel.class, new VanChartGanttLabelConditionPane(this, plot)); } classPaneMap.put(AttrGanttTooltip.class, new VanChartTooltipConditionPane(this, plot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java new file mode 100644 index 000000000..86c3ba942 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttLabelConditionPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.gantt.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +public class VanChartGanttLabelConditionPane extends VanChartLabelConditionPane { + + public VanChartGanttLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { + super(conditionAttributesPane, plot); + } + + protected VanChartPlotLabelPane createLabelPane() { + return new VanChartGanttPlotLabelNoCheckPane(getPlot(), null); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java new file mode 100644 index 000000000..4743a545d --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/label/VanChartGanttPlotLabelNoCheckPane.java @@ -0,0 +1,25 @@ +package com.fr.van.chart.gantt.designer.style.label; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import java.awt.BorderLayout; + +public class VanChartGanttPlotLabelNoCheckPane extends VanChartGanttPlotLabelPane { + + public VanChartGanttPlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void addComponents() { + this.setLayout(new BorderLayout()); + this.add(getLabelPane(), BorderLayout.CENTER); + } + + public void populate(AttrLabel attr) { + super.populate(attr); + getLabelShowCheckBox().setSelected(true); + getLabelPane().setVisible(true); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapStylePane.java index 68ec083e4..2083d9f12 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/VanChartMapStylePane.java @@ -7,6 +7,8 @@ import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.VanChartTitlePane; +import com.fr.van.chart.designer.style.VanChartTitleWithAutoBackground; import com.fr.van.chart.map.designer.style.label.VanChartMapLabelPane; import com.fr.van.chart.map.designer.style.tooltip.VanChartMapTooltipPane; @@ -20,6 +22,11 @@ public class VanChartMapStylePane extends VanChartStylePane { super(listener); } + + protected VanChartTitlePane createVanChartTitlePane() { + return new VanChartTitleWithAutoBackground(VanChartMapStylePane.this); + } + protected void createVanChartLabelPane(List paneList) { Plot plot = getChart().getPlot(); if(!isLineMapPlot(plot)) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java index 7fac3034b..9a8cf4e45 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/other/VanChartStructureConditionPane.java @@ -11,10 +11,10 @@ import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.type.ConditionKeyType; import com.fr.van.chart.designer.other.condition.item.VanChartFloatColorConditionPane; -import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartSeriesColorConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartStructureNodeConditionPane; import com.fr.van.chart.designer.other.condition.item.VanChartTooltipConditionPane; +import com.fr.van.chart.structure.desinger.style.VanChartStructureLabelConditionPane; import java.awt.Dimension; @@ -47,7 +47,7 @@ public class VanChartStructureConditionPane extends DataSeriesConditionPane { protected void addBasicAction() { classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this)); classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot)); - classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot)); + classPaneMap.put(AttrLabel.class, new VanChartStructureLabelConditionPane(this, plot)); classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this)); classPaneMap.put(AttrNode.class, new VanChartStructureNodeConditionPane(this)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java new file mode 100644 index 000000000..c5c9cf320 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructureLabelConditionPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.structure.desinger.style; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.van.chart.designer.other.condition.item.VanChartLabelConditionPane; +import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; + +public class VanChartStructureLabelConditionPane extends VanChartLabelConditionPane { + + public VanChartStructureLabelConditionPane(ConditionAttributesPane conditionAttributesPane, Plot plot) { + super(conditionAttributesPane, plot); + } + + protected VanChartPlotLabelPane createLabelPane() { + return new VanChartStructurePlotLabelNoCheckPane(getPlot(), null); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java new file mode 100644 index 000000000..e7dfb1873 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/style/VanChartStructurePlotLabelNoCheckPane.java @@ -0,0 +1,25 @@ +package com.fr.van.chart.structure.desinger.style; + +import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import java.awt.BorderLayout; + +public class VanChartStructurePlotLabelNoCheckPane extends VanChartStructurePlotLabelPane { + + public VanChartStructurePlotLabelNoCheckPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void addComponents() { + this.setLayout(new BorderLayout()); + this.add(getLabelPane(), BorderLayout.CENTER); + } + + public void populate(AttrLabel attr) { + super.populate(attr); + getLabelShowCheckBox().setSelected(true); + getLabelPane().setVisible(true); + } +} diff --git a/designer-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 de86a07f2..0dd2fcc15 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 @@ -92,6 +92,7 @@ public class MobileComponentFrozenPane extends BasicPane { WSortLayout wSortLayout = ((WSortLayout) xCreator.toData()); List all = wSortLayout.getNonContainerWidgetList(); List selected = wSortLayout.getFrozenWidgets(); + selected = fixRename(all, selected, wSortLayout); Map map = new LinkedHashMap<>(); for (String value : selected) { map.put(value, true); @@ -103,6 +104,24 @@ public class MobileComponentFrozenPane extends BasicPane { uiComboCheckBox.setSelectedValues(map); } + private List fixRename(List all, List selected, WSortLayout wSortLayout) { + // 存在重命名 + if (!selected.isEmpty() && !all.containsAll(selected)) { + // 清空原选中的 selected是Unmodifiable的 + selected = new ArrayList<>(); + for (String name : all) { + Widget widget = FormWidgetHelper.findWidgetWithBound(wSortLayout, name); + if (widget != null && widget.getMobileBookMark().isFrozen()) { + // 重新添加 + selected.add(name); + } + } + // 同时更新下 + wSortLayout.updateFrozenWidgets(selected); + } + return selected; + } + private List frozenWidgets() { Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget(); WLayout container = form.getContainer(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java index 4670456ae..def9cf795 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/component/MobileTabCommonSettingPane.java @@ -35,6 +35,7 @@ public class MobileTabCommonSettingPane extends BasicPane { private ModeButtonGroup buttonGroup; private NewColorSelectBox initDotColorBox; private NewColorSelectBox selectDotColorBox; + private boolean isPopulate; public MobileTabCommonSettingPane(boolean isTopComponent) { initComponent(isTopComponent); @@ -89,23 +90,27 @@ public class MobileTabCommonSettingPane extends BasicPane { initDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; selectDotColorBox = new NewColorSelectBox(0){ @Override protected void iniListener() { - } - - @Override - public void mouseClicked(MouseEvent e) { - super.mouseClicked(e); - this.attributeChange(); + this.addSelectChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (!isPopulate) { + attributeChange(); + } + } + }); } }; JPanel initDotColorPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{initColorLabel, initDotColorBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); @@ -189,7 +194,9 @@ public class MobileTabCommonSettingPane extends BasicPane { color = defaultColor; } if (color != colorBox.getSelectObject()) { + isPopulate = true; colorBox.setSelectObject(color); + isPopulate = false; } }