Browse Source

Merge pull request #3646 in DESIGN/design from feature/10.0 to research/10.0

* commit 'af5cbab4e4ff5fe4236392d0db233a2e256d99e2':
  无JIRA任务 解决冲突
  REPORT-47694 海外弹窗尺寸统一管理
  REPORT-48228 插件实现的插件管理不受shouldShowPlugin限制
  REPORT-47901 填报-导入excel-双向扩展是,表头部分扩展,多行导入数据丢失
  REPORT-48228 【10.0.15】国际化接口-插件jar包不匹配弹窗接口
research/10.0
superman 4 years ago
parent
commit
0821b4ee12
  1. 13
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  2. 20
      designer-base/src/main/java/com/fr/design/fun/PluginManagerProvider.java
  3. 30
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginManagerProvider.java
  4. 57
      designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java
  5. 25
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  6. 29
      designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java
  7. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  8. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  9. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  10. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  11. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  12. 2
      designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg
  13. 8
      designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg
  14. 7
      designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg
  15. 16
      designer-base/src/main/resources/com/fr/design/images/control/addPopup_disabled.svg
  16. 14
      designer-base/src/main/resources/com/fr/design/images/control/addPopup_normal.svg
  17. 8
      designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg
  18. 8
      designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg
  19. 11
      designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg
  20. 9
      designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg
  21. 11
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg
  22. 9
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg
  23. 80
      designer-base/src/test/java/com/fr/design/i18n/DesignSizeI18nManagerTest.java

13
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -3,6 +3,7 @@ package com.fr.design.dialog;
import com.fr.common.annotations.Open;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.core.PropertyChangeAdapter;
@ -33,7 +34,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框
*/
public BasicDialog showWindow(Window window, DialogActionListener l) {
return showWindowWithCustomSize(window, l, BasicDialog.DEFAULT);
return showWindowWithCustomSize(window, l, DesignSizeI18nManager.getInstance().i18nDimension(this.i18nText4PopupWindow()));
}
/**
@ -236,6 +237,14 @@ public abstract class BasicPane extends JPanel {
return title4PopupWindow();
}
/**
* 国际化标识
* @return 默认是取当前类的全限定名
*/
protected String i18nText4PopupWindow() {
return this.getClass().getName();
}
/**
* 作为名字面板
*
@ -403,4 +412,4 @@ public abstract class BasicPane extends JPanel {
}
}
}

20
designer-base/src/main/java/com/fr/design/fun/PluginManagerProvider.java

@ -0,0 +1,20 @@
package com.fr.design.fun;
import com.fr.design.actions.UpdateAction;
import com.fr.stable.fun.mark.Selectable;
/**
* 替换插件管理入口
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
public interface PluginManagerProvider extends Selectable {
String MARK_STRING = "PluginManagerProvider";
int CURRENT_LEVEL = 1;
// 插件管理
UpdateAction pluginManagerAction();
}

30
designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginManagerProvider.java

@ -0,0 +1,30 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.stable.fun.assist.Selector;
import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/**
* @author Lucian.Chen
* @version 10.0
* Created by Lucian.Chen on 2021/2/20
*/
@API(level = PluginManagerProvider.CURRENT_LEVEL)
public abstract class AbstractPluginManagerProvider extends AbstractProvider implements PluginManagerProvider {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
@Override
public Selector selector() {
return Selector.ALWAYS;
}
}

57
designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java

@ -0,0 +1,57 @@
package com.fr.design.i18n;
import com.fr.design.dialog.BasicDialog;
import com.fr.general.GeneralContext;
import com.fr.locale.LocaleManager;
import com.fr.locale.impl.FineLocaleManager;
import java.awt.Dimension;
import java.util.Map;
/**
* Created by kerry on 2/23/21
*/
public class DesignSizeI18nManager {
private static final String I18N_DIMENSION_PATH = "com/fr/design/i18n/dimension";
private static final String DIMENSION_REGEX = "^[1-9]\\d*\\*[1-9]\\d*$";
private static final String SEPARATOR_REGEX = "\\*";
private static final int WIDTH_INDEX = 0;
private static final int HEIGHT_INDEX = 1;
private static final int SPLIT_LENGTH = 2;
private static DesignSizeI18nManager instance = new DesignSizeI18nManager();
public static DesignSizeI18nManager getInstance() {
return instance;
}
private LocaleManager localeManager = FineLocaleManager.create();
private DesignSizeI18nManager() {
localeManager.addResource(I18N_DIMENSION_PATH);
}
public Dimension i18nDimension(String key) {
if (!containKey(key)) {
return BasicDialog.DEFAULT;
}
String dimension = localeManager.getLocalBundle(GeneralContext.getLocale()).getText(localeManager, key);
return parseDimensionFromText(dimension);
}
private boolean containKey(String key) {
Map<String, String> localeKV = localeManager.getLocalBundle(GeneralContext.getLocale()).getKV(localeManager);
return localeKV != null && localeKV.containsKey(key);
}
private Dimension parseDimensionFromText(String dimensionText) {
if (!dimensionText.matches(DIMENSION_REGEX)) {
return BasicDialog.DEFAULT;
}
String[] arr = dimensionText.split(SEPARATOR_REGEX);
if (arr.length < SPLIT_LENGTH) {
return BasicDialog.DEFAULT;
}
return new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX]));
}
}

25
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -41,6 +41,7 @@ import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -72,6 +73,7 @@ import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.bridge.ObjectHolder;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.start.OemHandler;
@ -487,11 +489,7 @@ public abstract class ToolBarMenuDock {
}
if (!DesignerMode.isAuthorityEditing()) {
if (shouldShowPlugin()) {
menuDef.addShortCut(
new PluginManagerAction()
);
}
addPluginManagerAction(menuDef);
menuDef.addShortCut(
new FunctionManagerAction(),
new GlobalParameterAction()
@ -502,6 +500,23 @@ public abstract class ToolBarMenuDock {
return menuDef;
}
private void addPluginManagerAction(MenuDef menuDef) {
Set<PluginManagerProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginManagerProvider.MARK_STRING);
if (providers != null) {
for (PluginManagerProvider provider : providers) {
if (provider.selector().accept(new ObjectHolder())) {
menuDef.addShortCut(provider.pluginManagerAction());
return;
}
}
}
if (shouldShowPlugin()) {
menuDef.addShortCut(
new PluginManagerAction()
);
}
}
private ShortCut createGlobalTDAction() {
TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG);
return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction();

29
designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java vendored

@ -1,12 +1,16 @@
package com.fr.env;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.IOUtils;
import com.fr.stable.bridge.ObjectHolder;
import javax.swing.BorderFactory;
import javax.swing.Icon;
@ -23,6 +27,7 @@ import java.awt.Frame;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Set;
/**
* 插件启动失败提示窗
@ -77,7 +82,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With"));
cancelButton.addActionListener(this);
okButton.addActionListener(new PluginManagerActionAdapter(this));
okButton.addActionListener(new PluginManagerHandleAction(this));
// 按钮
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
@ -102,18 +107,34 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
this.dispose();
}
private static class PluginManagerActionAdapter extends PluginManagerAction {
private static class PluginManagerHandleAction extends UpdateAction {
private JDialog jDialog;
private UpdateAction pluginManagerAction;
public PluginManagerActionAdapter(JDialog jDialog) {
public PluginManagerHandleAction(JDialog jDialog) {
this.jDialog = jDialog;
initPluginManagerAction();
}
private void initPluginManagerAction() {
Set<PluginManagerProvider> providers = ExtraDesignClassManager.getInstance().getArray(PluginManagerProvider.MARK_STRING);
if (providers != null) {
for (PluginManagerProvider provider : providers) {
if (provider.selector().accept(new ObjectHolder())) {
this.pluginManagerAction = provider.pluginManagerAction();
}
}
}
if (this.pluginManagerAction == null) {
this.pluginManagerAction = new PluginManagerAction();
}
}
@Override
public void actionPerformed(ActionEvent e) {
this.jDialog.dispose();
super.actionPerformed(e);
this.pluginManagerAction.actionPerformed(e);
}
}

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -0,0 +1 @@
com.fr.design.report.ReportColumnsPane=800*600

0
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

0
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

1
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -0,0 +1 @@
# \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height

0
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

2
designer-base/src/main/resources/com/fr/design/images/bbs/bbs_normal.svg

@ -4,4 +4,4 @@
<g id="icon/社区/首页_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M2.41421356,7 L3,7 L3,14 L6,14 L6,10 L10,10 L10,14 L13,14 L13,7 L13.5857864,7 L8,1.41421356 L2.41421356,7 Z M0.341421356,7.65857864 L8,0 L15.6585786,7.65857864 C15.7366835,7.7366835 15.7366835,7.8633165 15.6585786,7.94142136 C15.6210714,7.97892863 15.5702006,8 15.5171573,8 L14,8 L14,15 L9,15 L9,11 L7,11 L7,15 L2,15 L2,8 L0.482842712,8 C0.372385763,8 0.282842712,7.91045695 0.282842712,7.8 C0.282842712,7.7469567 0.303914081,7.69608592 0.341421356,7.65857864 Z" id="Rectangle-148" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 889 B

After

Width:  |  Height:  |  Size: 888 B

8
designer-base/src/main/resources/com/fr/design/images/buttonicon/prewidget_normal.svg

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="30px" height="20px" viewBox="0 0 30 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_控件管理 有小箭头_normal</title>
<g id="icon_控件管理-有小箭头_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M16.0758389,11.7597783 L17.7397914,13.4242307 L14.4118864,16.7516357 L11.4999696,17.9996 L12.747934,15.0876832 L16.0758389,11.7597783 Z M17,3 C17.5522847,3 18,3.44771525 18,4 L18.0005048,10.107534 C17.6771796,10.0020594 17.3340722,9.9742129 17.0003341,10.0239839 L17,4 L5,4 L5,15 L11.697,15 L11.268,16 L5,16 C4.44771525,16 4,15.5522847 4,15 L4,4 C4,3.44771525 4.44771525,3 5,3 L17,3 Z M18,14.577 L18,15 C18,15.5522847 17.5522847,16 17,16 L16.576,16 L18,14.577 Z M18.1553795,11.3442402 C18.6148663,11.803727 18.6148663,12.5487057 18.1553795,13.0081926 L16.491427,11.3442402 C16.9509139,10.8852533 17.6958926,10.8852533 18.1553795,11.3442402 Z M15,10 L15,11.42 L13.42,13 L9,13 L9,10 L15,10 Z M8,10 L8,12 L6,12 L6,10 L8,10 Z M14,11 L10,11 L10,12 L14,12 L14,11 Z M15,6 L15,9 L9,9 L9,6 L15,6 Z M8,6 L8,8 L6,8 L6,6 L8,6 Z M14,7 L10,7 L10,8 L14,8 L14,7 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
<path d="M23.3414214,10.3414214 L27,14 L27,14 L23.3414214,17.6585786 C23.2633165,17.7366835 23.1366835,17.7366835 23.0585786,17.6585786 C23.0210714,17.6210714 23,17.5702006 23,17.5171573 L23,10.4828427 C23,10.3723858 23.0895431,10.2828427 23.2,10.2828427 C23.2530433,10.2828427 23.3039141,10.3039141 23.3414214,10.3414214 Z" id="Rectangle-2" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

7
designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/files_up_normal.svg

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_控件_文件控件_normal</title>
<g id="icon_控件_文件控件_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11,-1.28785871e-13 L15,4.001 L15,14 L4,14 L4,3 L2,3 L2,15 L11,15 L11,14 L12,14 L12,16 L1,16 L1,2 L4,2 L4,-1.35780276e-13 L11,-1.28785871e-13 Z M10.586,1 L5,1 L5,13 L14,13 L13.999,4.415 L11,4.415 L10.999,4.405 L11,4.415 L10.586,4.415 L10.586,1 Z M13,10 L13,11 L6,11 L6,10 L13,10 Z M13,8 L13,9 L6,9 L6,8 L13,8 Z M13,6 L13,7 L6,7 L6,6 L13,6 Z" id="形状结合" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 758 B

16
designer-base/src/main/resources/com/fr/design/images/control/addPopup_disabled.svg

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="16px" viewBox="0 0 24 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-8.000000, -6.000000)">
<g id="编组" transform="translate(8.000000, 6.000000)">
<g fill="#333334" id="Combined-Shape">
<path d="M8,2 C8.38659932,2 8.7,2.32097101 8.7,2.69703907 L8.7,7.3 L13.3029609,7.3 C13.6558446,7.3 13.9474813,7.56107882 13.9936369,7.90444795 L14,8 C14,8.38659932 13.679029,8.7 13.3029609,8.7 L8.7,8.699 L8.7,13.3029609 C8.7,13.6558446 8.43892118,13.9474813 8.09555205,13.9936369 L8,14 C7.61340068,14 7.3,13.679029 7.3,13.3029609 L7.3,8.699 L2.69703907,8.7 C2.34415536,8.7 2.05251868,8.43892118 2.00636315,8.09555205 L2,8 C2,7.61340068 2.32097101,7.3 2.69703907,7.3 L7.3,7.3 L7.3,2.69703907 C7.3,2.34415536 7.56107882,2.05251868 7.90444795,2.00636315 L8,2 Z"></path>
</g>
<g transform="translate(16.000000, 4.000000)" fill="#8F8F92" id="Rectangle-6">
<path d="M2,0.997030139 C2,0.446385598 2.31387329,0.313873291 2.70591205,0.705912054 L6,4 L2.70591205,7.29408795 C2.31604759,7.68395241 2,7.54696369 2,7.00296986 L2,0.997030139 Z" transform="translate(4.000000, 4.000000) rotate(90.000000) translate(-4.000000, -4.000000) "></path>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

14
designer-base/src/main/resources/com/fr/design/images/control/addPopup_normal.svg

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="24px" height="16px" viewBox="0 0 24 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>编组备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="编组备份">
<g id="Combined-Shape" fill="#333334">
<path d="M8,2 C8.38659932,2 8.7,2.32097101 8.7,2.69703907 L8.7,7.3 L13.3029609,7.3 C13.6558446,7.3 13.9474813,7.56107882 13.9936369,7.90444795 L14,8 C14,8.38659932 13.679029,8.7 13.3029609,8.7 L8.7,8.699 L8.7,13.3029609 C8.7,13.6558446 8.43892118,13.9474813 8.09555205,13.9936369 L8,14 C7.61340068,14 7.3,13.679029 7.3,13.3029609 L7.3,8.699 L2.69703907,8.7 C2.34415536,8.7 2.05251868,8.43892118 2.00636315,8.09555205 L2,8 C2,7.61340068 2.32097101,7.3 2.69703907,7.3 L7.3,7.3 L7.3,2.69703907 C7.3,2.34415536 7.56107882,2.05251868 7.90444795,2.00636315 L8,2 Z"></path>
</g>
<g id="Rectangle-6" transform="translate(16.000000, 4.000000)" fill="#8F8F92">
<path d="M2,0.997030139 C2,0.446385598 2.31387329,0.313873291 2.70591205,0.705912054 L6,4 L2.70591205,7.29408795 C2.31604759,7.68395241 2,7.54696369 2,7.00296986 L2,0.997030139 Z" transform="translate(4.000000, 4.000000) rotate(90.000000) translate(-4.000000, -4.000000) "></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

8
designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_编辑_disable</title>
<g id="icon_编辑_disable" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.299107143">
<path d="M9.95422984,2.34704298 L13.4897637,5.88257688 L6.18790578,13.1844348 L0.884604926,14.9522018 L2.65237188,9.64890094 L9.95422984,2.34704298 Z M13.4897637,1.6399362 L14.1968705,2.34704298 C14.9368113,3.08698374 14.9757555,4.2624679 14.3137033,5.04825533 L14.1968705,5.1754701 L10.6613366,1.6399362 C11.4423852,0.858887612 12.7087152,0.858887612 13.4897637,1.6399362 Z" id="形状结合" fill="#333334"></path>
<rect id="矩形" fill="#333334" x="7" y="14" width="7" height="1"></rect>
</g>
</svg>

After

Width:  |  Height:  |  Size: 864 B

8
designer-base/src/main/resources/com/fr/design/images/control/edit_normal.svg

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_编辑_normal</title>
<g id="icon_编辑_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M9.95422984,2.34704298 L13.4897637,5.88257688 L6.18790578,13.1844348 L0.884604926,14.9522018 L2.65237188,9.64890094 L9.95422984,2.34704298 Z M13.4897637,1.6399362 L14.1968705,2.34704298 C14.9368113,3.08698374 14.9757555,4.2624679 14.3137033,5.04825533 L14.1968705,5.1754701 L10.6613366,1.6399362 C11.4423852,0.858887612 12.7087152,0.858887612 13.4897637,1.6399362 Z" id="形状结合" fill="#333334"></path>
<rect id="矩形" fill="#333334" x="7" y="14" width="7" height="1"></rect>
</g>
</svg>

After

Width:  |  Height:  |  Size: 840 B

11
designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_删除_normal</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-78.000000, -7.000000)" fill="#333334">
<g id="icon_删除_normal" transform="translate(77.000000, 6.000000)">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 804 B

9
designer-base/src/main/resources/com/fr/design/images/control/remove_normal.svg

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_删除_normal备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Combined-Shape" transform="translate(-1.000000, -1.000000)" fill="#333334">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 660 B

11
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="14px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_报表web属性_打印预览_normal</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<g id="工具栏/导入数据集" transform="translate(-116.000000, -7.000000)" fill="#333334">
<g id="icon_报表web属性_打印预览_normal" transform="translate(114.000000, 6.000000)">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z" id="Combined-Shape"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

9
designer-base/src/main/resources/com/fr/design/images/m_file/preview_normal.svg

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="12px" height="14px" viewBox="0 0 12 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_报表web属性_打印预览_normal备份</title>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Combined-Shape" transform="translate(-2.000000, -1.000000)" fill="#333334">
<path d="M9.5,7 C11.432875,7 13,8.567125 13,10.5 C13,11.1075915 12.845147,11.679042 12.5727578,12.1770349 C12.6203353,12.2075319 12.6650188,12.2450114 12.7069,12.287 L13.7129,13.293 C14.1039,13.684 14.1039,14.316 13.7129,14.707 C13.5179,14.902 13.2619,15 13.0059,15 C12.7499,15 12.4939,14.902 12.2989,14.707 L11.2929,13.701 C11.251507,13.6597129 11.2144961,13.6157024 11.1818672,13.5695439 C10.6844106,13.8436886 10.110446,14 9.5,14 C7.567125,14 6,12.432875 6,10.5 C6,8.567125 7.567125,7 9.5,7 Z M10,1 L14,5 L14,8 L13,8 L13,6 L9,6 L9,2 L3,2 L3,14 L7,14 L7,15 L2,15 L2,1 L10,1 Z M9.5,8 C10.8783333,8 12,9.12166667 12,10.5 C12,11.8783333 10.8783333,13 9.5,13 C8.12166667,13 7,11.8783333 7,10.5 C7,9.12166667 8.12166667,8 9.5,8 Z M12.587,5 L10,2.414 L10,5 L12.587,5 Z"></path>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

80
designer-base/src/test/java/com/fr/design/i18n/DesignSizeI18nManagerTest.java

@ -0,0 +1,80 @@
package com.fr.design.i18n;
import com.fr.general.GeneralContext;
import com.fr.invoke.Reflect;
import org.easymock.EasyMock;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.easymock.PowerMock;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
import java.awt.Dimension;
import java.util.Locale;
/**
* Created by kerry on 2/24/21
*/
@RunWith(PowerMockRunner.class)
@PrepareForTest(GeneralContext.class)
public class DesignSizeI18nManagerTest {
@Test
public void testI18nDimension() {
Dimension dimension = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.ReportColumnsPane");
validDimension(dimension, 660, 600);
PowerMock.mockStatic(GeneralContext.class);
EasyMock.expect(GeneralContext.getLocale()).andReturn(Locale.ENGLISH).times(3);
PowerMock.replayAll();
dimension = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.ReportColumnsPane");
validDimension(dimension, 800, 600);
}
@Test
public void testContainKey() {
PowerMock.mockStatic(GeneralContext.class);
EasyMock.expect(GeneralContext.getLocale()).andReturn(Locale.ENGLISH).times(3);
PowerMock.replayAll();
boolean result = Reflect.on(DesignSizeI18nManager.getInstance()).call("containKey", "testKey").get();
Assert.assertFalse(result);
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("containKey", "com.fr.design.report.ReportColumnsPane").get();
Assert.assertTrue(result);
}
@Test
public void testParseDimensionFromText() {
String dimensionText = "800*600";
Dimension result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 800, 600);
dimensionText = "800* 600";
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 660, 600);
dimensionText = " 800*600";
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 660, 600);
dimensionText = "800*600s";
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 660, 600);
dimensionText = "800s*600";
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 660, 600);
dimensionText = "800-600";
result = Reflect.on(DesignSizeI18nManager.getInstance()).call("parseDimensionFromText", dimensionText).get();
validDimension(result, 660, 600);
}
private void validDimension(Dimension dimension, int width, int height) {
Assert.assertEquals(width, dimension.width);
Assert.assertEquals(height, dimension.height);
}
}
Loading…
Cancel
Save