Browse Source

REPORT-20323 sonar问题修复

research/11.0
Maksim 5 years ago
parent
commit
c5e72eceb2
  1. 12
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java
  2. 5
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  3. 6
      designer-base/src/main/java/com/fr/design/gui/ilable/MultilineLabel.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java

12
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxButton.java

@ -127,10 +127,6 @@ public class UIComboBoxButton extends JButton {
boolean savedOpaque = false;
paintRender(g, c, mustResetOpaque, savedOpaque, leftToRight, width, insets, iconWidth, left, top, height);
if (mustResetOpaque) {
JComponent jc = (JComponent) c;
jc.setOpaque(savedOpaque);
}
}
private void paintRender(Graphics g, Component c, boolean mustResetOpaque, boolean savedOpaque, boolean leftToRight,
@ -152,14 +148,6 @@ public class UIComboBoxButton extends JButton {
} else {
rendererPane.paintComponent(g, c, this, left + iconWidth, top, cWidth, height, shouldValidate);
}
if (paintFocus && ThemeUtils.COMBO_FOCUS) {
g.setColor(Color.black);
Graphics2D g2d = (Graphics2D) g;
Rectangle r = new Rectangle(left, top, 2, 2);
TexturePaint tp = new TexturePaint(focusImg, r);
g2d.setPaint(tp);
g2d.draw(new Rectangle(left, top, cWidth, height));
}
}
}

5
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -438,11 +438,6 @@ public class UIResizableContainer extends JPanel {
containerWidth = containerWidth > MAX_WIDTH ? MAX_WIDTH : containerWidth;
containerWidth = containerWidth < MIN_WIDTH ? MIN_WIDTH : containerWidth;
if (containerWidth < MIN_WIDTH) {
upPane.setVisible(false);
downPane.setVisible(false);
containerWidth = toolPaneHeight;
}
refreshContainer();
if (DesignerMode.isAuthorityEditing()) {
DesignerContext.getDesignerFrame().doResize();

6
designer-base/src/main/java/com/fr/design/gui/ilable/MultilineLabel.java

@ -19,15 +19,15 @@ import com.fr.design.gui.itextarea.UITextArea;
*/
public class MultilineLabel extends UITextArea {
public MultilineLabel() {
initComponents();
initCurrentComponents();
}
public MultilineLabel(String s) {
super(s);
initComponents();
initCurrentComponents();
}
private void initComponents() {
private void initCurrentComponents() {
adjustUI();
}

2
designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java

@ -579,7 +579,7 @@ public class UIBasicMenuItemUI extends MenuItemUI {
*/
private boolean isInternalFrameSystemMenu() {
String actionCommand = menuItem.getActionCommand();
return (actionCommand == "Close") || (actionCommand == "Minimize") || (actionCommand == "Restore") || (actionCommand == "Maximize");
return (actionCommand.equals("Close")) || (actionCommand.equals("Minimize")) || (actionCommand.equals("Restore")) || (actionCommand.equals("Maximize"));
}
//////////////////////////////////////////////////////////

Loading…
Cancel
Save