Browse Source

Pull request #6550: CHART-21737 fix bugs

Merge in DESIGN/design from ~ZHENG/c-design:release/11.0 to release/11.0

* commit '6c9a8425334a71b7e8ab88df6779aefd273a8a3d':
  update
  CHART-21570 大屏模板中的图表默认自定义
  CHART-21570 大屏模板 cpt组件中的图表也不支持跟随主题
  CHART-21570 适配11.0 大屏模板中的cpt组件 不支持跟随主题
  CHART-21737 fix:大屏模板中的图表组件 设置第一个配色不生效
bugfix/11.0
zheng 3 years ago
parent
commit
c2cc724de4
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java
  2. 11
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  3. 10
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  4. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java
  5. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  6. 19
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  7. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  8. 6
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

5
designer-base/src/main/java/com/fr/design/mainframe/chart/mode/ChartEditContext.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.chart.mode;
import com.fr.common.annotations.Open;
import com.fr.design.base.mode.DesignModeContext;
/**
* @author shine
@ -27,9 +28,9 @@ public class ChartEditContext {
/**
* 是否支持 主题样式 设置
*
* @return duchamp大屏模板模式 不支持
* @return duchamp大屏模板模式 不支持 图表组件&cpt组件中的图表 都不支持
*/
public static boolean supportTheme() {
return !duchampMode();
return !DesignModeContext.isDuchampMode();
}
}

11
designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java

@ -43,4 +43,15 @@ public class AdjustWorkBookDefaultStyleUtils {
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color;
}
/**
* cpt模板是否支持跟随主题选项
* 单元格样式
* 悬浮元素样式
* 纸张背景入口大屏模板屏蔽掉了 忽略
* @return 大屏模板中cpt组件不支持
*/
public static boolean supportTheme() {
return !DesignModeContext.isDuchampMode();
}
}

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).setAutoThemeCustom();
}
update(chart4Update);
}

3
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
@ -63,7 +64,7 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe
}
public void updateBean(AttrFillStyle attrFillStyle) {
if (getStyleSelectBox().getSelectedIndex() == 0) {
if (getStyleSelectBox().getSelectedIndex() == 0 && ChartEditContext.supportTheme()) {
attrFillStyle.setThemed(true);
return;
}

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.setAutoThemeCustom();
}
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) {

6
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -13,6 +13,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
@ -38,6 +39,7 @@ public class StylePane extends BasicPane implements UIObserver {
public static final int DEFAULT_SELECTED_INDEX = 0;
private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomStylePane customStylePane;
private final ThemedCellStyleListPane themedCellStyleListPane;
private final CardLayout cardLayout;
@ -64,7 +66,7 @@ public class StylePane extends BasicPane implements UIObserver {
private void initializePane() {
setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1));
add(createFollowingThemePane(), BorderLayout.NORTH);
add(followingThemePane = createFollowingThemePane(), BorderLayout.NORTH);
contentPane = createTabbedContentPane();
add(contentPane, BorderLayout.CENTER);
}
@ -226,6 +228,8 @@ public class StylePane extends BasicPane implements UIObserver {
setSelectedIndex(1);
customStylePane.populateBean(style);
}
//单元格配置界面是单例 所以直接在populate的时候把跟随主题的按钮组设置不可见
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
}
private void fireStateChanged() {

6
designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

@ -27,6 +27,7 @@ import com.fr.design.style.BorderUtils;
import com.fr.design.style.FRFontPane;
import com.fr.design.style.FormatPane;
import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
@ -66,6 +67,7 @@ public class ReportStylePane extends BasicPane {
private final CellStylePreviewPane previewArea;
private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomFloatStyleSettingPane customStylePane;
private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane;
private final CardLayout cardLayout;
@ -106,7 +108,7 @@ public class ReportStylePane extends BasicPane {
add(createPreviewPane(), BorderLayout.NORTH);
JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel followingThemePane = createFollowingThemePane();
followingThemePane = createFollowingThemePane();
followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0));
settingContainer.add(followingThemePane, BorderLayout.NORTH);
settingContainer.add(contentPane, BorderLayout.CENTER);
@ -319,6 +321,8 @@ public class ReportStylePane extends BasicPane {
setSelectedIndex(1);
customStylePane.populateBean(style);
}
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
}
public void updatePreviewArea() {

Loading…
Cancel
Save