|
|
@ -38,6 +38,7 @@ import java.awt.Graphics; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import java.awt.Graphics2D; |
|
|
|
import java.awt.RenderingHints; |
|
|
|
import java.awt.RenderingHints; |
|
|
|
import java.awt.Stroke; |
|
|
|
import java.awt.Stroke; |
|
|
|
|
|
|
|
import java.awt.Window; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
@ -61,11 +62,11 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
private PageChangeListener pageChangeListener; |
|
|
|
private PageChangeListener pageChangeListener; |
|
|
|
private TemplateThemeGridPagePane currentTemplateThemeGridPagePane; |
|
|
|
private TemplateThemeGridPagePane currentTemplateThemeGridPagePane; |
|
|
|
|
|
|
|
|
|
|
|
public TemplateThemeGridPagesPane() { |
|
|
|
public TemplateThemeGridPagesPane(Window window) { |
|
|
|
initializePane(); |
|
|
|
initializePane(window); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initializePane() { |
|
|
|
private void initializePane(Window window) { |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); |
|
|
|
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); |
|
|
|
|
|
|
|
|
|
|
@ -82,9 +83,9 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
add(contentPane, BorderLayout.CENTER); |
|
|
|
add(contentPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
themeUsingPane = new TemplateThemeUsingPane(); |
|
|
|
themeUsingPane = new TemplateThemeUsingPane(window); |
|
|
|
contentPane.add(themeUsingPane, themeUsingPane.getTitle()); |
|
|
|
contentPane.add(themeUsingPane, themeUsingPane.getTitle()); |
|
|
|
themeManagingPane = new TemplateThemeManagingPane(); |
|
|
|
themeManagingPane = new TemplateThemeManagingPane(window); |
|
|
|
contentPane.add(themeManagingPane, themeManagingPane.getTitle()); |
|
|
|
contentPane.add(themeManagingPane, themeManagingPane.getTitle()); |
|
|
|
|
|
|
|
|
|
|
|
showThemeUsingPane(); |
|
|
|
showThemeUsingPane(); |
|
|
@ -189,11 +190,6 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
return button; |
|
|
|
return button; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void exit() { |
|
|
|
|
|
|
|
themeUsingPane.exit(); |
|
|
|
|
|
|
|
themeManagingPane.exit(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setPageChangeListener(PageChangeListener changeListener) { |
|
|
|
public void setPageChangeListener(PageChangeListener changeListener) { |
|
|
|
this.pageChangeListener = changeListener; |
|
|
|
this.pageChangeListener = changeListener; |
|
|
|
} |
|
|
|
} |
|
|
@ -232,15 +228,13 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
public abstract static class TemplateThemeGridPagePane extends BasicPane { |
|
|
|
public abstract static class TemplateThemeGridPagePane extends BasicPane { |
|
|
|
public abstract TemplateThemeConfig<? extends TemplateTheme> getConfig(); |
|
|
|
public abstract TemplateThemeConfig<? extends TemplateTheme> getConfig(); |
|
|
|
|
|
|
|
|
|
|
|
public void exit() { } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static class TemplateThemeUsingPane extends TemplateThemeGridPagePane { |
|
|
|
public static class TemplateThemeUsingPane extends TemplateThemeGridPagePane { |
|
|
|
private final JTemplate<?,?> template; |
|
|
|
private final JTemplate<?,?> template; |
|
|
|
public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane; |
|
|
|
public final TemplateThemeGridPane<? extends TemplateTheme> themeListPane; |
|
|
|
|
|
|
|
|
|
|
|
public TemplateThemeUsingPane() { |
|
|
|
public TemplateThemeUsingPane(Window window) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
setLayout(new BorderLayout()); |
|
|
|
setBorder(new CompoundBorder( |
|
|
|
setBorder(new CompoundBorder( |
|
|
@ -249,9 +243,7 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
|
|
|
|
|
|
|
|
template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); |
|
|
|
TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig(); |
|
|
|
TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig(); |
|
|
|
themeListPane = new TemplateThemeGridPane<>(false, config, null); |
|
|
|
themeListPane = new TemplateThemeGridPane<>(window, false, config, null); |
|
|
|
|
|
|
|
|
|
|
|
themeListPane.startListenThemeConfig(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
themeListPane.setSelectedChangeListener(new ChangeListener() { |
|
|
|
themeListPane.setSelectedChangeListener(new ChangeListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -272,12 +264,6 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
return template.getUsingTemplateThemeConfig(); |
|
|
|
return template.getUsingTemplateThemeConfig(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void exit() { |
|
|
|
|
|
|
|
themeListPane.stopListenThemeConfig(); |
|
|
|
|
|
|
|
themeListPane.stopAsyncFetchTheme(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Using_Dialog_Title"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Using_Dialog_Title"); |
|
|
@ -286,20 +272,16 @@ 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; |
|
|
|
private final TemplateThemeGridControlPane<FormTheme> formThemesManagerPane; |
|
|
|
|
|
|
|
private final TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public TemplateThemeManagingPane() { |
|
|
|
public TemplateThemeManagingPane(Window window) { |
|
|
|
setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
|
|
|
|
|
|
|
tabbedPane = new UITabbedPane(); |
|
|
|
tabbedPane = new UITabbedPane(); |
|
|
|
tabbedPane.setTabBorderColor(new Color(0xE0E0E1)); |
|
|
|
tabbedPane.setTabBorderColor(new Color(0xE0E0E1)); |
|
|
|
add(tabbedPane, BorderLayout.CENTER); |
|
|
|
add(tabbedPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(); |
|
|
|
TemplateThemeGridControlPane<FormTheme> formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(window); |
|
|
|
formThemesManagerPane.startListenThemeConfig(); |
|
|
|
TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(window); |
|
|
|
reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(); |
|
|
|
|
|
|
|
reportThemesManagerPane.startListenThemeConfig(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane); |
|
|
|
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane); |
|
|
|
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane); |
|
|
|
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane); |
|
|
@ -321,14 +303,6 @@ public class TemplateThemeGridPagesPane extends JPanel { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void exit() { |
|
|
|
|
|
|
|
formThemesManagerPane.stopListenThemeConfig(); |
|
|
|
|
|
|
|
formThemesManagerPane.stopAsyncFetchTheme(); |
|
|
|
|
|
|
|
reportThemesManagerPane.stopListenThemeConfig(); |
|
|
|
|
|
|
|
reportThemesManagerPane.stopAsyncFetchTheme(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Title"); |
|
|
|
return Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Title"); |
|
|
|