Browse Source

无jira任务,sonar问题修复

persist/11.0
lucian 5 years ago
parent
commit
511cc0abf9
  1. 2
      designer-base/src/main/java/com/fr/design/gui/frpane/UITabbedPaneUI.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/SpecialUIButton.java
  3. 1
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  4. 8
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButton.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIHeadGroup.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIPasswordField.java
  7. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIPreviewButton.java
  8. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabButton.java
  9. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java
  10. 18
      designer-base/src/main/java/com/fr/design/gui/icombobox/ComboCheckBox.java
  11. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java

2
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 g.drawLine(x + 1, y + h - 2, x + w - 3, y + h - 2); // bottom
} }
@Override
protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) { protected void paintContentBorder(Graphics g, int tabPlacement, int selectedIndex) {
// do nothing
} }
/** /**

2
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) * @see javax.swing.AbstractButton#setUI(ButtonUI)
*/ */
@Override
public void setUI(ButtonUI ui) { public void setUI(ButtonUI ui) {
// do nothing
} }
} }

1
designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java

@ -43,6 +43,7 @@ public class UIBasicButtonUI extends MetalButtonUI {
private boolean isDefault; private boolean isDefault;
public UIBasicButtonUI() { public UIBasicButtonUI() {
// do nothing
} }
/** /**

8
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 EventListenerList colorChangeListenerList = new EventListenerList();
private boolean isEventBanned = false; private boolean isEventBanned = false;
private String colorButtonName = ""; private String colorButtonName = "";
private UIObserverListener uiObserverListener; private UIObserverListener uiColorObserverListener;
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
public UIColorButton() { public UIColorButton() {
@ -60,13 +60,13 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
this.addColorChangeListener(new ChangeListener() { this.addColorChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (uiObserverListener == null) { if (uiColorObserverListener == null) {
return; return;
} }
if (globalNameListener != null && shouldResponseNameListener()) { if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(colorButtonName); globalNameListener.setGlobalName(colorButtonName);
} }
uiObserverListener.doChange(); uiColorObserverListener.doChange();
} }
}); });
} }
@ -199,7 +199,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G
* @param listener 观察者监听事件 * @param listener 观察者监听事件
*/ */
public void registerChangeListener(UIObserverListener listener) { public void registerChangeListener(UIObserverListener listener) {
uiObserverListener = listener; uiColorObserverListener = listener;
} }
/** /**

2
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 int selectedIndex = -1;
protected void tabChanged(int newSelectedIndex) { protected void tabChanged(int newSelectedIndex) {
// do nothing
} }
public UIHeadGroup(String[] textArray) { public UIHeadGroup(String[] textArray) {

2
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; } } 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; } }

2
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); } } 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); } }

2
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) { protected void paintOther(Graphics2D g2d, int w, int h) {
// do nothing
} }
} }

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIToggleButton.java

@ -187,7 +187,7 @@ public class UIToggleButton extends UIButton implements GlobalNameObserver{
@Override @Override
protected void fireStateChanged() { protected void fireStateChanged() {
// do nothing
} }

18
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 ComboCheckBox comboBox;
protected JScrollPane scrollPane; protected JScrollPane scrollPane;
protected MouseListener mouseListener; protected MouseListener checkListMouseListener;
protected MouseMotionListener mouseMotionListener; protected MouseMotionListener checkListMouseMotionListener;
public CheckListPopup(JComboBox comboBox) { public CheckListPopup(JComboBox comboBox) {
this.comboBox = (ComboCheckBox) comboBox; this.comboBox = (ComboCheckBox) comboBox;
@ -157,22 +157,22 @@ public class ComboCheckBox extends UIComboBox {
@Override @Override
public MouseListener getMouseListener() { public MouseListener getMouseListener() {
if (mouseListener == null) { if (checkListMouseListener == null) {
mouseListener = new InvocationMouseHandler(); checkListMouseListener = new InvocationMouseHandler();
} }
return mouseListener; return checkListMouseListener;
} }
public MouseMotionListener getMouseMotionListener() { public MouseMotionListener getMouseMotionListener() {
if (mouseMotionListener == null) { if (checkListMouseMotionListener == null) {
mouseMotionListener = new MouseMotionAdapter() { checkListMouseMotionListener = new MouseMotionAdapter() {
}; };
} }
return mouseMotionListener; return checkListMouseMotionListener;
} }
public void uninstallingUI() { public void uninstallingUI() {
// do nothing
} }
protected class InvocationMouseHandler extends MouseAdapter { protected class InvocationMouseHandler extends MouseAdapter {

1
designer-base/src/main/java/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -318,6 +318,7 @@ public class FRTreeComboBox extends UIComboBox {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
// do nothing
} }
@Override @Override

Loading…
Cancel
Save