Browse Source

REPORT-20327 sonar问题修复

research/11.0
kerry 5 years ago
parent
commit
8b02cdcdb0
  1. 12
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 14
      designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java
  3. 3
      designer-realize/src/main/java/com/fr/poly/PolyUtils.java
  4. 1
      designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

12
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -398,8 +398,8 @@ public class MutilTempalteTabPane extends JComponent {
//画下面的那条线
if (templateStartX < maxWidth) {
GeneralPath generalPath = new GeneralPath(Path2D.WIND_EVEN_ODD, 2);
generalPath.moveTo((float) templateStartX, getHeight() - 1);
generalPath.lineTo((float) maxWidth, getHeight() - 1);
generalPath.moveTo((float) templateStartX, getHeight() - 1.0F);
generalPath.lineTo((float) maxWidth, getHeight() - 1.0F);
g2d.fill(generalPath);
//TODO hzzz delete
// g2d.setPaint(UIConstants.LINE_COLOR);
@ -409,7 +409,7 @@ public class MutilTempalteTabPane extends JComponent {
private void paintDefaultBackground(Graphics2D g2d) {
//画默认背景
g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, getHeight() - 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND, 1, getHeight() - 1.0F, UIConstants.TEMPLATE_TAB_PANE_BACKGROUND));
g2d.fillRect(0, 0, getWidth(), getHeight());
}
@ -535,7 +535,7 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {1, getHeight() + 1, getHeight() + 1, 1, 1};
RoundRectangle2D.Double rect1 = new RoundRectangle2D.Double(templateStartX, 1, this.getWidth(), this.getHeight(), 7, 7);
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, getHeight() - 1, UIConstants.SELECT_TAB));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SELECT_TAB, 1, getHeight() - 1.0F, UIConstants.SELECT_TAB));
//选了30度和60度的特殊角度的x,y作为经过的两个点的坐标
double specialLocation1 = 2.5;
double specialLocation2 = 4.330127;
@ -590,9 +590,9 @@ public class MutilTempalteTabPane extends JComponent {
double[] x = {templateStartX, templateStartX, templateStartX + realWidth, templateStartX + realWidth, templateStartX};
double[] y = {-1, getHeight() - 1, getHeight() - 1, -1, -1};
if (selfIndex == mouseOveredIndex) {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, getHeight() - 1, UIConstants.HOVER_BLUE));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.HOVER_BLUE, 1, getHeight() - 1.0F, UIConstants.HOVER_BLUE));
} else {
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1, UIConstants.SHADOW_GREY));
g2d.setPaint(new GradientPaint(1, 1, UIConstants.SHADOW_GREY, 1, getHeight() - 1.0F, UIConstants.SHADOW_GREY));
}

14
designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java

@ -141,8 +141,8 @@ public class UIFrameBorder extends AbstractBorder implements UIResource {
int spread1 = ThemeUtils.FRAME_SPREAD_DARK_DISABLED;
int spread2 = ThemeUtils.FRAME_SPREAD_LIGHT_DISABLED;
int y2 = y;
Color borderColor = null;
drawFirstCaption(g, borderColor, spread1, spread2, x, y2, w);
Color borderColor = isActive ? ThemeUtils.FRAME_BORDER_COLOR : ThemeUtils.FRAME_BORDER_DISABLED_COLOR;
drawFirstCaption(g, borderColor, x, y2, w);
Color c2 = ColorRoutines.darken(c, 4 * spread1);
drawSecondCaption(g, c2, c, spread2, x, y2, w);
c2 = ColorRoutines.darken(c, 6 * spread1);
@ -257,14 +257,8 @@ public class UIFrameBorder extends AbstractBorder implements UIResource {
g.drawLine(x + w - 4, y2, x + w - 4, y2);
}
private void drawFirstCaption(Graphics g, Color borderColor, int spread1, int spread2, int x, int y2, int w) {
if (isActive) {
borderColor = ThemeUtils.FRAME_BORDER_COLOR;
spread1 = ThemeUtils.FRAME_SPREAD_DARK;
spread2 = ThemeUtils.FRAME_SPREAD_LIGHT;
} else {
borderColor = ThemeUtils.FRAME_BORDER_DISABLED_COLOR;
}
private void drawFirstCaption(Graphics g, Color borderColor, int x, int y2, int w) {
// always paint the semi-transparent parts
// 1
// blend

3
designer-realize/src/main/java/com/fr/poly/PolyUtils.java

@ -32,6 +32,9 @@ public class PolyUtils {
}
public static BlockCreator createCreator(TemplateBlock block) {
if (block == null) {
return null;
}
Class cls = block.getClass();
Class clazz = blockMapCls.get(cls);
if (clazz == null) {

1
designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java

@ -127,6 +127,7 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader {
}
@SuppressWarnings("squid:S244")
private void loadAll(InputStream stream, int w, int h,
boolean preserveRatio, boolean smooth) {
ImageLoadListener listener = new PrismLoadListener();

Loading…
Cancel
Save