Browse Source

sonar修复

research/11.0
alex.sung 5 years ago
parent
commit
f6e3985d92
  1. 6
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIBasicButtonUI.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  3. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButton.java
  4. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UISliderButtonUI.java

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

@ -321,9 +321,9 @@ public class UIBasicButtonUI extends MetalButtonUI {
//harry: 画带有高光的按钮。 //harry: 画带有高光的按钮。
private void drawHighLightButton(Graphics2D g2, Color color1, Color color2, int w, int h) { private void drawHighLightButton(Graphics2D g2, Color color1, Color color2, int w, int h) {
GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1, color2); GradientPaint buttonPaint = new GradientPaint(0, 0, color1, 0, h - 1f, color2);
GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.2f)); GradientPaint buttonHighLightPaint = new GradientPaint(0, 0, new Color(1.0f, 1.0f, 1.0f, 0.6f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.2f));
GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2, new Color(1.0f, 1.0f, 1.0f, 0.4f)); GradientPaint buttonHighLightLinePaint = new GradientPaint(1, 1, new Color(1.0f, 1.0f, 1.0f, 0.8f), 0, h / 2f, new Color(1.0f, 1.0f, 1.0f, 0.4f));
g2.setPaint(buttonPaint); g2.setPaint(buttonPaint);
g2.fillRoundRect(0, 0, w - 1, h - 1, 3, 3); g2.fillRoundRect(0, 0, w - 1, h - 1, 3, 3);
g2.setPaint(buttonHighLightLinePaint);//按钮内侧高光线(内发光,0%阻塞) g2.setPaint(buttonHighLightLinePaint);//按钮内侧高光线(内发光,0%阻塞)

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

@ -251,7 +251,7 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
protected void paintOtherBorder(Graphics g) { protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke); g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor); g2d.setColor(borderColor);
g2d.draw(shape); g2d.draw(shape);
} }

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

@ -232,7 +232,7 @@ public class UISliderButton extends JButton implements UIObserver {
protected void paintOtherBorder(Graphics g) { protected void paintOtherBorder(Graphics g) {
Graphics2D g2d = (Graphics2D) g; Graphics2D g2d = (Graphics2D) g;
g2d.setStroke(borderStroke); g2d.setStroke(borderStroke);
Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1, getHeight() - 1, UIConstants.ARC, UIConstants.ARC); Shape shape = new RoundRectangle2D.Float(0.5f, 0.5f, getWidth() - 1f, getHeight() - 1f, UIConstants.ARC, UIConstants.ARC);
g2d.setColor(borderColor); g2d.setColor(borderColor);
g2d.draw(shape); g2d.draw(shape);
} }

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

@ -176,7 +176,7 @@ public class UISliderButtonUI extends BasicButtonUI {
private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) { private void fillNormal(Graphics2D g2d, int x, int y, int width, int height, boolean isRound, int rectDirection, boolean isAuthorityEdited, boolean isPressedPainted) {
GradientPaint gp; GradientPaint gp;
if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) { if (DesignerMode.isAuthorityEditing() && isAuthorityEdited) {
gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1, UIConstants.AUTHORITY_DARK_BLUE); gp = new GradientPaint(1, 1, UIConstants.AUTHORITY_BLUE, 1, height - 1f, UIConstants.AUTHORITY_DARK_BLUE);
} else if (isPressedPainted) { } else if (isPressedPainted) {
gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB); gp = new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, height - 1, UIConstants.SELECT_TAB);
}else{ }else{

Loading…
Cancel
Save