From f4b521724171381b4dc4a82b92bfa47148abc834 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 15 Sep 2021 10:52:11 +0800 Subject: [PATCH 01/13] =?UTF-8?q?REPORT-59166=20=E9=9F=A9=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E8=AE=BE=E7=BD=AE=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=20=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=A1=86=E4=BD=93=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/gui/controlpane/UIControlPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 648cb03f33..f7229136f5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -387,8 +387,6 @@ public abstract class UIControlPane extends JControlPane { contentPane.setBackground(originColor); contentPane.setLayout(new BorderLayout()); titleLabel = new UILabel(title); - Font font = new Font("SimSun", Font.PLAIN, 12); - titleLabel.setFont(font); contentPane.add(titleLabel, BorderLayout.WEST); contentPane.setBorder(new EmptyBorder(5, 14, 6, 0)); From 3e3c381ef886ac8505d1f6d2d0268b2f89a7382c Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 9 Oct 2021 10:52:40 +0800 Subject: [PATCH 02/13] =?UTF-8?q?REPORT-59476=20&&=20REPORT-59475=201?= =?UTF-8?q?=E3=80=81=E6=96=87=E6=9C=AC=E6=8E=A7=E4=BB=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A7=84=E5=88=99=E6=94=AF=E6=8C=81=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=202=E3=80=81=E6=8E=A7=E4=BB=B6=E6=A0=A1=E9=AA=8C=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA=E6=94=AF=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/ErrorMsgTextFieldAdapter.java | 11 ++++ .../fr/design/beans/UITextFieldAdapter.java | 46 ++++++++++++++++ .../com/fr/design/fun/RegPaneProvider.java | 11 ++++ .../design/fun/TextFieldAdapterProvider.java | 11 ++++ .../fun/impl/AbstractRegPaneProvider.java | 22 ++++++++ .../AbstractTextFieldAdapterProvider.java | 22 ++++++++ .../fr/design/gui/frpane/RegFieldPane.java | 55 +++++++++---------- .../ui/designer/FieldEditorDefinePane.java | 33 ++++------- .../designer/TextFieldEditorDefinePane.java | 13 ++++- .../widget/ui/FieldEditorDefinePane.java | 36 +++++------- .../widget/ui/TextFieldEditorDefinePane.java | 11 +++- 11 files changed, 193 insertions(+), 78 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java create mode 100644 designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java diff --git a/designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java b/designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java new file mode 100644 index 0000000000..e2444a4eca --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/beans/ErrorMsgTextFieldAdapter.java @@ -0,0 +1,11 @@ +package com.fr.design.beans; + +import javax.swing.JComponent; + +public interface ErrorMsgTextFieldAdapter { + void setText(String str); + + String getText(); + + JComponent getErrorMsgTextField(); +} diff --git a/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java b/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java new file mode 100644 index 0000000000..ba183e6387 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java @@ -0,0 +1,46 @@ +package com.fr.design.beans; + +import com.fr.design.gui.itextfield.UITextField; + +import javax.swing.JComponent; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; + +public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter { + UITextField uiTextField = new UITextField(); + + public UITextFieldAdapter(){ + addDocumentListener(); + } + @Override + public void setText(String str) { + uiTextField.setText(str); + } + + @Override + public String getText() { + return uiTextField.getText(); + } + + public void addDocumentListener() { + uiTextField.getDocument().addDocumentListener(new DocumentListener() { + + public void changedUpdate(DocumentEvent e) { + uiTextField.setToolTipText(uiTextField.getText()); + } + + public void insertUpdate(DocumentEvent e) { + uiTextField.setToolTipText(uiTextField.getText()); + } + + public void removeUpdate(DocumentEvent e) { + uiTextField.setToolTipText(uiTextField.getText()); + } + }); + } + + @Override + public JComponent getErrorMsgTextField() { + return uiTextField; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java new file mode 100644 index 0000000000..26fe62b5e6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/RegPaneProvider.java @@ -0,0 +1,11 @@ +package com.fr.design.fun; + +import com.fr.design.gui.frpane.RegFieldPane; +import com.fr.stable.fun.mark.Immutable; + +public interface RegPaneProvider extends Immutable { + int CURRENT_LEVEL = 1; + String XML_TAG = "RegPaneProvider"; + + RegFieldPane createRegPane(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java b/designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java new file mode 100644 index 0000000000..2c7b7dcc62 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/TextFieldAdapterProvider.java @@ -0,0 +1,11 @@ +package com.fr.design.fun; + +import com.fr.design.beans.ErrorMsgTextFieldAdapter; +import com.fr.stable.fun.mark.Immutable; + +public interface TextFieldAdapterProvider extends Immutable { + String XML_TAG = "ErrorMesPaneWrapperProvider"; + int CURRENT_LEVEL = 1; + + ErrorMsgTextFieldAdapter createTextFieldAdapter(); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java new file mode 100644 index 0000000000..98185f2a5a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractRegPaneProvider.java @@ -0,0 +1,22 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.RegPaneProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Joe + * 2021/10/8 15:19 + */ +@API(level = RegPaneProvider.CURRENT_LEVEL) +public abstract class AbstractRegPaneProvider implements RegPaneProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java new file mode 100644 index 0000000000..bc0836eb40 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractTextFieldAdapterProvider.java @@ -0,0 +1,22 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.TextFieldAdapterProvider; +import com.fr.stable.fun.mark.API; + +/** + * @author Joe + * 2021/10/8 15:17 + */ +@API(level = TextFieldAdapterProvider.CURRENT_LEVEL) +public abstract class AbstractTextFieldAdapterProvider implements TextFieldAdapterProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java index 5d37fb4a96..6e073bb611 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java @@ -1,21 +1,24 @@ package com.fr.design.gui.frpane; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.ErrorMsgTextFieldAdapter; +import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.dialog.BasicPane; +import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.TextEditor; import com.fr.form.ui.reg.NoneReg; import com.fr.form.ui.reg.RegExp; - -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; /** * Created by kerry on 2017/9/4. @@ -23,7 +26,7 @@ import java.awt.*; public class RegFieldPane extends RegPane { protected RegErrorMsgPane regErrorMsgPane; - public RegFieldPane(){ + public RegFieldPane() { this(ALL_REG_TYPE); } @@ -39,8 +42,8 @@ public class RegFieldPane extends RegPane { @Override public void regChangeAction() { - RegExp regExp = (RegExp)getRegComboBox().getSelectedItem(); - if(regExp instanceof NoneReg){ + RegExp regExp = (RegExp) getRegComboBox().getSelectedItem(); + if (regExp instanceof NoneReg) { regErrorMsgPane.setVisible(false); return; } @@ -67,33 +70,29 @@ public class RegFieldPane extends RegPane { } private static class RegErrorMsgPane extends BasicPane { - private UITextField regErrorMsgField; + private ErrorMsgTextFieldAdapter errorMsgTextFieldAdapter; public RegErrorMsgPane() { + initRegErrorMsgField(); + setStyle(); + } + + private void setStyle() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); - initRegErrorMsgField(); UILabel tipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); tipLabel.setPreferredSize(new Dimension(60, 20)); - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{tipLabel, errorMsgTextFieldAdapter.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, 10, LayoutConstants.VGAP_MEDIUM); this.add(panel); } private void initRegErrorMsgField() { - regErrorMsgField = new UITextField(); - regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() { - public void changedUpdate(DocumentEvent e) { - regErrorMsgField.setToolTipText(regErrorMsgField.getText()); - } - - public void insertUpdate(DocumentEvent e) { - regErrorMsgField.setToolTipText(regErrorMsgField.getText()); - } - - public void removeUpdate(DocumentEvent e) { - regErrorMsgField.setToolTipText(regErrorMsgField.getText()); - } - }); + TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); + if (provider != null) { + errorMsgTextFieldAdapter= provider.createTextFieldAdapter(); + return; + } + errorMsgTextFieldAdapter = new UITextFieldAdapter(); } @Override @@ -102,11 +101,11 @@ public class RegFieldPane extends RegPane { } public void populate(TextEditor textEditor) { - regErrorMsgField.setText(textEditor.getRegErrorMessage()); + errorMsgTextFieldAdapter.setText(textEditor.getRegErrorMessage()); } public void update(TextEditor textEditor) { - textEditor.setRegErrorMessage(regErrorMsgField.getText()); + textEditor.setRegErrorMessage(errorMsgTextFieldAdapter.getText()); } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index 45c2cd9686..ea236bac86 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -1,9 +1,13 @@ package com.fr.design.widget.ui.designer; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.ErrorMsgTextFieldAdapter; +import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.*; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; @@ -23,7 +27,7 @@ import java.awt.event.ItemListener; public abstract class FieldEditorDefinePane extends AbstractDataModify { protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UITextField errorMsgTextField; + protected ErrorMsgTextFieldAdapter errorMsgTextField; protected JPanel validatePane; protected FontSizeComboPane fontSizePane; protected UITextField labelNameTextField; @@ -40,7 +44,6 @@ public abstract class FieldEditorDefinePane extends Abstr allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); fontSizePane = new FontSizeComboPane(); - errorMsgTextField = new UITextField(); JPanel contentPane = this.setFirstContentPane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); jPanel.add(contentPane, BorderLayout.CENTER); @@ -76,26 +79,14 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UITextField(); -// // richer:主要为了方便查看比较长的错误信息 - errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { - - public void changedUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - - public void insertUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - - public void removeUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - }); - + TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); + if (provider != null) { + errorMsgTextField= provider.createTextFieldAdapter(); + return; + } + errorMsgTextField = new UITextFieldAdapter(); } - protected abstract T updateSubFieldEditorBean(); protected abstract JPanel setFirstContentPane(); @@ -111,7 +102,7 @@ public abstract class FieldEditorDefinePane extends Abstr validatePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Error_Tip")); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); errorTipPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L5, 0, 0)); borderPane.add(errorTipPane, BorderLayout.CENTER); allowBlankCheckBox.addItemListener(new ItemListener() { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index 2baea973ce..e9c8bf611a 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java @@ -1,7 +1,9 @@ package com.fr.design.widget.ui.designer; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; +import com.fr.design.fun.RegPaneProvider; import com.fr.design.gui.frpane.RegFieldPane; import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.ilable.UILabel; @@ -11,10 +13,11 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.form.ui.TextEditor; - import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.Component; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; @@ -85,6 +88,10 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane protected RegFieldPane createRegPane() { + RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); + if (provider != null) { + return provider.createRegPane(); + } return new RegFieldPane(); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java index 9c20dfb652..8aa15d7541 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -1,19 +1,20 @@ package com.fr.design.widget.ui; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.beans.ErrorMsgTextFieldAdapter; +import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.FieldEditor; import javax.swing.BorderFactory; import javax.swing.JPanel; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ItemEvent; @@ -22,7 +23,7 @@ import java.awt.event.ItemListener; public abstract class FieldEditorDefinePane extends AbstractDataModify { protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UITextField errorMsgTextField; + protected ErrorMsgTextFieldAdapter errorMsgTextField; protected JPanel validatePane; public FieldEditorDefinePane() { @@ -45,23 +46,12 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UITextField(); -// // richer:主要为了方便查看比较长的错误信息 - errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { - - public void changedUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - - public void insertUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - - public void removeUpdate(DocumentEvent e) { - errorMsgTextField.setToolTipText(errorMsgTextField.getText()); - } - }); - + TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); + if (provider != null) { + errorMsgTextField= provider.createTextFieldAdapter(); + return; + } + errorMsgTextField = new UITextFieldAdapter(); } @Override @@ -101,7 +91,7 @@ public abstract class FieldEditorDefinePane extends Abstr allowBlankCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); + final JPanel errorTipPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{uiLabel, errorMsgTextField.getErrorMsgTextField()}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L1, LayoutConstants.VGAP_MEDIUM); errorTipPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); borderPane.add(errorTipPane, BorderLayout.CENTER); allowBlankCheckBox.addItemListener(new ItemListener() { @@ -117,7 +107,7 @@ public abstract class FieldEditorDefinePane extends Abstr new Component[]{allowBlankCheckBox}, new Component[]{borderPane}, }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,TableLayoutHelper.FILL_LASTCOLUMN, 5, 5); + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, 5, 5); panel.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, IntervalConstants.INTERVAL_L6, 0)); validatePane.add(panel, BorderLayout.NORTH); diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index d74d31c507..01fa2f0ac0 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -1,14 +1,15 @@ package com.fr.design.widget.ui; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.fun.RegPaneProvider; import com.fr.design.gui.frpane.RegFieldPane; import com.fr.design.gui.frpane.RegPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.TextEditor; - import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; @@ -60,6 +61,10 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane protected RegFieldPane createRegPane() { + RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); + if (provider != null) { + return provider.createRegPane(); + } return new RegFieldPane(); } From 1bc70a94f3816fb766739d1c5ac13566487f30fa Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 9 Oct 2021 15:32:06 +0800 Subject: [PATCH 03/13] =?UTF-8?q?REPORT-59475=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/beans/UITextFieldAdapter.java | 2 +- .../ui/designer/FieldEditorDefinePane.java | 28 +++++++++++++------ .../designer/TextFieldEditorDefinePane.java | 24 ++++++++++------ .../widget/ui/FieldEditorDefinePane.java | 12 ++++++-- .../widget/ui/TextFieldEditorDefinePane.java | 11 ++++++-- 5 files changed, 53 insertions(+), 24 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java b/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java index ba183e6387..48fa6944fc 100644 --- a/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java +++ b/designer-base/src/main/java/com/fr/design/beans/UITextFieldAdapter.java @@ -7,7 +7,7 @@ import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; public class UITextFieldAdapter implements ErrorMsgTextFieldAdapter { - UITextField uiTextField = new UITextField(); + private final UITextField uiTextField = new UITextField(); public UITextFieldAdapter(){ addDocumentListener(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index ea236bac86..4ee699e0fe 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -5,7 +5,11 @@ import com.fr.design.beans.ErrorMsgTextFieldAdapter; import com.fr.design.beans.UITextFieldAdapter; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; -import com.fr.design.designer.creator.*; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.TextFieldAdapterProvider; import com.fr.design.gui.icheckbox.UICheckBox; @@ -15,12 +19,12 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.ui.designer.component.FontSizeComboPane; import com.fr.form.ui.FieldEditor; +import com.fr.log.FineLoggerFactory; - -import javax.swing.*; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -80,13 +84,19 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); - if (provider != null) { - errorMsgTextField= provider.createTextFieldAdapter(); + if (provider == null) { + errorMsgTextField = new UITextFieldAdapter(); return; } - errorMsgTextField = new UITextFieldAdapter(); + try { + errorMsgTextField = provider.createTextFieldAdapter(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + errorMsgTextField = new UITextFieldAdapter(); + } } + protected abstract T updateSubFieldEditorBean(); protected abstract JPanel setFirstContentPane(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index e9c8bf611a..6e6a2ff145 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java @@ -13,6 +13,7 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.form.ui.TextEditor; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.JPanel; @@ -68,31 +69,36 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, - new Component[]{widgetValueLabel, formWidgetValuePane}, + new Component[]{widgetValueLabel, formWidgetValuePane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"), SwingConstants.LEFT), fontSizePane} }; double[] rowSize = {p, p, p, p, p, p}; - double[] columnSize = {p,f}; - int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}}; - final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {1, 1}}; + final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); boundsPane.add(panel); return boundsPane; } - public JPanel setValidatePane(){ + public JPanel setValidatePane() { return regPane; } - protected RegFieldPane createRegPane() { RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); - if (provider != null) { + if (provider == null) { + return new RegFieldPane(); + } + + try { return provider.createRegPane(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return new RegFieldPane(); } - return new RegFieldPane(); } @Override @@ -109,7 +115,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane @Override protected TextEditor updateSubFieldEditorBean() { - TextEditor ob = (TextEditor)creator.toData(); + TextEditor ob = (TextEditor) creator.toData(); this.regPane.update(ob); ob.setWaterMark(waterMarkDictPane.getText()); formWidgetValuePane.update(ob); diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java index 8aa15d7541..07faec9227 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -12,6 +12,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.FieldEditor; +import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -47,11 +48,16 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); - if (provider != null) { - errorMsgTextField= provider.createTextFieldAdapter(); + if (provider == null) { + errorMsgTextField = new UITextFieldAdapter(); return; } - errorMsgTextField = new UITextFieldAdapter(); + try { + errorMsgTextField = provider.createTextFieldAdapter(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + errorMsgTextField = new UITextFieldAdapter(); + } } @Override diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java index 01fa2f0ac0..72e93e28c8 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/TextFieldEditorDefinePane.java @@ -6,6 +6,7 @@ import com.fr.design.gui.frpane.RegFieldPane; import com.fr.design.gui.frpane.RegPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.TextEditor; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.JPanel; @@ -62,10 +63,16 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane protected RegFieldPane createRegPane() { RegPaneProvider provider = ExtraDesignClassManager.getInstance().getSingle(RegPaneProvider.XML_TAG); - if (provider != null) { + if (provider == null) { + return new RegFieldPane(); + } + + try { return provider.createRegPane(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return new RegFieldPane(); } - return new RegFieldPane(); } @Override From 81bf9616db12bd64fcff3b2ca10001de3eb60f2c Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 9 Oct 2021 15:36:00 +0800 Subject: [PATCH 04/13] =?UTF-8?q?REPORT-59475=20=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/frpane/RegFieldPane.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java index 6e073bb611..38e33514bc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegFieldPane.java @@ -13,6 +13,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.TextEditor; import com.fr.form.ui.reg.NoneReg; import com.fr.form.ui.reg.RegExp; +import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -88,11 +89,17 @@ public class RegFieldPane extends RegPane { private void initRegErrorMsgField() { TextFieldAdapterProvider provider = ExtraDesignClassManager.getInstance().getSingle(TextFieldAdapterProvider.XML_TAG); - if (provider != null) { - errorMsgTextFieldAdapter= provider.createTextFieldAdapter(); + if (provider == null) { + errorMsgTextFieldAdapter = new UITextFieldAdapter(); return; } - errorMsgTextFieldAdapter = new UITextFieldAdapter(); + try { + errorMsgTextFieldAdapter = provider.createTextFieldAdapter(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + errorMsgTextFieldAdapter = new UITextFieldAdapter(); + + } } @Override From b57eedf108107adab5ae3c039ab4a729c2057fbf Mon Sep 17 00:00:00 2001 From: pengda Date: Sat, 9 Oct 2021 17:52:05 +0800 Subject: [PATCH 05/13] =?UTF-8?q?REPORT-56437=20&=20REPORT-58955=20?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/ErrorDialog.java | 2 +- .../src/main/java/com/fr/env/SyncFailedPluginsDialog.java | 3 ++- .../main/resources/com/fr/design/i18n/dimension_en.properties | 1 + .../resources/com/fr/design/i18n/dimension_ja_JP.properties | 1 + .../resources/com/fr/design/i18n/dimension_ko_KR.properties | 1 + .../main/resources/com/fr/design/i18n/dimension_zh.properties | 1 + .../resources/com/fr/design/i18n/dimension_zh_TW.properties | 1 + 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/ErrorDialog.java b/designer-base/src/main/java/com/fr/env/ErrorDialog.java index be91955f2f..a26c673a45 100644 --- a/designer-base/src/main/java/com/fr/env/ErrorDialog.java +++ b/designer-base/src/main/java/com/fr/env/ErrorDialog.java @@ -39,7 +39,7 @@ public class ErrorDialog extends JDialog implements ActionListener { messagePanel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0)); MessageWithLink messageWithLink = new MessageWithLink(message + ",", Toolkit.i18nText("Fine-Design_Basic_Sync_Help"), CloudCenter.getInstance().acquireUrlByKind("help.replacejars", "https://help.fanruan.com/finereport/doc-view-3268.html")); - messageWithLink.setPreferredSize(new Dimension(108, 20)); + messageWithLink.setPreferredSize(new Dimension(150, 20)); JPanel messageLinkPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); messageLinkPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0)); messageLinkPane.add(messageWithLink); diff --git a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java index 8117f87395..fd4b98e33e 100644 --- a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java +++ b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java @@ -5,6 +5,7 @@ import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -62,7 +63,7 @@ public class SyncFailedPluginsDialog extends JDialog { JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); MessageWithLink messageWithLink = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Fail_Suggestion"),Toolkit.i18nText("Fine-Design_Basic_Sync_Deal_Immediately"), CloudCenter.getInstance().acquireUrlByKind("help.installplugins", "https://help.fanruan.com/finereport/doc-view-2198.html")); - messageWithLink.setPreferredSize(new Dimension(316, 20)); + messageWithLink.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.env.SyncFailedPluginsDialog.messageWithLink")); messagePane.add(messageWithLink); messagePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index ef851ffe3f..b69ede5ea8 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -7,4 +7,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=490*95 com.fr.design.version.detail.label=750*30 com.fr.design.version.detail.dialog=900*500 +com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 379c257449..7d09dee4d0 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=430*95 com.fr.design.version.detail.label=650*30 com.fr.design.version.detail.dialog=800*500 +com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.design.web.pane.text.field=400*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 62ee87a7c4..28823bf1ad 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=458*132 com.fr.design.version.check.dialog=450*95 com.fr.design.version.detail.label=700*30 com.fr.design.version.detail.dialog=850*500 +com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*36 com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index fff64947d9..56998f7f7e 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -7,4 +7,5 @@ com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.dialog=600*500 +com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 com.fr.design.web.pane.text.field=450*20 \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 4b2de3f02c..58e6ae1216 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -6,4 +6,5 @@ com.fr.env.RemoteEnvPane.dialog=308*132 com.fr.design.version.check.dialog=230*95 com.fr.design.version.detail.label=450*30 com.fr.design.version.detail.dialog=600*500 +com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20 com.fr.design.web.pane.text.field=450*20 \ No newline at end of file From 8eab8d3d1c93373362433781aac575717fe6c5f5 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Oct 2021 10:27:03 +0800 Subject: [PATCH 06/13] =?UTF-8?q?REPORT-60516=2010.0release=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E6=89=93=E5=BC=80cpt=E5=BE=88=E6=85=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/worker/open/OpenWorker.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java index 1c03c67594..3535078ab9 100644 --- a/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java +++ b/designer-base/src/main/java/com/fr/design/worker/open/OpenWorker.java @@ -53,7 +53,6 @@ public class OpenWorker extends SwingWorker { @Override protected T doInBackground() throws Exception { - TimeUnit.SECONDS.sleep(5); return this.callable.call(); } From 97b64a0b1bcb008ee5461ea9b067c5af7949f6d4 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 11 Oct 2021 14:00:41 +0800 Subject: [PATCH 07/13] =?UTF-8?q?REPORT-60399=20=E3=80=90JDK11=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E3=80=91=E5=90=AF=E5=8A=A8=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E6=A8=A1=E7=B3=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/common/SplashPane4WinAndJDK11.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java b/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java index 458020b587..02aa605339 100644 --- a/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java +++ b/designer-realize/src/main/java/com/fr/start/common/SplashPane4WinAndJDK11.java @@ -7,6 +7,7 @@ import com.fr.design.locale.impl.SplashMark; import com.fr.general.IOUtils; import com.fr.general.locale.LocaleCenter; +import java.awt.RenderingHints; import javax.swing.Icon; import java.awt.Dimension; import java.awt.Graphics; @@ -53,6 +54,7 @@ public class SplashPane4WinAndJDK11 extends SplashPane{ } BufferedImage image = BaseUtils.readImage(imagePath); Graphics2D newG = (Graphics2D)g.create(0, 0, image.getWidth(), image.getHeight()); + newG.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); newG.scale(0.5D, 0.5D); newG.drawImage(image, 0, 0, null); newG.scale(1.0D, 1.0D); From 30f09d8fd0c3020533131697f5c8acb5f1ecc487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 11 Oct 2021 15:57:21 +0800 Subject: [PATCH 08/13] =?UTF-8?q?REPORT-60528=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=EF=BC=8C=E7=BB=99=E4=B8=80=E4=B8=AA=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E8=BE=83=E5=B0=8F=E7=9A=84tab=E5=86=85=E6=8B=96?= =?UTF-8?q?=E5=85=A5=E6=8A=A5=E8=A1=A8=E5=9D=97=EF=BC=8C=E4=BC=9A=E8=A7=A6?= =?UTF-8?q?=E5=8F=91=E5=BC=B9=E7=AA=97=E6=8F=90=E7=A4=BA=E2=80=9C=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E6=88=96=E8=80=85=E5=B0=8F=E4=BA=8Etablayout=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=EF=BC=8C=E4=B8=8D=E8=83=BD=E8=B0=83=E6=95=B4=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E2=80=9D=EF=BC=9B=E5=AE=A2=E6=88=B7=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E7=AA=97=E4=B8=8D=E6=96=AD=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../layout/FRCardMainBorderLayoutAdapter.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java index 742d6b8f41..726c397060 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRCardMainBorderLayoutAdapter.java @@ -4,7 +4,10 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.form.layout.FRBorderLayout; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import java.awt.BorderLayout; @@ -61,7 +64,22 @@ public class FRCardMainBorderLayoutAdapter extends FRBorderLayoutAdapter { private boolean isBeyondMinConstraint(int minConstraint, int value) { if (minConstraint > value) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); - container.setSize(container.getBackupBound().getSize()); + if (container.getBackupBound() != null) { + // 手动拖动导致变矮的场景 + container.setSize(container.getBackupBound().getSize()); + } else { + // 自适应布局平分高度导致变矮的场景 + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + if (jt != null) { + jt.undo(); + } + } + }); + + } return true; } else { return false; From 2c22b71735b9ec63d40c0a451dce9c486b6322ca Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 11 Oct 2021 16:53:47 +0800 Subject: [PATCH 09/13] =?UTF-8?q?REPORT-60561=20=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94-=E6=A0=B7=E5=BC=8F=E7=BB=86?= =?UTF-8?q?=E8=8A=82=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 | 5 ++-- .../fit/menupane/ReportFitAttrAction.java | 23 +------------------ 2 files changed, 4 insertions(+), 24 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 718ce09bf6..31ea6417b4 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 @@ -41,6 +41,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { public JPanel attrJPanel; public FitPreviewPane previewJPanel; public FitAttrModel fitAttrModel; + private static final int BELOW_SET_COMPONENT_HSPACE = 8; protected BaseFitAttrPane() { @@ -179,7 +180,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { @Override protected String title4PopupWindow() { - return i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); + return i18nText("Fine-Designer_PC_Fit_Attr"); } protected abstract String[] getItemNames(); @@ -202,7 +203,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane { itemChoose.addItemListener(itemListener); UILabel belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set")); JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{ - belowSetLabel, itemChoose}, FlowLayout.LEFT, 0, 0); + belowSetLabel, itemChoose}, FlowLayout.LEFT, BELOW_SET_COMPONENT_HSPACE); chooseJPanel.add(buttonPane); chooseJPanel.setPreferredSize(new Dimension(500, 50)); JPanel jPanel = new JPanel(); diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index c0e257739a..36328d9bdd 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java @@ -34,22 +34,6 @@ public class ReportFitAttrAction extends JTemplateAction { return null; } }; - private static final MenuKeySet REPORT_FIT_ATTR_ELEMENTCASE = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'T'; - } - - @Override - public String getMenuName() { - return Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; public ReportFitAttrAction(JTemplate jTemplate) { super(jTemplate); @@ -57,12 +41,7 @@ public class ReportFitAttrAction extends JTemplateAction { } private void initMenuStyle() { - JTemplate jTemplate = getEditingComponent(); - if (jTemplate.isJWorkBook()) { - this.setMenuKeySet(REPORT_FIT_ATTR); - } else { - this.setMenuKeySet(REPORT_FIT_ATTR_ELEMENTCASE); - } + this.setMenuKeySet(REPORT_FIT_ATTR); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/reportfit/fit"); From 295a219bd6eacd18149e92a5a7f59363a02a43e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 12 Oct 2021 10:42:55 +0800 Subject: [PATCH 10/13] =?UTF-8?q?REPORT-60392=20=E3=80=90=E5=9B=BA?= =?UTF-8?q?=E5=AE=9A=E5=B8=83=E5=B1=80-=E5=8E=9F=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E6=8E=A8=E8=8D=904.1=E3=80=91=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80-?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=A9=BA=E7=99=BD=E6=A8=A1=E6=9D=BF/?= =?UTF-8?q?=E5=B8=A6=E5=B8=83=E5=B1=80=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E7=BB=84=E4=BB=B6=E7=9B=AE=E5=BD=95=E6=A0=91=E5=A4=84?= =?UTF-8?q?=EF=BC=8Cbody=E5=90=8D=E5=AD=97=E5=8F=98=E7=A9=BA=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/FormDesigner.java | 10 +--------- .../com/fr/design/widget/ui/designer/NewFormPane.java | 4 +++- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 25bd5749f9..5d651aa021 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1010,15 +1010,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection } private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { - // 不存在center块, 说明是新建的模板 - if (centerWidget == null) { - XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); - layoutContainer.setSize(LARGE_PREFERRED_SIZE); - setRootComponent(layoutContainer); - formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); - return; - } - + // 不存在center块, 说明是新建的模板(fanglei:大人,时代变了) XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); Dimension d = new Dimension(); d.width = ((WFitLayout) centerWidget).getContainerWidth(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index 8ca985ef3a..dfa156d5e1 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -294,7 +294,9 @@ public class NewFormPane extends BasicPane { } private Form initEmptyBodyForm() { - WFitLayout body = new WFitLayout(); + WFitLayout body = new WFitLayout("body"); + body.setContainerWidth(WBorderLayout.DEFAULT_WIDTH); + body.setContainerHeight(WBorderLayout.DEFAULT_HEIGHT); WBorderLayout borderLayout = new WBorderLayout("form"); borderLayout.addCenter(body); return new Form(borderLayout); From eba4ce270b7cb03935f5d11636d6cabfa8f1845c Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 12 Oct 2021 10:59:18 +0800 Subject: [PATCH 11/13] =?UTF-8?q?REPORT-60625=E3=80=90=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=B8=83=E5=B1=80-=E5=8E=9F=E5=B8=83=E5=B1=80=E6=8E=A8?= =?UTF-8?q?=E8=8D=904.1=E3=80=91=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8-?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80-=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E6=98=BE=E7=A4=BA=E7=BB=84=E4=BB=B6=E5=BA=93=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=97=B6=EF=BC=8C=E9=80=89=E4=B8=AD=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=8C=89delete=E9=94=AE=E5=88=A0=E9=99=A4?= =?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E5=8F=AF=E4=BB=A5delete=E5=88=A0=E9=99=A4=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/beans/actions/FormDeleteAction.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java index c2fec8f392..75a7442514 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java @@ -41,6 +41,14 @@ public class FormDeleteAction extends FormWidgetEditAction { return comp; } + @Override + public JComponent createToolBarComponentByName(String componentName) { + JComponent comp = super.createToolBarComponentByName(componentName); + // 除了 BACKSPACE 之外,DELETE 键也要能删除(直接在此处添加绑定,没有按钮提示) + comp.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); + return comp; + } + /** * 删除 * From 4bfaa7d2292c768079ea3b568d5b6ba3a9fb27c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 12 Oct 2021 14:05:01 +0800 Subject: [PATCH 12/13] REPORT-60392 --- .../src/main/java/com/fr/design/mainframe/FormDesigner.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 5d651aa021..3eb40b6a28 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1010,7 +1010,6 @@ public class FormDesigner extends TargetComponent implements TreeSelection } private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { - // 不存在center块, 说明是新建的模板(fanglei:大人,时代变了) XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); Dimension d = new Dimension(); d.width = ((WFitLayout) centerWidget).getContainerWidth(); From ced3811436596e0f566c77c1436f02d5e1d38754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 12 Oct 2021 16:22:52 +0800 Subject: [PATCH 13/13] =?UTF-8?q?REPORT-59545=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=BE=88=E5=A4=9A=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=E7=9A=84=E4=BA=A4=E4=BA=92=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/dialog/UIDialog.java | 6 +++++- .../src/main/java/com/fr/design/formula/FormulaPane.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java index dd3ddab3b9..c158123574 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDialog.java @@ -175,7 +175,11 @@ public abstract class UIDialog extends JDialog { try { checkValid(); } catch (Exception exp) { - FineJOptionPane.showMessageDialog(this, exp.getMessage()); + FineJOptionPane.showMessageDialog( + this, + exp.getMessage(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.WARNING_MESSAGE); return; } diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 608e8e684d..447421a415 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -655,7 +655,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { FormulaPane.this, formulaValidMessage + ".", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - JOptionPane.INFORMATION_MESSAGE); + JOptionPane.WARNING_MESSAGE); } };