From 511cc0abf9d4b8b593a70393896db004db0a2004 Mon Sep 17 00:00:00 2001 From: lucian Date: Mon, 2 Dec 2019 09:49:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8Csonar?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/frpane/UITabbedPaneUI.java | 2 ++ .../fr/design/gui/ibutton/SpecialUIButton.java | 2 ++ .../fr/design/gui/ibutton/UIBasicButtonUI.java | 1 + .../fr/design/gui/ibutton/UIColorButton.java | 8 ++++---- .../com/fr/design/gui/ibutton/UIHeadGroup.java | 2 +- .../fr/design/gui/ibutton/UIPasswordField.java | 2 +- .../fr/design/gui/ibutton/UIPreviewButton.java | 2 +- .../com/fr/design/gui/ibutton/UITabButton.java | 2 +- .../fr/design/gui/ibutton/UIToggleButton.java | 2 +- .../fr/design/gui/icombobox/ComboCheckBox.java | 18 +++++++++--------- .../design/gui/icombobox/FRTreeComboBox.java | 1 + 11 files changed, 24 insertions(+), 18 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java index d95740798b..5798a864b0 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java @@ -330,7 +330,9 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { g.drawLine(x + 1, y + h - 2, x + w - 3, y + h - 2); // bottom } + @Override protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { + // do nothing } /** diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java index 338cbac7ef..c423ac582b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java @@ -25,6 +25,8 @@ public class SpecialUIButton extends JButton { * * @see javax.swing.AbstractButton#setUI(ButtonUI) */ + @Override public void setUI(ButtonUI ui) { + // do nothing } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java index 64db1e91da..87aae662bd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java @@ -43,6 +43,7 @@ public class UIBasicButtonUI extends MetalButtonUI { private boolean isDefault; public UIBasicButtonUI() { + // do nothing } /** diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java index c1dc9b0581..6d893d24f8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java @@ -36,7 +36,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G private EventListenerList colorChangeListenerList = new EventListenerList(); private boolean isEventBanned = false; private String colorButtonName = ""; - private UIObserverListener uiObserverListener; + private UIObserverListener uiColorObserverListener; private GlobalNameListener globalNameListener = null; public UIColorButton() { @@ -60,13 +60,13 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G this.addColorChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if (uiObserverListener == null) { + if (uiColorObserverListener == null) { return; } if (globalNameListener != null && shouldResponseNameListener()) { globalNameListener.setGlobalName(colorButtonName); } - uiObserverListener.doChange(); + uiColorObserverListener.doChange(); } }); } @@ -199,7 +199,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G * @param listener 观察者监听事件 */ public void registerChangeListener(UIObserverListener listener) { - uiObserverListener = listener; + uiColorObserverListener = listener; } /** diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java index edbc013405..e21f4c2170 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java @@ -25,7 +25,7 @@ public class UIHeadGroup extends JPanel { protected int selectedIndex = -1; protected void tabChanged(int newSelectedIndex) { - + // do nothing } public UIHeadGroup(String[] textArray) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java index 8d26b5e875..8963119a04 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java @@ -1 +1 @@ -package com.fr.design.gui.ibutton; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import javax.swing.*; /** * Author : Shockway * Date: 13-10-21 * Time: 下午3:23 */ public class UIPasswordField extends JPasswordField implements UIObserver { public void registerChangeListener(UIObserverListener listener) { } public boolean shouldResponseChangeListener() { return false; } } \ No newline at end of file +package com.fr.design.gui.ibutton; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import javax.swing.*; /** * Author : Shockway * Date: 13-10-21 * Time: 下午3:23 */ public class UIPasswordField extends JPasswordField implements UIObserver { public void registerChangeListener(UIObserverListener listener) { // do nothing } public boolean shouldResponseChangeListener() { return false; } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java index a5f9de9b70..50bbc1440d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java @@ -1 +1 @@ -package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { } protected void downButtonClickEvent() { } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } public static void main(String... args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel content = (JPanel) jf.getContentPane(); content.setLayout(null); UIPreviewButton bb = new UIPreviewButton(UIConstants.PAGE_BIG_ICON, UIConstants.PREVIEW_DOWN); bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); content.add(bb); GUICoreUtils.centerWindow(jf); jf.setSize(100, 100); jf.setVisible(true); } } \ No newline at end of file +package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.stable.Constants; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * Author : daisy * Date: 13-8-1 * Time: 下午3:41 */ public class UIPreviewButton extends JPanel { private static final int START_X = -7; protected UIButton upButton; protected UIButton downButton; protected void upButtonClickEvent() { // do nothing } protected void downButtonClickEvent() { // do nothing } public UIPreviewButton() { this(new UIButton(), new UIButton()); } public UIPreviewButton(UIButton up, UIButton down) { upButton = up; downButton = down; upButton.setRoundBorder(true, Constants.CENTER); downButton.setRoundBorder(true, Constants.CENTER); upButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { downButton.getModel().setPressed(true); downButton.getModel().setSelected(true); downButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { downButton.getModel().setPressed(false); downButton.getModel().setSelected(false); downButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { upButtonClickEvent(); } }); downButton.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { upButton.getModel().setPressed(true); upButton.getModel().setSelected(true); upButton.repaint(); } @Override public void mouseReleased(MouseEvent e) { upButton.getModel().setPressed(false); upButton.getModel().setSelected(false); upButton.repaint(); } @Override public void mouseClicked(MouseEvent e) { downButtonClickEvent(); } }); this.setLayout(new FlowLayout(FlowLayout.CENTER,5,0)); this.add(upButton); this.add(downButton); } public UIPreviewButton(Icon left, Icon right) { this(); upButton.setIcon(left); downButton.setIcon(right); } public UIButton getUpButton() { return upButton; } public void setExtraPainted(boolean isExtraPainted) { if (!isExtraPainted) { upButton.setBackground(null); downButton.setBackground(null); upButton.setOpaque(false); downButton.setOpaque(false); } } public UIButton getDownButton() { return downButton; } public void set4Toolbar() { upButton.setNormalPainted(false); downButton.setNormalPainted(false); upButton.setBorderPaintedOnlyWhenPressed(true); downButton.setBorderPaintedOnlyWhenPressed(true); } protected void showPopWindow(JPopupMenu menu) { GUICoreUtils.showPopupMenu(menu, this, START_X, getY() + getHeight() - 3); } public static void main(String... args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel content = (JPanel) jf.getContentPane(); content.setLayout(null); UIPreviewButton bb = new UIPreviewButton(UIConstants.PAGE_BIG_ICON, UIConstants.PREVIEW_DOWN); bb.setBounds(20, 20, bb.getPreferredSize().width, bb.getPreferredSize().height); content.add(bb); GUICoreUtils.centerWindow(jf); jf.setSize(100, 100); jf.setVisible(true); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java index ce609cde88..aa5c34f60b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java @@ -175,7 +175,7 @@ public class UITabButton extends UILabel implements UISelectedComponent { } protected void paintOther(Graphics2D g2d, int w, int h) { - + // do nothing } } diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java index 2ba4f02439..dc380c0c94 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java @@ -187,7 +187,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{ @Override protected void fireStateChanged() { - + // do nothing } diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java index 31290d6b05..3a0be4a8ff 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java @@ -77,8 +77,8 @@ public class ComboCheckBox extends UIComboBox { protected ComboCheckBox comboBox; protected JScrollPane scrollPane; - protected MouseListener mouseListener; - protected MouseMotionListener mouseMotionListener; + protected MouseListener checkListMouseListener; + protected MouseMotionListener checkListMouseMotionListener; public CheckListPopup(JComboBox comboBox) { this.comboBox = (ComboCheckBox) comboBox; @@ -157,22 +157,22 @@ public class ComboCheckBox extends UIComboBox { @Override public MouseListener getMouseListener() { - if (mouseListener == null) { - mouseListener = new InvocationMouseHandler(); + if (checkListMouseListener == null) { + checkListMouseListener = new InvocationMouseHandler(); } - return mouseListener; + return checkListMouseListener; } public MouseMotionListener getMouseMotionListener() { - if (mouseMotionListener == null) { - mouseMotionListener = new MouseMotionAdapter() { + if (checkListMouseMotionListener == null) { + checkListMouseMotionListener = new MouseMotionAdapter() { }; } - return mouseMotionListener; + return checkListMouseMotionListener; } public void uninstallingUI() { - + // do nothing } protected class InvocationMouseHandler extends MouseAdapter { diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java index ae2e6b52d8..c3dd64c9d4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java @@ -318,6 +318,7 @@ public class FRTreeComboBox extends UIComboBox { @Override public void mouseClicked(MouseEvent e) { + // do nothing } @Override