Browse Source

CHART-21570 适配11.0 大屏模板中的cpt组件 不支持跟随主题

bugfix/11.0
shine 3 years ago
parent
commit
ea5a6fc9bb
  1. 11
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java
  2. 6
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  3. 6
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

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

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.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -38,6 +39,7 @@ public class StylePane extends BasicPane implements UIObserver {
public static final int DEFAULT_SELECTED_INDEX = 0; public static final int DEFAULT_SELECTED_INDEX = 0;
private final UIButtonGroup<String> followingThemeButtonGroup; private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomStylePane customStylePane; private final CustomStylePane customStylePane;
private final ThemedCellStyleListPane themedCellStyleListPane; private final ThemedCellStyleListPane themedCellStyleListPane;
private final CardLayout cardLayout; private final CardLayout cardLayout;
@ -64,7 +66,7 @@ public class StylePane extends BasicPane implements UIObserver {
private void initializePane() { private void initializePane() {
setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1)); setLayout(new BorderLayout(0, IntervalConstants.INTERVAL_L1));
add(createFollowingThemePane(), BorderLayout.NORTH); add(followingThemePane = createFollowingThemePane(), BorderLayout.NORTH);
contentPane = createTabbedContentPane(); contentPane = createTabbedContentPane();
add(contentPane, BorderLayout.CENTER); add(contentPane, BorderLayout.CENTER);
} }
@ -226,6 +228,8 @@ public class StylePane extends BasicPane implements UIObserver {
setSelectedIndex(1); setSelectedIndex(1);
customStylePane.populateBean(style); customStylePane.populateBean(style);
} }
//单元格配置界面是单例 所以直接在populate的时候把跟随主题的按钮组设置不可见
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
} }
private void fireStateChanged() { 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.FRFontPane;
import com.fr.design.style.FormatPane; import com.fr.design.style.FormatPane;
import com.fr.design.style.background.BackgroundPane; import com.fr.design.style.background.BackgroundPane;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
@ -66,6 +67,7 @@ public class ReportStylePane extends BasicPane {
private final CellStylePreviewPane previewArea; private final CellStylePreviewPane previewArea;
private final UIButtonGroup<String> followingThemeButtonGroup; private final UIButtonGroup<String> followingThemeButtonGroup;
private JPanel followingThemePane;
private final CustomFloatStyleSettingPane customStylePane; private final CustomFloatStyleSettingPane customStylePane;
private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane; private final ThemedFloatStyleSettingPane themedFloatStyleSettingPane;
private final CardLayout cardLayout; private final CardLayout cardLayout;
@ -106,7 +108,7 @@ public class ReportStylePane extends BasicPane {
add(createPreviewPane(), BorderLayout.NORTH); add(createPreviewPane(), BorderLayout.NORTH);
JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel settingContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel followingThemePane = createFollowingThemePane(); followingThemePane = createFollowingThemePane();
followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0)); followingThemePane.setBorder(BorderFactory.createEmptyBorder(20, 0, 10, 0));
settingContainer.add(followingThemePane, BorderLayout.NORTH); settingContainer.add(followingThemePane, BorderLayout.NORTH);
settingContainer.add(contentPane, BorderLayout.CENTER); settingContainer.add(contentPane, BorderLayout.CENTER);
@ -319,6 +321,8 @@ public class ReportStylePane extends BasicPane {
setSelectedIndex(1); setSelectedIndex(1);
customStylePane.populateBean(style); customStylePane.populateBean(style);
} }
followingThemePane.setVisible(AdjustWorkBookDefaultStyleUtils.supportTheme());
} }
public void updatePreviewArea() { public void updatePreviewArea() {

Loading…
Cancel
Save