diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 553895a185..5137901ee9 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -17,6 +17,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; @@ -60,7 +61,14 @@ public class ChartTypePane extends AbstractChartAttrPane { if (editingCollection != null) { relayoutChartTypePane(editingCollection); } else { - chartTypeComBox = new ComboBoxPane(); + chartTypeComBox = new ComboBoxPane() { + @Override + protected void initLayout() { + super.initLayout(); + jcb.setVisible(ChartEditContext.normalMode()); + } + }; + } BasicScrollPane scrollPane = new BasicScrollPane() { @@ -388,7 +396,7 @@ public class ChartTypePane extends AbstractChartAttrPane { buttonPane.populateBean(collection); chartTypeComBox.populateBean(chart); - buttonPane.setVisible(ChartTypeInterfaceManager.getInstance().needChartChangePane(chart)); + buttonPane.setVisible(ChartTypeInterfaceManager.getInstance().needChartChangePane(chart) && ChartEditContext.normalMode()); this.initAllListeners(); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java index 42cf782c35..86f7e4da87 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java @@ -7,16 +7,17 @@ import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.van.chart.designer.AbstractVanChartScrollPane; import javax.swing.BorderFactory; import javax.swing.JPanel; -import java.util.ArrayList; -import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; +import java.util.ArrayList; +import java.util.List; /** * 一般数据界面 @@ -67,7 +68,9 @@ public class NormalChartDataPane extends DataContentsPane { label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,8)); - this.add(northPane, BorderLayout.NORTH); + if (ChartEditContext.normalMode()) { + this.add(northPane, BorderLayout.NORTH); + } this.add(cardPane, BorderLayout.CENTER); } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java new file mode 100644 index 0000000000..23616a482a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java @@ -0,0 +1,26 @@ +package com.fr.design.mainframe.chart.mode; + +import com.fr.common.annotations.Open; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2021/6/4 + */ +@Open +public class ChartEditContext { + + private static ChartEditMode current = ChartEditMode.NORMAL; + + public static void switchTo(ChartEditMode mode) { + current = mode; + } + + public static boolean duchampMode() { + return current == ChartEditMode.DUCHAMP; + } + + public static boolean normalMode() { + return current == ChartEditMode.NORMAL; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java new file mode 100644 index 0000000000..c5cc9da489 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java @@ -0,0 +1,12 @@ +package com.fr.design.mainframe.chart.mode; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2021/6/4 + */ +//todo:refactor 弹出框图表没有单元格数据源,就不用一层层传下去了 +public enum ChartEditMode { + NORMAL, + DUCHAMP +} diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java index a1a088020f..64b4808535 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java @@ -14,10 +14,14 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +import static com.fr.design.chart.fun.ChartTypeUIProvider.CURRENT_API_LEVEL; /** * Created by shine on 2018/3/2. */ +@API(level = CURRENT_API_LEVEL) public abstract class AbstractExtendedChartUIProvider extends AbstractProvider implements ChartTypeUIProvider { protected abstract AbstractExtendedChartTableDataPane getTableDataSourcePane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomInteractivePane.java index f399d90e81..8aab51b3f8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomInteractivePane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.custom.other; import com.fr.chart.chartattr.Plot; - import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.type.CustomStyle; @@ -37,6 +36,9 @@ public class VanChartCustomInteractivePane extends VanChartInteractivePane { @Override protected void populateHyperlink(Plot plot) { + if (hyperlinkPane == null) { + return; + } hyperlinkPane.populateBean(chart); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index 885931cb93..8e487a690c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -17,6 +17,7 @@ import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; @@ -120,7 +121,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { double[] rowSize = {p, p, p, p, p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = ChartEditContext.normalMode() ? new Component[][]{ new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, //大数据模式 恢复用注释。取消注释。 //new Component[]{createLargeDataModePane(), null}, @@ -129,6 +130,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null}, new Component[]{createAutoRefreshPane(plot), null}, new Component[]{createHyperlinkPane(), null} + } : new Component[][]{ + new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, + new Component[]{createAnimationPane(), null}, + new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, + new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -487,6 +493,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { protected void populateHyperlink(Plot plot) { + if (superLink == null) { + return; + } superLink.populate(plot); } @@ -526,7 +535,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected void populateAutoRefresh(VanChart chart) { - VanChartPlot plot = chart.getPlot(); + if (autoRefreshPane == null) { + return; + } RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel(); if (refreshMoreLabel == null) { 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 1c8c98f42b..0122b529be 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 @@ -7,6 +7,7 @@ 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.mainframe.chart.mode.ChartEditContext; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.vanchart.VanChart; @@ -39,13 +40,18 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = ChartEditContext.normalMode() ? new Component[][]{ new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null}, new Component[]{createAnimationPane(), null}, new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null}, new Component[]{createDrillToolsPane(), null}, new Component[]{createAutoRefreshPane(plot), null}, new Component[]{createHyperlinkPane(), null} + } : new Component[][]{ + new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null}, + new Component[]{createAnimationPane(), null}, + new Component[]{createZoomPane(new double[]{p, p, p}, columnSize, plot), null}, + new Component[]{createDrillToolsPane(), null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java index 0f89fed693..a6ede0df7e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java @@ -27,6 +27,9 @@ public class VanChartMapInteractivePane extends VanChartInteractivePaneWithMapZo @Override protected void populateHyperlink(Plot plot) { + if (hyperlinkPane == null) { + return; + } hyperlinkPane.populateBean(plot); }