Browse Source

REPORT-61338 设计器主题-主题配色修改保存后出现异常空白提示框

【问题原因】
AlphaFine需要一个不带参数的默认构造函数,用于构建面板

【改动思路】
同上
final/11.0
Starryi 3 years ago
parent
commit
205e0eb733
  1. 23
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java
  2. 13
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  3. 33
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java

23
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java

@ -22,6 +22,7 @@ import com.fr.design.menu.ToolBarDef;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nullable;
import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.CallBackAdaptor;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -67,19 +68,19 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
private final Window window; private final Window window;
public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane(Window window) { public static TemplateThemeGridControlPane<FormTheme> createFormThemesManagerPane(@Nullable Window window) {
FormThemeConfig config = FormThemeConfig.getInstance(); FormThemeConfig config = FormThemeConfig.getInstance();
FormThemeProfilePane editPane = new FormThemeProfilePane(config); FormThemeProfilePane editPane = new FormThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(window, config, editPane); return new TemplateThemeGridControlPane<>(window, config, editPane);
} }
public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane(Window window) { public static TemplateThemeGridControlPane<ReportTheme> createReportThemesManagerPane(@Nullable Window window) {
ReportThemeConfig config = ReportThemeConfig.getInstance(); ReportThemeConfig config = ReportThemeConfig.getInstance();
ReportThemeProfilePane editPane = new ReportThemeProfilePane(config); ReportThemeProfilePane editPane = new ReportThemeProfilePane(config);
return new TemplateThemeGridControlPane<>(window, config, editPane); return new TemplateThemeGridControlPane<>(window, config, editPane);
} }
public TemplateThemeGridControlPane(Window window, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) { public TemplateThemeGridControlPane(@Nullable Window window, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window; this.window = window;
this.config = config; this.config = config;
this.profilePane = profilePane; this.profilePane = profilePane;
@ -124,13 +125,15 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
} }
private void registerWindowListener() { private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() { if (window != null) {
@Override window.addWindowListener(new WindowAdapter() {
public void windowClosed(WindowEvent e) { @Override
super.windowClosed(e); public void windowClosed(WindowEvent e) {
asyncThemeFetcher.shutdown(); super.windowClosed(e);
} asyncThemeFetcher.shutdown();
}); }
});
}
} }
private void resetEnableRemoveAction(T selectedTheme, RemoveThemeAction removeAction) { private void resetEnableRemoveAction(T selectedTheme, RemoveThemeAction removeAction) {

13
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java

@ -22,6 +22,7 @@ import com.fr.design.mainframe.theme.provider.ThemeManageActionProvider;
import com.fr.design.mainframe.theme.ui.BreadcrumbBar; import com.fr.design.mainframe.theme.ui.BreadcrumbBar;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.unit.FU; import com.fr.stable.unit.FU;
import com.fr.third.javax.annotation.Nullable;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -62,11 +63,15 @@ public class TemplateThemeGridPagesPane extends JPanel {
private PageChangeListener pageChangeListener; private PageChangeListener pageChangeListener;
private TemplateThemeGridPagePane currentTemplateThemeGridPagePane; private TemplateThemeGridPagePane currentTemplateThemeGridPagePane;
public TemplateThemeGridPagesPane(Window window) { public TemplateThemeGridPagesPane() {
initializePane(null);
}
public TemplateThemeGridPagesPane(@Nullable Window window) {
initializePane(window); initializePane(window);
} }
private void initializePane(Window window) { private void initializePane(@Nullable Window window) {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
@ -234,7 +239,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
private final JTemplate<?,?> template; private final JTemplate<?,?> template;
public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane; public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane;
public TemplateThemeUsingPane(Window window) { public TemplateThemeUsingPane(@Nullable Window window) {
super(); super();
setLayout(new BorderLayout()); setLayout(new BorderLayout());
setBorder(new CompoundBorder( setBorder(new CompoundBorder(
@ -273,7 +278,7 @@ public class TemplateThemeGridPagesPane extends JPanel {
public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane { public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane {
private final UITabbedPane tabbedPane; private final UITabbedPane tabbedPane;
public TemplateThemeManagingPane(Window window) { public TemplateThemeManagingPane(@Nullable Window window) {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();

33
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPane.java

@ -9,6 +9,7 @@ import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nullable;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -56,7 +57,7 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
private final Window window; private final Window window;
public TemplateThemeGridPane(Window window, boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) { public TemplateThemeGridPane(@Nullable Window window, boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.window = window; this.window = window;
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker; this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config; this.config = config;
@ -90,21 +91,23 @@ public class TemplateThemeGridPane<T extends TemplateTheme> extends BasicPane {
} }
private void registerWindowListener() { private void registerWindowListener() {
window.addWindowListener(new WindowAdapter() { if (window != null) {
@Override window.addWindowListener(new WindowAdapter() {
public void windowOpened(WindowEvent e) { @Override
super.windowOpened(e); public void windowOpened(WindowEvent e) {
startListenThemeConfig(); super.windowOpened(e);
asyncFetchThemes(); startListenThemeConfig();
} asyncFetchThemes();
}
@Override @Override
public void windowClosed(WindowEvent e) { public void windowClosed(WindowEvent e) {
super.windowClosed(e); super.windowClosed(e);
stopListenThemeConfig(); stopListenThemeConfig();
asyncThemeFetcher.shutdown(); asyncThemeFetcher.shutdown();
} }
}); });
}
} }
public void fillContentListPane() { public void fillContentListPane() {

Loading…
Cancel
Save