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/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; } }