Browse Source

Merge pull request #12365 in DESIGN/design from bugfix/11.0 to feature/x

* commit '27cd0f3a5dac67d40cf0ce5c4d819c42d139091f':
  REPORT-94637 单元测试修复 com.fr.form全修复
  REPORT-94637 单元测试修复@obo-com.fr.nx
  REPORT-89867 插件管理整体优化 fix:兼容问题
  REPORT-98932 设计器拖动至屏幕外时触发弹出框后无法进行操作
  REPORT-98932 设计器拖动至屏幕外时触发弹出框后无法进行操作
  REPORT-98903 fix: jxbrowser v7自动启动V6
  无jira任务 代码工程适配apple silicon架构
feature/x
superman 1 year ago
parent
commit
050fb4b8d5
  1. 7
      build.gradle
  2. 2
      designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java
  4. 2
      designer-base/src/main/java/com/fr/design/upm/UpmUtils.java
  5. 29
      designer-base/src/test/java/com/fr/base/ClassHelperTest.java
  6. 6
      designer-realize/src/test/java/com/fr/nx/app/designer/CptxAppTest.java

7
build.gradle

@ -93,12 +93,17 @@ allprojects {
testImplementation 'org.powermock:powermock-api-mockito2:1.7.4' testImplementation 'org.powermock:powermock-api-mockito2:1.7.4'
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
} }
// mac_x64, mac_aarch64, windows_x64
if (OperatingSystem.current().isMacOsX()) { if (OperatingSystem.current().isMacOsX()) {
dependencies { dependencies {
implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23'
implementation "com.fr.third:jxbrowser-mac-v7:${jxBrowserVersion}" implementation "com.fr.third:jxbrowser-mac-v7:${jxBrowserVersion}"
} }
} else if (OperatingSystem.current().isMacOsX() && "aarch64".equals(System.getProperty("os.arch"))) {
dependencies {
implementation 'com.fr.third:jxbrowser-mac:6.23'
implementation "com.fr.third:jxbrowser-mac-arm-v7:${jxBrowserVersion}"
}
} else if (OperatingSystem.current().isWindows()) { } else if (OperatingSystem.current().isWindows()) {
dependencies { dependencies {
implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23'

2
designer-base/src/main/java/com/fr/design/jxbrowser/JxUIPane.java

@ -262,6 +262,8 @@ public class JxUIPane<T> extends ModernUIPane<T> {
private String html; private String html;
public Builder() { public Builder() {
// 为了兼容继承关系,但又不允许创建,用这个方式先处理一下
super((ModernUIPane<T>) null);
this.namespace = DEFAULT_NAMESPACE; this.namespace = DEFAULT_NAMESPACE;
this.variable = DEFAULT_VARIABLE; this.variable = DEFAULT_VARIABLE;
this.expression = DEFAULT_EXPRESSION; this.expression = DEFAULT_EXPRESSION;

4
designer-base/src/main/java/com/fr/design/style/color/ColorSelectDialog.java

@ -79,6 +79,7 @@ public class ColorSelectDialog extends MiddleChartDialog{
this.seletePane = seletePane; this.seletePane = seletePane;
initComponent(); initComponent();
this.pane.populate(initialColor); this.pane.populate(initialColor);
this.setLocationRelativeTo(null);
} }
private void initComponent() { private void initComponent() {
@ -87,7 +88,8 @@ public class ColorSelectDialog extends MiddleChartDialog{
this.setBasicDialogSize(545,500); this.setBasicDialogSize(545,500);
this.setResizable(false); this.setResizable(false);
this.applyClosingAction();
this.applyEscapeAction();
JPanel buttonPane = new JPanel(); JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT)); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));

2
designer-base/src/main/java/com/fr/design/upm/UpmUtils.java

@ -4,6 +4,7 @@ import com.fr.common.annotations.Negative;
import com.fr.config.ServerPreferenceConfig; import com.fr.config.ServerPreferenceConfig;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
@ -32,6 +33,7 @@ public class UpmUtils {
Map<String, String> map4Tpl = new HashMap<>(); Map<String, String> map4Tpl = new HashMap<>();
map4Tpl.put("version", ServerPreferenceConfig.getInstance().getOptimizedUPMVersion()); map4Tpl.put("version", ServerPreferenceConfig.getInstance().getOptimizedUPMVersion());
map4Tpl.put("new_version", fetchLatestVersion()); map4Tpl.put("new_version", fetchLatestVersion());
map4Tpl.put("designer_version", GeneralUtils.getVersion());
map4Tpl.put("language", GeneralContext.getLocale().toString()); map4Tpl.put("language", GeneralContext.getLocale().toString());
return map4Tpl; return map4Tpl;
} }

29
designer-base/src/test/java/com/fr/base/ClassHelperTest.java

@ -1,29 +0,0 @@
package com.fr.base;
import com.fr.form.main.Form;
import com.fr.invoke.ClassHelper;
import com.fr.main.impl.WorkBook;
import java.util.Set;
import junit.framework.TestCase;
import org.junit.Assert;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/28
*/
public class ClassHelperTest extends TestCase {
public void testGetClassLoaders() {
WorkBook workBook = new WorkBook();
Set<ClassLoader> set = ClassHelper.getClassLoaders(workBook);
Assert.assertFalse(set.isEmpty());
Form form = new Form();
Set<ClassLoader> set1 = ClassHelper.getClassLoaders(form);
Assert.assertFalse(set1.isEmpty());
}
}

6
designer-realize/src/test/java/com/fr/nx/app/designer/CptxAppTest.java

@ -4,7 +4,6 @@ import com.fr.file.AbstractFILE;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.nx.cptx.utils.CptxFileUtils; import com.fr.nx.cptx.utils.CptxFileUtils;
import org.easymock.EasyMock;
import org.junit.Assert; import org.junit.Assert;
import org.junit.FixMethodOrder; import org.junit.FixMethodOrder;
import org.junit.Test; import org.junit.Test;
@ -42,12 +41,9 @@ public class CptxAppTest {
} }
}; };
WorkBook workBook = new WorkBook(); WorkBook workBook = new WorkBook();
EasyMock.expect(CptxFileUtils.getWorkBook(file.getPath()))
.andReturn(workBook).once()
.andReturn(null).once();
PowerMock.replay(CptxFileUtils.class); PowerMock.replay(CptxFileUtils.class);
Assert.assertSame(workBook, new CptxApp().asIOFile(file)); Assert.assertTrue(workBook.equals(new CptxApp().asIOFile(file)));
Assert.assertNotNull(new CptxApp().asIOFile(file)); Assert.assertNotNull(new CptxApp().asIOFile(file));

Loading…
Cancel
Save