Browse Source

Pull request #4526: CHART-18787 design 编辑器.图表配置界面

Merge in DESIGN/design from ~ZHENG/c-design:feature/big-screen to feature/big-screen

* commit '65d5e8179b44118b44a52a4569168d38625b4e02':
  api level
  feat:编辑器模式 没有单元格数据源 图表切换 监控刷新等配置项
feature/big-screen
zheng 3 years ago
parent
commit
38a6d99d60
  1. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  2. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  3. 26
      designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java
  4. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditMode.java
  5. 4
      designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartUIProvider.java
  6. 4
      designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomInteractivePane.java
  7. 15
      designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java
  8. 8
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java
  9. 3
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapInteractivePane.java

12
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();
}

7
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));
if (ChartEditContext.normalMode()) {
this.add(northPane, BorderLayout.NORTH);
}
this.add(cardPane, BorderLayout.CENTER);
}

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

12
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
}

4
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();

4
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);
}

15
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<Chart> {
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<Chart> {
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<Chart> {
protected void populateHyperlink(Plot plot) {
if (superLink == null) {
return;
}
superLink.populate(plot);
}
@ -526,7 +535,9 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane<Chart> {
}
protected void populateAutoRefresh(VanChart chart) {
VanChartPlot plot = chart.getPlot();
if (autoRefreshPane == null) {
return;
}
RefreshMoreLabel refreshMoreLabel = chart.getRefreshMoreLabel();
if (refreshMoreLabel == null) {

8
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);

3
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);
}

Loading…
Cancel
Save