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