From d2f600dabd2bb1fedac40551be0918c350ca51fc Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:36:12 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/ipasswordfield/UIPassWordField.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 0aad7ee918..2d2f1864da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -1,11 +1,12 @@ package com.fr.design.gui.ipasswordfield; +import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.design.constants.UIConstants; -import javax.swing.*; +import javax.swing.JPasswordField; import javax.swing.text.Document; -import java.awt.*; +import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -21,26 +22,31 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } @@ -69,4 +75,4 @@ public class UIPassWordField extends JPasswordField { super.paintBorder(g); } } -} \ No newline at end of file +} From b0fe3f124300f345323d2332a484c8a8073422ea Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:49:07 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ipasswordfield/UIPassWordField.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 2d2f1864da..ba05141c94 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,35 +22,31 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } private void addRollOverListener() { + InputEventBaseOnOS.addBasicEditInputMap(this); this.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { From a069f6ca9b0543ac647fbaccfcec9da88f58a18e Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 13:52:55 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/itextfield/UITextField.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 98823bee9b..3f8b189081 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -251,4 +251,4 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs this.isBorderPainted = isBorderPainted; } -} \ No newline at end of file +} From 8f360741e38ca85f29b7181b9e50d162b30c08bc Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 14:05:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/itextfield/UITextField.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 3f8b189081..fd77b6f4dc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -9,11 +9,20 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.Constants; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JTextField; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; -import java.awt.*; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Insets; +import java.awt.LayoutManager; +import java.awt.RenderingHints; + /** * @author Jerry @@ -33,36 +42,31 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } protected void initListener() { + InputEventBaseOnOS.addBasicEditInputMap(this); if (shouldResponseChangeListener()) { getDocument().addDocumentListener(new DocumentListener() { @Override From eef74f18a39c2b927fdd27c9c554b9e962682565 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 15:12:13 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/ipasswordfield/UIPassWordField.java | 6 +++++- .../main/java/com/fr/design/gui/itextfield/UITextField.java | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index ba05141c94..2d2f1864da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,31 +22,35 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } private void addRollOverListener() { - InputEventBaseOnOS.addBasicEditInputMap(this); this.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index fd77b6f4dc..09db8974e5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -42,31 +42,35 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(int columns) { super(columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text, int columns) { super(text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(String text) { super(text); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); + InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); } protected void initListener() { - InputEventBaseOnOS.addBasicEditInputMap(this); if (shouldResponseChangeListener()) { getDocument().addDocumentListener(new DocumentListener() { @Override From a965e07ff90e52597b37d4b605a84de1ed084ae3 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 29 Jul 2020 17:46:59 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=E5=B0=86MacOS=E7=B3=BB=E7=BB=9F=E4=B8=8B?= =?UTF-8?q?=E7=9A=84=E7=B2=98=E8=B4=B4=E9=94=AE=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?UIPasswordField=E7=9A=84InputMap=E4=B8=AD=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E5=85=B6=E6=94=AF=E6=8C=81command+v=E4=B8=BA=E7=B2=98=E8=B4=B4?= =?UTF-8?q?=E9=94=AE=202.=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=8C=85=203.?= =?UTF-8?q?=E5=B0=86=E6=9E=84=E9=80=A0=E6=96=B9=E6=B3=95=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E5=85=AC=E7=94=A8=E6=93=8D=E4=BD=9C=E6=8A=BD=E5=8F=96=E5=87=BA?= =?UTF-8?q?=E6=9D=A5=E6=94=BE=E5=9C=A8init()=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/ipasswordfield/UIPassWordField.java | 19 +++++++++++-------- .../fr/design/gui/itextfield/UITextField.java | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java index 2d2f1864da..5e595643c0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ipasswordfield/UIPassWordField.java @@ -22,30 +22,33 @@ public class UIPassWordField extends JPasswordField { public UIPassWordField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - addRollOverListener(); + init(); } public UIPassWordField(Document doc, String txt, int columns) { super(doc, txt, columns); + init(); + } + + /** + * 每个构造方法里都需要做的一些操作 + */ + public void init() { InputEventBaseOnOS.addBasicEditInputMap(this); addRollOverListener(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java index 09db8974e5..10edf9fe00 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UITextField.java @@ -42,30 +42,33 @@ public class UITextField extends JTextField implements UIObserver, GlobalNameObs public UITextField() { super(); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(int columns) { super(columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(String text, int columns) { super(text, columns); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(String text) { super(text); - InputEventBaseOnOS.addBasicEditInputMap(this); - initListener(); + init(); } public UITextField(Document doc, String text, int columns) { super(doc, text, columns); + init(); + } + + /** + * 每个构造方法里都需要做的一些操作 + */ + public void init() { InputEventBaseOnOS.addBasicEditInputMap(this); initListener(); }