Browse Source

Merge pull request #1037 in DESIGN/design from ~MAKSIM/design:feature/10.0 to feature/10.0

* commit '99f8e654c0319d3969d877f13d84c46894b7a3d9':
  REPORT-20323 sonar问题修复
  REPORT-20323 sonar问题修复
research/11.0
Maksim 5 years ago
parent
commit
a44b3e1352
  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. 4
      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();
}

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

@ -7,6 +7,7 @@ package com.fr.design.gui.imenu;
import com.fr.design.utils.ColorRoutines;
import com.fr.design.utils.ThemeUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.AbstractAction;
import javax.swing.ActionMap;
@ -579,7 +580,8 @@ public class UIBasicMenuItemUI extends MenuItemUI {
*/
private boolean isInternalFrameSystemMenu() {
String actionCommand = menuItem.getActionCommand();
return (actionCommand == "Close") || (actionCommand == "Minimize") || (actionCommand == "Restore") || (actionCommand == "Maximize");
return (StringUtils.equals(actionCommand,"Close") || StringUtils.equals(actionCommand,"Minimize")
|| StringUtils.equals(actionCommand,"Restore") || StringUtils.equals(actionCommand,"Maximize"));
}
//////////////////////////////////////////////////////////

Loading…
Cancel
Save