From fde1a587e2248dab3d19a5275e0b65d9302ae7d1 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 14 Oct 2021 16:06:44 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-60561=20=E5=85=A8=E5=B1=80=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94-=E6=A0=B7=E5=BC=8F=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/fit/BaseFitAttrPane.java | 37 ++++++++++++------- .../java/com/fr/design/mainframe/JForm.java | 2 +- .../fr/design/webattr/ServerFitAttrPane.java | 13 ++++++- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java index 31ea6417b..31afb3347 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java @@ -17,7 +17,6 @@ import com.fr.report.fit.ReportFitAttr; import javax.swing.*; -import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -33,6 +32,7 @@ import static com.fr.design.i18n.Toolkit.i18nText; public abstract class BaseFitAttrPane extends BasicBeanPane { protected JPanel contentJPanel; + protected UILabel belowSetLabel; protected UIComboBox itemChoose; protected java.util.List fitAttrModelList = new ArrayList<>(); @@ -97,7 +97,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { } attrJPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - attrJPanel.setBorder(new EmptyBorder(0, 100, 10, 100)); + attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0)); contentJPanel.add(attrJPanel); } @@ -136,9 +136,18 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { protected void initPreviewJPanel() { previewJPanel = new FitPreviewPane(); + previewJPanel.setBorder(BorderFactory.createEmptyBorder(0, getPreviewJPanelLeft(), 0, 0)); contentJPanel.add(previewJPanel); } + private int getPreviewJPanelLeft() { + int left = 0; + if (belowSetLabel.getPreferredSize() != null) { + left = belowSetLabel.getPreferredSize().width + BELOW_SET_COMPONENT_HSPACE; + } + return left; + } + protected int getStateInPC(int index) { FitType[] fitTypes = fitAttrModel.getFitTypes(); return fitTypes[index].getState(); @@ -188,29 +197,26 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { protected void initComponents() { this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - contentJPanel = new JPanel(); - contentJPanel.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); + contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0); this.add(contentJPanel); initItemChoose(); + initPrompt(); } private void initItemChoose() { - JPanel chooseJPanel = new JPanel(); - chooseJPanel.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); + JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); ItemListener itemListener = getItemListener(); itemChoose = new UIComboBox(getItemNames()); itemChoose.addItemListener(itemListener); - UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); + belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); + JPanel hSpaceLabel = new JPanel(); + hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0); JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ - belowSetLabel, itemChoose}, FlowLayout.LEFT, BELOW_SET_COMPONENT_HSPACE); + belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT); chooseJPanel.add(buttonPane); - chooseJPanel.setPreferredSize(new Dimension(500, 50)); - JPanel jPanel = new JPanel(); - jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - jPanel.add(chooseJPanel, BorderLayout.WEST); - - contentJPanel.add(jPanel); + chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + contentJPanel.add(chooseJPanel); } @@ -221,6 +227,9 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { } + protected void initPrompt() { + } + protected void refresh() { validate(); repaint(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 0bee88e90..6d7bf83ae 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -576,7 +576,7 @@ public class JForm extends JTemplate implements BaseJForm