Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/feature/10.0)

* commit 'e499e9b46c6c79bf39f2939a40e85d84fd2288b3':
  REPORT-19945 设计器启动优化
  无jira任务 提交多了
  REPORT-20327 sonar问题修复
research/11.0
Bryant 5 years ago
parent
commit
9fc99a7a62
  1. 12
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 16
      designer-base/src/main/java/com/fr/design/gui/borders/UIFrameBorder.java
  3. 1
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  4. 9
      designer-realize/src/main/java/com/fr/poly/PolyUtils.java
  5. 2
      designer-realize/src/main/java/com/fr/start/common/SplashCommon.java
  6. 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));
}

16
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 {
}
}
}
}

1
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);

9
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;
}
}
}

2
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) {

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