Browse Source

CHART-21570 大屏模板中的图表默认自定义

final/11.0
shine 3 years ago
parent
commit
cf0ae930be
  1. 10
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  2. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  3. 19
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

10
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -11,8 +11,10 @@ import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
@ -23,10 +25,10 @@ import javax.swing.JSplitPane;
import javax.swing.ListCellRenderer;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.awt.Color;
import java.awt.Component;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class ChartTypePane extends ChartCommonWizardPane implements CallbackEvent {
private static final long serialVersionUID = -1175602484968520546L;
@ -153,6 +155,10 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
}
}
if (!ChartEditContext.supportTheme() && chart4Update instanceof VanChart) {
((VanChart) chart4Update).setThemeAutoCustom();
}
update(chart4Update);
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -24,6 +24,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.general.Background;
import com.fr.js.NameJavaScriptGroup;
import com.fr.log.FineLoggerFactory;
@ -152,6 +153,9 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Van
//切换类型埋点
ChartInfoCollector.getInstance().updateChartTypeTime(chart, oldPlot.getPlotID());
}
if (!ChartEditContext.supportTheme()) {
chart.setThemeAutoCustom();
}
if (!acceptDefinition(chart.getChartDataDefinition(), newPlot)) {
chart.setChartDataDefinition(null);
}

19
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -9,6 +9,7 @@ import com.fr.design.gui.ilable.UILabel;
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.general.ComparatorUtils;
import com.fr.plugin.chart.base.GisLayer;
import com.fr.plugin.chart.map.VanChartMapPlot;
@ -84,7 +85,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
private JPanel createGISLayerPane() {
gisButton = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"),
Toolkit.i18nText("Fine-Design_Form_Widget_Style_Standard"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
gisButton.setSelectedIndex(0);
gisButton.setSelectedIndex(ChartEditContext.supportTheme() ? 0 : 1);
gisGaoDeLayer = new UIComboBox(MapLayerConfigManager.getGaoDeLayerItems());
gisButton.addActionListener(event -> {
refreshZoomLevel();
@ -236,9 +237,19 @@ public class GisLayerPane extends JPanel implements UIObserver {
}
public void resetGisLayer(VanChartMapPlot mapPlot) {
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
if (ChartEditContext.supportTheme()) {
GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
populate(defaultGisLayer);
} else {
GaoDeGisType gaoDeGisType = mapPlot.getDefaultGisLayerType();
mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API);
mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
populate(mapPlot.getGisLayer());
}
}
public void populate(GisLayer layer) {

Loading…
Cancel
Save