Browse Source

Pull request #7098: REPORT-62424 【模板主题】见附件截图,windows的主题配置中的整体预览图显示有点问题

Merge in DESIGN/design from ~KERRY/design_10.0:feature/x to feature/x

* commit '8f733e588b7a225e67bed61c07c22cb24a9a6a82':
  REPORT-62424	【模板主题】见附件截图,windows的主题配置中的整体预览图显示有点问题
feature/x
kerry 3 years ago
parent
commit
ce44f4b365
  1. 20
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeDialog.java
  2. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

20
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 contentContainer;
private final JPanel actionContainer; private final JPanel actionContainer;
private final int dialogContentHeight;
public TemplateThemeDialog(Window parent, String title, int contentWidth, int contentHeight) { public TemplateThemeDialog(Window parent, String title, int contentWidth, int contentHeight) {
super(parent, ModalityType.APPLICATION_MODAL); super(parent, ModalityType.APPLICATION_MODAL);
setTitle(title); setTitle(title);
setResizable(false); setResizable(false);
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
dialogContentHeight = contentHeight + DIALOG_BOTTOM_ACTION_BAR_HEIGHT;
int dialogContentHeight = contentHeight + DIALOG_BOTTOM_ACTION_BAR_HEIGHT;
int dialogWindowHeight = dialogContentHeight + DIALOG_TITLE_HEIGHT; int dialogWindowHeight = dialogContentHeight + DIALOG_TITLE_HEIGHT;
setSize(new Dimension(contentWidth, dialogWindowHeight)); setSize(new Dimension(contentWidth, dialogWindowHeight));
@ -54,6 +53,12 @@ public abstract class TemplateThemeDialog extends JDialog {
setContentPane(contentContainer); setContentPane(contentContainer);
} }
@Override
public void doLayout() {
this.setSize(new Dimension(this.getWidth(), dialogContentHeight + this.getInsets().top));
super.doLayout();
}
protected void setupContentPane() { protected void setupContentPane() {
contentContainer.add(createContentPane(), BorderLayout.CENTER, 0); contentContainer.add(createContentPane(), BorderLayout.CENTER, 0);
} }
@ -63,10 +68,11 @@ public abstract class TemplateThemeDialog extends JDialog {
} }
protected UIButton[] createLeftButtons() { protected UIButton[] createLeftButtons() {
return new UIButton[] {}; return new UIButton[]{};
} }
protected UIButton[] createRightButtons() { protected UIButton[] createRightButtons() {
return new UIButton[] {}; return new UIButton[]{};
} }
public void setupActionButtons() { public void setupActionButtons() {
@ -97,7 +103,7 @@ public abstract class TemplateThemeDialog extends JDialog {
return container; return container;
} }
for (UIButton button: buttons) { for (UIButton button : buttons) {
if (button != null) { if (button != null) {
button.setPreferredSize(new Dimension(button.getPreferredSize().width, DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT)); button.setPreferredSize(new Dimension(button.getPreferredSize().width, DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT));
container.add(button); container.add(button);
@ -111,7 +117,7 @@ public abstract class TemplateThemeDialog extends JDialog {
return createActionsContainer(FlowLayout.RIGHT, buttons); return createActionsContainer(FlowLayout.RIGHT, buttons);
} }
private int getPaddingVertical(){ private int getPaddingVertical() {
return (DIALOG_BOTTOM_ACTION_BAR_HEIGHT - DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT) / 2; return (DIALOG_BOTTOM_ACTION_BAR_HEIGHT - DIALOG_BOTTOM_ACTION_BUTTON_HEIGHT) / 2;
} }

5
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -45,8 +45,9 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane(); reportPreviewPane = new ECReportPreviewPane();
this.add(reportPreviewPane, BorderLayout.CENTER); reportPreviewPane.setPreferredSize(new Dimension(615, 297));
this.add(chartPreviewPane, BorderLayout.SOUTH); this.add(reportPreviewPane, BorderLayout.NORTH);
this.add(chartPreviewPane, BorderLayout.CENTER);
} }
@Override @Override

Loading…
Cancel
Save