diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeDialog.java index 875cc6bae6..1864a91b1f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeDialog.java @@ -28,15 +28,14 @@ public abstract class TemplateThemeDialog extends JDialog { private final JPanel contentContainer; private final JPanel actionContainer; + private final int dialogContentHeight; public TemplateThemeDialog(Window parent, String title, int contentWidth, int contentHeight) { super(parent, ModalityType.APPLICATION_MODAL); - setTitle(title); setResizable(false); setLayout(FRGUIPaneFactory.createBorderLayout()); - - int dialogContentHeight = contentHeight + DIALOG_BOTTOM_ACTION_BAR_HEIGHT; + dialogContentHeight = contentHeight + DIALOG_BOTTOM_ACTION_BAR_HEIGHT; int dialogWindowHeight = dialogContentHeight + DIALOG_TITLE_HEIGHT; setSize(new Dimension(contentWidth, dialogWindowHeight)); @@ -54,6 +53,12 @@ public abstract class TemplateThemeDialog extends JDialog { setContentPane(contentContainer); } + @Override + public void doLayout() { + this.setSize(new Dimension(this.getWidth(), dialogContentHeight + this.getInsets().top)); + super.doLayout(); + } + protected void setupContentPane() { contentContainer.add(createContentPane(), BorderLayout.CENTER, 0); } @@ -63,10 +68,11 @@ public abstract class TemplateThemeDialog extends JDialog { } protected UIButton[] createLeftButtons() { - return new UIButton[] {}; + return new UIButton[]{}; } + protected UIButton[] createRightButtons() { - return new UIButton[] {}; + return new UIButton[]{}; } public void setupActionButtons() { @@ -89,7 +95,7 @@ public abstract class TemplateThemeDialog extends JDialog { } private JPanel createActionsContainer(int align, UIButton... buttons) { - JPanel container = new JPanel(new FlowLayout(align, DIALOG_BOTTOM_ACTION_BUTTON_GAP, 0)); + JPanel container = new JPanel(new FlowLayout(align, DIALOG_BOTTOM_ACTION_BUTTON_GAP, 0)); int paddingVertical = getPaddingVertical(); container.setBorder(BorderFactory.createEmptyBorder(paddingVertical, 0, paddingVertical, 0)); @@ -97,7 +103,7 @@ public abstract class TemplateThemeDialog extends JDialog { return container; } - for (UIButton button: buttons) { + for (UIButton button : buttons) { if (button != null) { button.setPreferredSize(new Dimension(button.getPreferredSize().width, DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT)); container.add(button); @@ -111,7 +117,7 @@ public abstract class TemplateThemeDialog extends JDialog { return createActionsContainer(FlowLayout.RIGHT, buttons); } - private int getPaddingVertical(){ + private int getPaddingVertical() { return (DIALOG_BOTTOM_ACTION_BAR_HEIGHT - DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT) / 2; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java index 2033e7072d..103b6ca6e0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java @@ -45,8 +45,9 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane