From 8b02cdcdb09f7a53cff52acf663c8eb208004881 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 20 Sep 2019 09:50:09 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-20327=20sonar=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/MutilTempalteTabPane.java | 12 ++++++------ .../com/fr/design/gui/borders/UIFrameBorder.java | 16 +++++----------- .../src/main/java/com/fr/poly/PolyUtils.java | 9 ++++++--- .../java/com/fr/start/fx/PrismImageLoader2.java | 1 + 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index b06f99050..5a722239c 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/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)); } diff --git a/designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java b/designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java index d4ff794e8..8e6bc4781 100644 --- a/designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java +++ b/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 @@ -580,4 +574,4 @@ public class UIFrameBorder extends AbstractBorder implements UIResource { } } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/poly/PolyUtils.java b/designer-realize/src/main/java/com/fr/poly/PolyUtils.java index e297a69ad..3f1f270fd 100644 --- a/designer-realize/src/main/java/com/fr/poly/PolyUtils.java +++ b/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) { @@ -55,7 +58,7 @@ public class PolyUtils { TemplateBlock block = new PolyChartBlock(cc); return createCreator(block); } - + private static TemplateBlock blockGenerate(Class clazz) { TemplateBlock block = null; try { @@ -85,7 +88,7 @@ public class PolyUtils { public static int converty2Designer(PolyDesigner designer, int y) { return y += designer.getVerticalValue(); } - + /** * 获取所处(x,y)位置的聚合块,如果没有,就返回null * @param designer @@ -110,4 +113,4 @@ public class PolyUtils { } return null; } -} \ No newline at end of file +} diff --git a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java b/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java index e262e917e..89509b994 100644 --- a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java +++ b/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(); From 42316dcc409b31e8596b82aa97d7f9bcb2069b66 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 20 Sep 2019 11:07:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=A4=9A=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 33153b79e..ee1b1976c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -189,7 +189,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { value = value > SHOWVALMAX ? SHOWVALMAX : value; value = value < SHOWVALMIN ? SHOWVALMIN : value; JForm jf = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - jf.setResolution((int) value); jf.getFormDesign().setResolution((int) value); jf.getFormDesign().getArea().resolution = (int) value; reCalculateRoot(value, true); From 6bd4ee87aeb1e3dbecd49c02566119db05f48486 Mon Sep 17 00:00:00 2001 From: vito Date: Fri, 20 Sep 2019 11:51:12 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-19945=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/common/SplashCommon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/common/SplashCommon.java b/designer-realize/src/main/java/com/fr/start/common/SplashCommon.java index 916f4dfee..47597c45d 100644 --- a/designer-realize/src/main/java/com/fr/start/common/SplashCommon.java +++ b/designer-realize/src/main/java/com/fr/start/common/SplashCommon.java @@ -42,7 +42,7 @@ public class SplashCommon implements SplashStrategy { @Override public void updateModuleLog(final String text) { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { if (splashWindow != null) {