diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 29e704f48..8972821b4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -24,11 +24,13 @@ import com.fr.stable.core.PropertyChangeAdapter; import javax.swing.*; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Set; /** * TableDataList Pane. @@ -49,8 +51,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData //说明双击之后又取消了,啥也不用做 return; } - TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); - String[] allDSNames = DesignTableDataManager.getAllDSNames(source); + Set allDSNames = DesignTableDataManager.getGlobalDataSet().keySet(); String[] allListNames = nameableList.getAllNames(); allListNames[editingIndex] = StringUtils.EMPTY; @@ -73,7 +74,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData setIllegalIndex(editingIndex); return; } - boolean isRepeated = isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName); + boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName); if (isRepeated) { isNamePermitted = false; nameableList.stopEditing(); @@ -98,10 +99,15 @@ public class TableDataPaneListPane extends JListControlPane implements TableData for (Map.Entry entry : dsNameChangedMap.entrySet()) { if (StringUtils.equals(oldName, entry.getValue())) { oldName = entry.getKey(); + break; } } - - dsNameChangedMap.put(oldName, newName); + if (StringUtils.equals(oldName, newName)) { + //a -> b;b -> a,说明没改 + dsNameChangedMap.remove(oldName); + } else { + dsNameChangedMap.put(oldName, newName); + } } /** diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java index 3eb644c33..b82a58467 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java @@ -27,6 +27,7 @@ import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import java.util.Collection; public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { private static final String LIST_NAME = "JControl_List"; @@ -190,9 +191,9 @@ public abstract class JListControlPane extends JControlPane implements ListContr return getHelper().getSelectedName(); } - protected boolean isNameRepeated(java.util.List[] list, String name) { - for (int i = 0; i < list.length; i++) { - if (list[i].contains(name)) { + protected boolean isNameRepeated(Collection[] collections, String name) { + for (int i = 0; i < collections.length; i++) { + if (collections[i].contains(name)) { isNameRepeated = true; return true; } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java index 9ce63abe3..f806ded06 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java @@ -25,10 +25,20 @@ import com.fr.general.FRFont; import com.fr.stable.Constants; -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.JFrame; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GridLayout; +import java.awt.RenderingHints; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Vector; @@ -67,11 +77,20 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse private UIToggleButton subPane; private JPanel linePane; private int italic_bold; + /** + * LeftPane和RightPane之间的间隙,也是fontSizeStyleComboBox与fontSizeComboBox之间的间隙,之前的默认值为VGAP_LARGE + */ + private int hGapBetweenLeftPaneAndRightPane = LayoutConstants.VGAP_LARGE; public FRFontPane() { this.initComponents(); } + public FRFontPane(int hGapBetweenLeftPaneAndRightPane) { + this.hGapBetweenLeftPaneAndRightPane = hGapBetweenLeftPaneAndRightPane; + this.initComponents(); + } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -345,7 +364,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse private JPanel createPane() { JPanel createPane = new JPanel(new BorderLayout()); createPane.add(fontNameComboBox, BorderLayout.NORTH); - JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); + JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{createLeftPane(), createRightPane()}}, TableLayoutHelper.FILL_LASTCOLUMN, hGapBetweenLeftPaneAndRightPane, LayoutConstants.VGAP_LARGE); jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); createPane.add(jPanel, BorderLayout.CENTER); return createPane; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java index c4cb09a02..89c35b9a9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleBlock.java @@ -96,7 +96,7 @@ public class PredefinedStyleBlock extends JPanel { private void initPane(boolean supportEdit) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); PredefinedStylePreviewPane content = new PredefinedStylePreviewPane(0.387, 0.384); - content.setPreferredSize(new Dimension(200, 125)); + content.setPreferredSize(new Dimension(200, 180)); UILabel label = new UILabel(previewObject.getStyleName()); label.setToolTipText(previewObject.getStyleName()); label.setPreferredSize(new Dimension(167, 25)); @@ -111,7 +111,7 @@ public class PredefinedStyleBlock extends JPanel { this.add(content, BorderLayout.CENTER); this.add(panel, BorderLayout.SOUTH); - this.setPreferredSize(new Dimension(200, 150)); + this.setPreferredSize(new Dimension(200, 210)); panel.setBackground(Color.WHITE); this.setBackground(Color.WHITE); content.refresh(this.previewObject); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java index 02d4691ee..771da4613 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleEditPane.java @@ -94,7 +94,7 @@ public class PredefinedStyleEditPane extends AbstractAttrNoScrollPane { JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel titlePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Predefined_Overall_Preview")); previewPane = new PredefinedStylePreviewPane(); - previewPane.setPreferredSize(new Dimension(517, 320)); + previewPane.setPreferredSize(new Dimension(517, 500)); titlePane.add(previewPane); jPanel.add(titlePane, BorderLayout.CENTER); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java index 26b92907a..565243424 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/PredefinedStyleSelectPane.java @@ -1,7 +1,7 @@ package com.fr.design.mainframe.predefined.ui; -import com.fr.config.predefined.PredefinedStyle; import com.fr.config.ServerPreferenceConfig; +import com.fr.config.predefined.PredefinedStyle; import com.fr.design.dialog.BasicPane; import com.fr.design.event.ChangeListener; import com.fr.design.gui.icontainer.UIScrollPane; @@ -9,9 +9,9 @@ import com.fr.design.layout.FRGUIPaneFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.Iterator; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.Iterator; /** * Created by kerry on 2020-08-26 @@ -51,7 +51,7 @@ public class PredefinedStyleSelectPane extends BasicPane { contentPane.removeAll(); Iterator iterator = ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedStyleIterator(); int rowCount = (ServerPreferenceConfig.getInstance().getPreferenceStyleConfig().getPredefinedSize() +2)/ 3; - contentPane.setPreferredSize(new Dimension(618, 157 * rowCount)); + contentPane.setPreferredSize(new Dimension(618, 210 * rowCount)); while (iterator.hasNext()) { PredefinedStyle tmpStyle = iterator.next(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ChartPreStylePreView.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ChartPreStylePreView.java new file mode 100644 index 000000000..31a497d01 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/ChartPreStylePreView.java @@ -0,0 +1,100 @@ +package com.fr.design.mainframe.predefined.ui.preview; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.BaseChartPainter; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.base.chart.result.WebChartIDInfo; +import com.fr.chart.base.ChartConstants; +import com.fr.chart.base.ChartPreStyleProvider; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.config.predefined.PredefinedStyle; +import com.fr.design.gui.chart.MiddleChartComponent; +import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.script.Calculator; +import com.fr.stable.core.PropertyChangeListener; + +import java.util.List; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-09-28 + */ +public class ChartPreStylePreView extends MiddleChartComponent { + + private ChartCollection chartCollection; + + private double scaleX = 1.0; + private double scaleY = 1.0; + + private CallbackEvent callbackEvent; + + public ChartPreStylePreView() { + } + + public ChartPreStylePreView(ChartCollection cc) { + this(cc, 1.0, 1.0); + } + + public ChartPreStylePreView(ChartCollection cc, double scaleX, double scaleY) { + this.scaleX = scaleX; + this.scaleY = scaleY; + populate(cc); + } + + public void setCallbackEvent(CallbackEvent callbackEvent) { + this.callbackEvent = callbackEvent; + } + + public void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.translate(ChartConstants.PREGAP4BOUNDS / 2, ChartConstants.PREGAP4BOUNDS / 2); + g2d.scale(scaleX, scaleY); + super.paintComponent(g); + drawChart(g2d); + g2d.scale(1 / scaleX, 1 / scaleY); + g2d.translate(-ChartConstants.PREGAP4BOUNDS / 2, -ChartConstants.PREGAP4BOUNDS / 2); + } + + private void drawChart(Graphics2D g2d) { + Dimension d = getBounds().getSize(); + int chartWidth = (int) (d.width / scaleX) - ChartConstants.PREGAP4BOUNDS; + int chartHeight = (int) (d.height / scaleX) - ChartConstants.PREGAP4BOUNDS; + BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), + WebChartIDInfo.createEmptyDesignerInfo(), chartWidth, chartHeight); + painter.paint(g2d, chartWidth, chartHeight, 0, null, callbackEvent); + } + + public void refresh(PredefinedStyle style) { + VanChart vanChart = chartCollection.getSelectedChartProvider(VanChart.class); + List chartPreStyleProviders = vanChart.getChartPreStyleProvider(); + for (ChartPreStyleProvider chartPreStyleProvider : chartPreStyleProviders) { + chartPreStyleProvider.updatePreDefinedStyle(style); + } + vanChart.attrChange(); + } + + @Override + public void populate(BaseChartCollection cc) { + this.chartCollection = (ChartCollection) cc; + } + + @Override + public BaseChartCollection update() { + return this.chartCollection; + } + + @Override + public void addStopEditingListener(PropertyChangeListener l) { + + } + + + @Override + public void reset() { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java index d7ca347ed..836cd3220 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/preview/PredefinedStylePreviewPane.java @@ -1,26 +1,51 @@ package com.fr.design.mainframe.predefined.ui.preview; import com.fr.base.background.ColorBackground; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Title; +import com.fr.chart.charttypes.ChartTypeManager; import com.fr.config.predefined.PredefinedStyle; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.ComponentUtils; import com.fr.general.Background; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.base.AttrLabel; +import com.fr.plugin.chart.base.VanChartTools; +import com.fr.plugin.chart.column.VanChartColumnPlot; +import com.fr.plugin.chart.line.VanChartLinePlot; +import com.fr.plugin.chart.vanchart.VanChart; +import com.fr.stable.Constants; import javax.swing.JComponent; +import javax.swing.JPanel; +import java.util.ArrayList; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; -import java.util.ArrayList; /** * Created by kerry on 2020-09-06 */ -public class PredefinedStylePreviewPane extends StyleSettingPreviewPane { +public class PredefinedStylePreviewPane extends StyleSettingPreviewPane implements CallbackEvent { private ElementCasePreview elementCasePreview; private Background background; private double scaleX = 1.0; private double scaleY = 1.0; + private ChartPreStylePreView columnChartPane; + private ChartPreStylePreView lineChartPane; + + private int COLUMN_CHART_WIDTH = 297; + + private int COLUMN_CHART_HEIGHT = 220; + + + public static final double CHART_SCALE = 0.6; public PredefinedStylePreviewPane() { this(1.0, 1.0); @@ -31,10 +56,74 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane { this.scaleY = scaleY; this.setBackground(Color.WHITE); this.elementCasePreview = new ElementCasePreview(); - this.elementCasePreview.setPreferredSize(new Dimension(517, 320)); + this.add(initChartPreViewPane()); + this.elementCasePreview.setPreferredSize(new Dimension(517, 250)); this.add(this.elementCasePreview); } + private JPanel initChartPreViewPane() { + columnChartPane = new ChartPreStylePreView(initVanColumnChart(), CHART_SCALE, CHART_SCALE); + columnChartPane.setPreferredSize(new Dimension(COLUMN_CHART_WIDTH, COLUMN_CHART_HEIGHT)); + columnChartPane.setCallbackEvent(this); + lineChartPane = new ChartPreStylePreView(initVanLineChart(), CHART_SCALE, CHART_SCALE); + lineChartPane.setPreferredSize(new Dimension(220, 220)); + lineChartPane.setCallbackEvent(this); + + JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(columnChartPane); + panel.add(lineChartPane); + return panel; + } + + //柱形图 + private ChartCollection initVanColumnChart() { + try { + VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID)[0].clone(); + chart.getTitle().setPosition(Constants.LEFT); + VanChartTools vanChartTools = chart.getVanChartTools(); + vanChartTools.setSort(false); + vanChartTools.setExport(false); + vanChartTools.setFullScreen(false); + VanChartPlot plot = chart.getPlot(); + AttrLabel defaultAttrLabel = plot.getDefaultAttrLabel(); + defaultAttrLabel.setEnable(true); + defaultAttrLabel.getAttrLabelDetail().getBorder().setBorderStyle(0); + defaultAttrLabel.getAttrLabelDetail().getBackground().setBackground(null); + plot.getConditionCollection().getDefaultAttr().addDataSeriesCondition(defaultAttrLabel); + plot.getLegend().setLegendVisible(false); + plot.getDataSheet().setVisible(true); + ChartCollection chartCollection = new ChartCollection(chart); + return chartCollection; + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + return null; + } + + //折线图 + private ChartCollection initVanLineChart() { + try { + VanChart chart = (VanChart) ChartTypeManager.getInstance().getCharts(VanChartLinePlot.VAN_CHART_LINE_PLOT)[0].clone(); + chart.getTitle().setPosition(Constants.LEFT); + VanChartTools vanChartTools = chart.getVanChartTools(); + vanChartTools.setSort(false); + vanChartTools.setExport(false); + vanChartTools.setFullScreen(false); + VanChartLinePlot plot = chart.getPlot(); + plot.getLegend().setPosition(Constants.TOP); + VanChartAxis defaultXAxis = plot.getDefaultXAxis(); + Title title = new Title(); + title.setTextObject(Toolkit.i18nText("Fine-Design_Chart_Category")); + defaultXAxis.setTitle(title); + defaultXAxis.setShowAxisTitle(true); + ChartCollection chartCollection = new ChartCollection(chart); + return chartCollection; + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + return null; + } + @Override public void refresh() { @@ -50,10 +139,14 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane { if (background == null) { background = ColorBackground.getInstance(Color.WHITE); } - background.paint(g, new Rectangle2D.Double(0, 0, 517, 320)); + background.paint(g, new Rectangle2D.Double(0, 0, 517, 500)); + this.columnChartPane.paintComponent(g); + g.translate(COLUMN_CHART_WIDTH, 0); + this.lineChartPane.paintComponent(g); + g.translate(-COLUMN_CHART_WIDTH, COLUMN_CHART_HEIGHT + 10); this.elementCasePreview.paintContent(g); - + g.translate(0, -COLUMN_CHART_HEIGHT - 10); // 恢复双缓冲 ComponentUtils.resetBuffer(dbcomponents); @@ -73,8 +166,14 @@ public class PredefinedStylePreviewPane extends StyleSettingPreviewPane { public void refresh(PredefinedStyle style, boolean displayFormBackground) { elementCasePreview.refresh(style); + columnChartPane.refresh(style); + lineChartPane.refresh(style); background = displayFormBackground ? style.getFormBackground().getBackground() : style.getReportBackground(); this.repaint(); } + @Override + public void callback() { + this.repaint(); + } } diff --git a/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java b/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java index b47ea8e95..dd5e5bc5c 100644 --- a/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java +++ b/designer-base/src/test/java/com/fr/design/data/datapane/TableDataPaneListPaneTest.java @@ -20,5 +20,7 @@ public class TableDataPaneListPaneTest { listPane.rename("222", "333"); Map dsNameChangedMap = listPane.getDsNameChangedMap(); assertEquals(1, dsNameChangedMap.size()); + listPane.rename("333","111"); + assertEquals(0, dsNameChangedMap.size()); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index 85b13aef7..1a5088a27 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -7,6 +7,7 @@ import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.result.WebChartIDInfo; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.log.FineLoggerFactory; @@ -144,6 +145,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene return; } + chartCollection4Design.setPredefinedStyleName(getGlobalPredefinedStyleName(), false); Graphics2D g2d = (Graphics2D) g; Paint oldPaint = g2d.getPaint(); @@ -268,4 +270,8 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene public void callback() { this.repaint(); } + + private String getGlobalPredefinedStyleName() { + return HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTemplatePredefinedStyle(); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java index dfcd1a644..96e2a7d24 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartLabelPane.java @@ -64,11 +64,14 @@ public class VanChartLabelPane extends AbstractVanChartScrollPane { return; } ConditionAttr attrList = chart.getPlot().getConditionCollection().getDefaultAttr(); + + // labelPane中颜色选择器会触发listener.doChange(),导致style界面update两次, + // 为了避免递归updateBean时,remove与add不匹配,调整一下labelPane.update()的位置 + AttrLabel attrLabel = labelPane.update(); DataSeriesCondition attr = ((VanChartPlot)chart.getPlot()).getAttrLabelFromConditionCollection(); if(attr != null) { attrList.remove(attr); } - AttrLabel attrLabel = labelPane.update(); if (attrLabel != null) { attrList.addDataSeriesCondition(attrLabel); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java index d4ebf74ee..1c30b1a55 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java @@ -1,6 +1,7 @@ package com.fr.design.widget.ui.designer; import com.fr.base.BaseUtils; +import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; @@ -58,7 +59,8 @@ public class LabelDefinePane extends AbstractDataModify