From 176e3b638725fae2fc7bd49bc34bfad13ed1bceb Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 8 Jan 2021 16:55:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-44803=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=8F=B3=E4=BE=A7=E4=B8=8D=E8=83=BD=E8=B7=9F=E9=9A=8F=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=A4=A7=E5=B0=8F--=E6=9D=A5=E6=BA=90=E3=80=90?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=9C=80=E6=B1=82=20508884=E3=80=91=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91release?= =?UTF-8?q?=E5=B7=B2=E9=AA=8C=E6=94=B6=EF=BC=8C=E4=BC=A0=E4=B8=80=E4=BB=BD?= =?UTF-8?q?=E5=88=B0final=EF=BC=8C10.0.12.1=E4=B8=AD=E9=97=B4=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=91=E5=B8=83=20=E3=80=90=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E6=80=9D=E8=B7=AF=E3=80=91release=E5=B7=B2=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=EF=BC=8C=E4=BC=A0=E4=B8=80=E4=BB=BD=E5=88=B0final=EF=BC=8C10.0?= =?UTF-8?q?.12.1=E4=B8=AD=E9=97=B4=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormDesignerUI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java index a21a2efad..8f731d811 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesignerUI.java @@ -183,12 +183,12 @@ public class FormDesignerUI extends ComponentUI { x1 = 0; x2 = 6; y2 = y1 = bounds.y - designer.getVerticalScaleValue() + (k == 1 ? 0 : bounds.height); - text = Utils.objectToString(bounds.y); + text = Utils.objectToString(y1 + designer.getVerticalScaleValue()); } else { y1 = 0; y2 = 6; x1 = x2 = bounds.x - designer.getHorizontalScaleValue()+ (k == 3 ? 0 : bounds.width); - text = Utils.objectToString(bounds.x); + text = Utils.objectToString(x1 + designer.getHorizontalScaleValue()); } text += com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel"); g2d.setColor(XCreatorConstants.RESIZE_BOX_BORDER_COLOR); From cd5764193458b4fcef3766ad773a6428260c8377 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 8 Jan 2021 17:01:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-46585=20=E5=9C=A8=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=BC=96=E8=BE=91=E7=9A=84=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=A8=A1=E6=9D=BF=E5=88=87=E6=8D=A2=E5=9B=9E=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E4=B8=8D=E8=83=BD=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 2 +- .../fr/design/mainframe/JTemplateFactory.java | 30 ++++++++++++------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index f540cdbc6..4007be8a3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -341,7 +341,7 @@ public abstract class JTemplate> public void refreshResource(FILE file) { try { - this.template = JTemplateFactory.asIOFile(file); + this.template = JTemplateFactory.asIOFile(file, this.suffix()); setTarget(this.template); // 先移除旧的。 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java index 678b9bf84..5e75cc64b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java @@ -3,11 +3,12 @@ package com.fr.design.mainframe; import com.fr.base.io.BaseBook; import com.fr.file.FILE; import com.fr.stable.CoreConstants; -import com.fr.third.javax.annotation.Nonnull; -import com.fr.third.javax.annotation.Nullable; +import com.fr.stable.StringUtils; import java.util.ArrayList; import java.util.List; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public final class JTemplateFactory { private static final List> ALL_APP = new ArrayList>(); @@ -21,8 +22,7 @@ public final class JTemplateFactory { * @param file 包含了模板名称,类型以及内容的文件 * @return 设计器编辑的模板对象 */ - @Nullable - public static JTemplate createJTemplate(@Nonnull FILE file) { + public static JTemplate createJTemplate(@NotNull FILE file) { String fileName = file.getName(); int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); @@ -43,15 +43,19 @@ public final class JTemplateFactory { } return null; } - - public static T asIOFile(@Nonnull FILE file) { - - String fileName = file.getName(); - int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT); + + @Nullable + public static T asIOFile(@NotNull FILE file, String fileNameOrSuffix) { + + if (StringUtils.isEmpty(fileNameOrSuffix)) { + return null; + } + + int indexOfLastDot = fileNameOrSuffix.lastIndexOf(CoreConstants.DOT); if (indexOfLastDot < 0) { return null; } - String fileExtension = fileName.substring(indexOfLastDot + 1); + String fileExtension = fileNameOrSuffix.substring(indexOfLastDot + 1); for (App app : ALL_APP) { String[] defaultAppExtensions = app.defaultExtensions(); for (String defaultAppExtension : defaultAppExtensions) { @@ -66,6 +70,12 @@ public final class JTemplateFactory { return null; } + @Nullable + public static T asIOFile(@NotNull FILE file) { + return asIOFile(file, file.getName()); + } + + /** * 注册app.