Browse Source

Merge pull request #3856 in DESIGN/design from release/10.0 to final/10.0

* commit '48553273c9f97c5e9a48dfa25a56826dfb8d75d5': (37 commits)
  REPORT-50204 未保存点击预览,提示保存模板的弹窗,点击取消后再弹窗
  REPORT-50191 设计器-服务器数据集-左下角图标变化失效 【问题原因】REPORT-49782任务中补充图标的时候,图标名称写错了,导致没识别出来 【改动思路】修改图标名称
  CHART-18080 变量名更换
  CHART-18619 gis国际化默认值修改
  REPORT-50030 单元格外边框设置其他颜色设计器内显示与黑色不一样
  CHART-18348 调整富文本组件尺寸
  KERNEL-6368【代码检测】XML注入(XML External Entity Injection)
  无JIRA任务 上传下因代码冲突被删除的svg图标
  REPORT-48965 使用批量添加 减少容器复制次数
  REPORT-48965 出现concurrentModification异常
  CHART-18080 修复数字输入框输入中文时自动删除数字问题
  REPORT-45944  ui调整
  REPORT-48324 聚合报表,超链在设计器中切换模板后显示不对
  REPORT-48999 填报-填报属性设置-填报属性快捷设置远程设计修改无效
  REPORT-47438 判断跟随自主界面的条件再优化补充下
  REPORT-48324 聚合报表,超链在设计器中切换模板后显示不对
  REPORT-48933 设计器菜单-社区下新增“工单中心”链接
  REPORT-45944 日文版模板重命名弹窗显示不全
  REPORT-47438 设计器弹窗部分弹窗不跟随主屏位置
  REPORT-47438 设计器弹窗部分弹窗不跟随主屏位置
  ...
final/10.0
superman 4 years ago
parent
commit
5bf0d5d0ed
  1. 38
      designer-base/src/main/java/com/fr/base/svg/IconUtils.java
  2. 26
      designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java
  3. 16
      designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java
  4. 2
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  5. 37
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  6. 1
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  7. 11
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  8. 2
      designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java
  9. 2
      designer-base/src/main/java/com/fr/design/extra/ShopDialog.java
  10. 5
      designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  11. 20
      designer-base/src/main/java/com/fr/design/fun/PluginManagerProvider.java
  12. 30
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractPluginManagerProvider.java
  13. 20
      designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java
  14. 20
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  15. 42
      designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java
  16. 18
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  17. 4
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java
  18. 9
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java
  19. 8
      designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java
  20. 57
      designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java
  21. 32
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  22. 39
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  23. 4
      designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java
  24. 28
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  25. 21
      designer-base/src/main/java/com/fr/design/plugin/DesignerPluginContext.java
  26. 11
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  27. 14
      designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java
  28. 2
      designer-base/src/main/java/com/fr/design/upm/UpmFinder.java
  29. 2
      designer-base/src/main/java/com/fr/design/upm/UpmShowDialog.java
  30. 10
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  31. 6
      designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java
  32. 29
      designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java
  33. 5
      designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java
  34. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  35. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  36. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  37. 1
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  38. 0
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  39. BIN
      designer-base/src/main/resources/com/fr/design/images/bbs/workOrderCenter.png
  40. 7
      designer-base/src/main/resources/com/fr/design/images/bbs/workOrderCenter_normal.svg
  41. 0
      designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg
  42. 0
      designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg
  43. 0
      designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg
  44. 80
      designer-base/src/test/java/com/fr/design/i18n/DesignSizeI18nManagerTest.java
  45. 10
      designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java
  46. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  47. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  48. 4
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js
  49. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png
  50. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png
  51. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png
  52. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png
  53. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png
  54. BIN
      designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png
  55. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png
  56. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png
  57. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png
  58. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png
  59. 4
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  60. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java
  61. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  62. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java
  63. 4
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java
  64. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java
  65. 3
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java
  66. 23
      designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

38
designer-base/src/main/java/com/fr/base/svg/IconUtils.java

@ -2,9 +2,15 @@ package com.fr.base.svg;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.fun.ResourcePathTransformer;
import com.fr.stable.plugin.ExtraClassManagerProvider;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/** /**
* 主要是用来读取svgIcon的工具类 * 主要是用来读取svgIcon的工具类
@ -36,7 +42,7 @@ public class IconUtils {
// 判断是否以.svg结尾 // 判断是否以.svg结尾
if (resource.endsWith(ICON_SUFFIX_SVG)) { if (resource.endsWith(ICON_SUFFIX_SVG)) {
if (IOUtils.readResource(resource) != null) { if (IOUtils.readResource(resource) != null) {
return SVGIcon.readSVGIcon(resource); return SVGIcon.readSVGIcon(transformPath(resource));
} }
// 适配插件 // 适配插件
return adjustPluginsPng(resource); return adjustPluginsPng(resource);
@ -68,15 +74,15 @@ public class IconUtils {
private static Icon readNoSuffixResource(String resource, String svgIconType) { private static Icon readNoSuffixResource(String resource, String svgIconType) {
String svgPath = resource + svgIconType; String svgPath = resource + svgIconType;
if (IOUtils.readResource(svgPath) != null) { if (IOUtils.readResource(svgPath) != null) {
return SVGIcon.readSVGIcon(svgPath); return SVGIcon.readSVGIcon(transformPath(svgPath));
} }
String pngPath = resource + ICON_SUFFIX_PNG; String pngPath = resource + ICON_SUFFIX_PNG;
if (IOUtils.readResource(pngPath) != null) { if (IOUtils.readResource(pngPath) != null) {
return IOUtils.readIcon(pngPath); return IOUtils.readIcon(transformPath(pngPath));
} }
String gifPath = resource + ICON_SUFFIX_GIF; String gifPath = resource + ICON_SUFFIX_GIF;
if (IOUtils.readResource(gifPath) != null) { if (IOUtils.readResource(gifPath) != null) {
return IOUtils.readIcon(gifPath); return IOUtils.readIcon(transformPath(gifPath));
} }
FineLoggerFactory.getLogger().error("File not exists:{}", resource); FineLoggerFactory.getLogger().error("File not exists:{}", resource);
return new ImageIcon(); return new ImageIcon();
@ -113,8 +119,30 @@ public class IconUtils {
private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) { private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) {
String iconPath = resource.replace(oldSuffix, newSuffix); String iconPath = resource.replace(oldSuffix, newSuffix);
if (IOUtils.readResource(iconPath) != null) { if (IOUtils.readResource(iconPath) != null) {
return SVGIcon.readSVGIcon(iconPath); return SVGIcon.readSVGIcon(transformPath(iconPath));
} }
return readIcon(resource); return readIcon(resource);
} }
private static String transformPath(String path) {
Set<ResourcePathTransformer> set = getResourcePathTransformers();
for (ResourcePathTransformer transformer : set) {
if (transformer.accept(path)) {
return transformer.transform(path);
}
}
return path;
}
private static Set<ResourcePathTransformer> getResourcePathTransformers() {
Set<ResourcePathTransformer> set = new HashSet<ResourcePathTransformer>();
ExtraClassManagerProvider provider = StableFactory.getExtraClassManager();
if (provider != null) {
Set<ResourcePathTransformer> pluginProvided = provider.getArray(ResourcePathTransformer.MARK_STRING);
set.addAll(pluginProvided);
}
ResourcePathTransformer[] oemSet = StableFactory.getMarkedObjectsFromCollection(ResourcePathTransformer.MARK_STRING, ResourcePathTransformer.class);
set.addAll(Arrays.asList(oemSet));
return set;
}
} }

26
designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java

@ -0,0 +1,26 @@
package com.fr.design.actions.community;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import java.awt.event.ActionEvent;
/**
* @Description 工单中心
* @Author Henry.Wang
* @Date 2021/3/8 14:02
**/
public class WorkOrderCenterAction extends UpAction {
public WorkOrderCenterAction() {
this.setSmallIcon("/com/fr/design/images/bbs/workOrderCenter");
this.setName(Toolkit.i18nText("Fine-Design_Basic_Commuinity_Work_Order_Center"));
}
@Override
public void actionPerformed(ActionEvent arg0) {
String url = CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center");
BrowseUtils.browser(url);
}
}

16
designer-base/src/main/java/com/fr/design/actions/core/ActionFactory.java

@ -13,12 +13,14 @@ import javax.swing.KeyStroke;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArraySet;
/** /**
* 插入单元格元素和插入悬浮元素的一些集合方法 * 插入单元格元素和插入悬浮元素的一些集合方法
@ -27,8 +29,8 @@ import java.util.concurrent.ConcurrentMap;
* @version 2017年11月17日14点39分 * @version 2017年11月17日14点39分
*/ */
public class ActionFactory { public class ActionFactory {
private static LinkedHashSet<Class<?>> actionClasses = new LinkedHashSet<>(); private static Set<Class<?>> actionClasses = new CopyOnWriteArraySet<>();
private static LinkedHashSet<Class<?>> floatActionClasses = new LinkedHashSet<>(); private static Set<Class<?>> floatActionClasses = new CopyOnWriteArraySet<>();
private static Class chartCollectionClass = null; private static Class chartCollectionClass = null;
/** /**
* 无需每次实例化的悬浮元素编辑器 * 无需每次实例化的悬浮元素编辑器
@ -256,14 +258,14 @@ public class ActionFactory {
*/ */
public static void registerCellInsertActionClass(Class<?>[] cls) { public static void registerCellInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
Collections.addAll(actionClasses, cls); actionClasses.addAll(Arrays.asList(cls));
} }
} }
public static void referCellInsertActionClass(Class<?>[] cls) { public static void referCellInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
actionClasses.clear(); actionClasses.clear();
Collections.addAll(actionClasses, cls); actionClasses.addAll(Arrays.asList(cls));
} }
} }
@ -321,14 +323,14 @@ public class ActionFactory {
*/ */
public static void registerFloatInsertActionClass(Class<?>[] cls) { public static void registerFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
Collections.addAll(floatActionClasses, cls); floatActionClasses.addAll(Arrays.asList(cls));
} }
} }
public static void referFloatInsertActionClass(Class<?>[] cls) { public static void referFloatInsertActionClass(Class<?>[] cls) {
if (cls != null) { if (cls != null) {
floatActionClasses.clear(); floatActionClasses.clear();
Collections.addAll(floatActionClasses, cls); floatActionClasses.addAll(Arrays.asList(cls));
} }
} }

2
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -86,6 +86,8 @@ public final class WebPreviewUtils {
if (!jt.saveAsTemplate()) { if (!jt.saveAsTemplate()) {
return; return;
} }
} else {
return;
} }
currentTemplate = jt.getEditingFILE(); currentTemplate = jt.getEditingFILE();
} }

37
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -1,27 +1,32 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.db.TableProcedure;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilist.TableViewList; import com.fr.design.gui.ilist.TableViewList;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.ToolTipManager;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.event.*; import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List; import java.util.List;
/** /**
@ -48,10 +53,11 @@ public class ConnectionTableProcedurePane extends BasicPane {
filter(connection, conName, nameList); filter(connection, conName, nameList);
} }
@Override
protected void refreshItems() { protected void refreshItems() {
super.refreshItems(); super.refreshItems();
if (tableViewList != null) { if (tableViewList != null) {
search(); search(true);
} }
} }
}; };
@ -148,17 +154,17 @@ public class ConnectionTableProcedurePane extends BasicPane {
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
search(); search(false);
} }
@Override @Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
search(); search(false);
} }
@Override @Override
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
search(); search(false);
} }
}; };
@ -166,14 +172,14 @@ public class ConnectionTableProcedurePane extends BasicPane {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
search(); search(false);
} }
}; };
/** /**
* 选项改变需要重新刷新下拉列表里面的项 * 选项改变需要重新刷新下拉列表里面的项
*/ */
protected void search() { protected void search(boolean refresh) {
String selectedObj = connectionComboBox.getSelectedItem(); String selectedObj = connectionComboBox.getSelectedItem();
String[] types = ArrayUtils.EMPTY_STRING_ARRAY; String[] types = ArrayUtils.EMPTY_STRING_ARRAY;
@ -187,7 +193,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
} else { } else {
types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE); types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE);
} }
tableViewList.populate(selectedObj, searchField.getText().trim(), types); tableViewList.populate(selectedObj, searchField.getText().trim(), refresh, types);
} }
@Override @Override
@ -196,7 +202,6 @@ public class ConnectionTableProcedurePane extends BasicPane {
} }
/** /**
*
* @param l * @param l
*/ */
public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) { public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) {

1
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -169,7 +169,6 @@ public class PreviewTablePane extends BasicPane {
this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER);
if (this.dialog == null) { if (this.dialog == null) {
this.dialog = this.showWindow(new JFrame()); this.dialog = this.showWindow(new JFrame());
GUICoreUtils.centerWindow(DesignerContext.getDesignerFrame(), this.dialog);
} }
progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { progressBar = new AutoProgressBar(this, Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) {
public void doMonitorCanceled() { public void doMonitorCanceled() {

11
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.common.annotations.Open;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.core.PropertyChangeAdapter; import com.fr.stable.core.PropertyChangeAdapter;
@ -33,7 +34,7 @@ public abstract class BasicPane extends JPanel {
* @return 对话框 * @return 对话框
*/ */
public BasicDialog showWindow(Window window, DialogActionListener l) { 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 title4PopupWindow();
} }
/**
* 国际化标识
* @return 默认是取当前类的全限定名
*/
protected String i18nText4PopupWindow() {
return this.getClass().getName();
}
/** /**
* 作为名字面板 * 作为名字面板
* *

2
designer-base/src/main/java/com/fr/design/extra/PluginWebBridge.java

@ -16,6 +16,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsRegisterMark;
import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.locale.impl.BbsResetMark;
import com.fr.design.locale.impl.BbsSpaceMark; import com.fr.design.locale.impl.BbsSpaceMark;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleCenter;
@ -401,6 +402,7 @@ public class PluginWebBridge {
if (uiDialog != null) { if (uiDialog != null) {
uiDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); uiDialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
uiDialog.setVisible(false); uiDialog.setVisible(false);
DesignerPluginContext.setPluginDialog(null);
} }
} }

2
designer-base/src/main/java/com/fr/design/extra/ShopDialog.java

@ -3,6 +3,7 @@ package com.fr.design.extra;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.jdk.JdkVersion; import com.fr.design.jdk.JdkVersion;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -25,6 +26,7 @@ public class ShopDialog extends UIDialog {
setSize(createDefaultDimension()); setSize(createDefaultDimension());
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
setResizable(false); setResizable(false);
DesignerPluginContext.setPluginDialog(this);
} }
private Dimension createDefaultDimension() { private Dimension createDefaultDimension() {

5
designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java

@ -5,6 +5,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils; import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.manage.control.PluginTaskCallback; import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.PluginTaskResult;
@ -31,9 +32,9 @@ public class ModifyStatusCallback implements PluginTaskCallback{
pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") :
pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate"); pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
FineLoggerFactory.getLogger().info(modifyMessage); FineLoggerFactory.getLogger().info(modifyMessage);
FineJOptionPane.showMessageDialog(null, modifyMessage); FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(), modifyMessage);
} else { } else {
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE); FineJOptionPane.showMessageDialog(DesignerPluginContext.getPluginDialog(), pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
} }
} }

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

20
designer-base/src/main/java/com/fr/design/gui/autocomplete/DefaultCompletionProvider.java

@ -24,7 +24,11 @@ import javax.swing.text.Segment;
import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.SAXParserFactory;
import com.fr.log.FineLoggerFactory;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.SAXNotRecognizedException;
import org.xml.sax.SAXNotSupportedException;
/** /**
@ -81,10 +85,10 @@ public class DefaultCompletionProvider extends AbstractCompletionProvider {
/** /**
* Returns the text just before the current caret position that could be * Returns the text just before the current caret position that could be
* the start of something auto-completable.<p> * the start of something auto-completable.<p>
* * <p>
* This method returns all characters before the caret that are matched * This method returns all characters before the caret that are matched
* by {@link #isValidChar(char)}. * by {@link #isValidChar(char)}.
* * <p>
* {@inheritDoc} * {@inheritDoc}
*/ */
public String getAlreadyEnteredText(JTextComponent comp) { public String getAlreadyEnteredText(JTextComponent comp) {
@ -314,6 +318,15 @@ public class DefaultCompletionProvider extends AbstractCompletionProvider {
//long start = System.currentTimeMillis(); //long start = System.currentTimeMillis();
SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParserFactory factory = SAXParserFactory.newInstance();
try {
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException | SAXNotSupportedException | SAXNotRecognizedException e) {
FineLoggerFactory.getLogger().warn(e.getMessage(), e);
}
factory.setValidating(true); factory.setValidating(true);
CompletionXMLParser handler = new CompletionXMLParser(this, cl); CompletionXMLParser handler = new CompletionXMLParser(this, cl);
BufferedInputStream bin = new BufferedInputStream(in); BufferedInputStream bin = new BufferedInputStream(in);
@ -357,8 +370,7 @@ public class DefaultCompletionProvider extends AbstractCompletionProvider {
File file = new File(resource); File file = new File(resource);
if (file.isFile()) { if (file.isFile()) {
in = new FileInputStream(file); in = new FileInputStream(file);
} } else {
else {
throw new IOException("No such resource: " + resource); throw new IOException("No such resource: " + resource);
} }
} }

20
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -82,7 +82,7 @@ public class TableViewList extends UIList {
* @param searchFilter * @param searchFilter
* @param typesFilter * @param typesFilter
*/ */
public void populate(final String databaseName, final String searchFilter, final String... typesFilter) { public void populate(final String databaseName, final String searchFilter, boolean refresh, final String... typesFilter) {
DefaultListModel defaultListModel = new DefaultListModel(); DefaultListModel defaultListModel = new DefaultListModel();
defaultListModel.addElement(UIConstants.PENDING); defaultListModel.addElement(UIConstants.PENDING);
final DefaultListModel failed = new DefaultListModel(); final DefaultListModel failed = new DefaultListModel();
@ -106,12 +106,9 @@ public class TableViewList extends UIList {
if (!status) { if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
} }
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); if (refresh) {
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; clearCache(datasource);
for (String schema : schemas) {
clearCache(datasource, schema);
} }
clearCache(datasource, null);
return processDataInAnotherThread(databaseName, searchFilter, typesFilter); return processDataInAnotherThread(databaseName, searchFilter, typesFilter);
} }
@ -132,7 +129,16 @@ public class TableViewList extends UIList {
} }
} }
private void clearCache(Connection datasource, String schema) { private void clearCache(Connection datasource) {
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource);
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas;
for (String schema : schemas) {
doClearCache(datasource, schema);
}
doClearCache(datasource, null);
}
private void doClearCache(Connection datasource, String schema) {
DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema);

42
designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java

@ -5,11 +5,15 @@ import com.fr.general.ComparatorUtils;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.event.CaretEvent;
import javax.swing.event.CaretListener;
import javax.swing.text.AttributeSet; import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.PlainDocument; import javax.swing.text.PlainDocument;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Toolkit; import java.awt.Toolkit;
import java.awt.event.InputMethodEvent;
import java.awt.event.InputMethodListener;
/** /**
* Number Field. * Number Field.
@ -35,6 +39,11 @@ public class UINumberField extends UITextField {
private boolean isContentChanged = false; private boolean isContentChanged = false;
private boolean fillNegativeNumber = true; private boolean fillNegativeNumber = true;
/**
* 输入法输入完成一个字符输入过程的标记开始输入的时候是true输入完矫正光标后为false
*/
private boolean isInputMethodOnceInserting = false;
private int insertOffset = 0;
public UINumberField() { public UINumberField() {
this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH);
@ -55,6 +64,7 @@ public class UINumberField extends UITextField {
this.minValue = minValue; this.minValue = minValue;
this.maxValue = maxValue; this.maxValue = maxValue;
setFieldDocument(); setFieldDocument();
initFieldListener();
} }
public void setFieldDocument() { public void setFieldDocument() {
@ -62,6 +72,31 @@ public class UINumberField extends UITextField {
initListener(); initListener();
} }
private void initFieldListener() {
addInputMethodListener(new InputMethodListener() {
@Override
public void inputMethodTextChanged(InputMethodEvent event) {
isInputMethodOnceInserting = true;
}
@Override
public void caretPositionChanged(InputMethodEvent event) {
}
});
addCaretListener(new CaretListener() {
@Override
public void caretUpdate(CaretEvent e) {
if (isInputMethodOnceInserting) {
isInputMethodOnceInserting = false;
setCaretPosition(insertOffset);
} else {
insertOffset = e.getDot();
}
}
});
}
public void canFillNegativeNumber(boolean fillNegativeNumber) { public void canFillNegativeNumber(boolean fillNegativeNumber) {
this.fillNegativeNumber = fillNegativeNumber; this.fillNegativeNumber = fillNegativeNumber;
} }
@ -186,6 +221,13 @@ public class UINumberField extends UITextField {
super.insertString(offset, s, a); super.insertString(offset, s, a);
} }
public void remove(int offs, int len) throws BadLocationException {
if (isInputMethodOnceInserting) {
return;
}
super.remove(offs, len);
}
// kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100.
// 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难..
private boolean notChange(String strNew) { private boolean notChange(String strNew) {

18
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -217,18 +217,36 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
int lineStyle = currentLineCombo.getSelectedLineStyle(); int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject(); Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle(); CellBorderStyle cellBorderStyle = new CellBorderStyle();
if (topToggleButton.isSelected()) {
cellBorderStyle.setTopColor(lineColor); cellBorderStyle.setTopColor(lineColor);
}
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor); cellBorderStyle.setBottomColor(lineColor);
}
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor); cellBorderStyle.setLeftColor(lineColor);
}
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor); cellBorderStyle.setRightColor(lineColor);
}
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor); cellBorderStyle.setVerticalColor(lineColor);
}
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor); cellBorderStyle.setHorizontalColor(lineColor);
}
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) { if (leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()) {
outerToggleButton.setSelected(true); outerToggleButton.setSelected(true);
} else { } else {

4
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/SyntaxScheme.java

@ -624,6 +624,10 @@ public class SyntaxScheme implements Cloneable, TokenTypes {
SyntaxSchemeLoader parser = null; SyntaxSchemeLoader parser = null;
try { try {
XMLReader reader = XMLReaderFactory.createXMLReader(); XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
parser = new SyntaxSchemeLoader(baseFont); parser = new SyntaxSchemeLoader(baseFont);
parser.baseFont = baseFont; parser.baseFont = baseFont;
reader.setContentHandler(parser); reader.setContentHandler(parser);

9
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rsyntaxtextarea/Theme.java

@ -22,6 +22,7 @@ import java.lang.reflect.Field;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.ColorUIResource; import javax.swing.plaf.ColorUIResource;
import javax.swing.text.StyleContext; import javax.swing.text.StyleContext;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParser;
@ -493,6 +494,8 @@ public class Theme {
StreamResult result = new StreamResult(new PrintWriter( StreamResult result = new StreamResult(new PrintWriter(
new UnicodeWriter(bout, "UTF-8"))); new UnicodeWriter(bout, "UTF-8")));
TransformerFactory transFac = TransformerFactory.newInstance(); TransformerFactory transFac = TransformerFactory.newInstance();
transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Transformer transformer = transFac.newTransformer(); Transformer transformer = transFac.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4"); transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
@ -580,8 +583,12 @@ public class Theme {
public static void load(Theme theme, InputStream in) throws IOException { public static void load(Theme theme, InputStream in) throws IOException {
SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(true);
try { try {
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
spf.setValidating(true);
SAXParser parser = spf.newSAXParser(); SAXParser parser = spf.newSAXParser();
XMLReader reader = parser.getXMLReader(); XMLReader reader = parser.getXMLReader();
XmlHandler handler = new XmlHandler(); XmlHandler handler = new XmlHandler();

8
designer-base/src/main/java/com/fr/design/gui/syntax/ui/rtextarea/Macro.java

@ -14,6 +14,7 @@ import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.xml.XMLConstants;
import javax.xml.parsers.*; import javax.xml.parsers.*;
import javax.xml.transform.*; import javax.xml.transform.*;
import javax.xml.transform.dom.*; import javax.xml.transform.dom.*;
@ -94,6 +95,11 @@ public class Macro {
DocumentBuilder db = null; DocumentBuilder db = null;
Document doc = null; Document doc = null;
try { try {
dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
dbf.setFeature("http://xml.org/sax/features/external-general-entities", false);
dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
dbf.setXIncludeAware(false);
db = dbf.newDocumentBuilder(); db = dbf.newDocumentBuilder();
//InputSource is = new InputSource(new FileReader(file)); //InputSource is = new InputSource(new FileReader(file));
InputSource is = new InputSource(new UnicodeReader( InputSource is = new InputSource(new UnicodeReader(
@ -374,6 +380,8 @@ public class Macro {
StreamResult result = new StreamResult(new File(fileName)); StreamResult result = new StreamResult(new File(fileName));
DOMSource source = new DOMSource(doc); DOMSource source = new DOMSource(doc);
TransformerFactory transFac = TransformerFactory.newInstance(); TransformerFactory transFac = TransformerFactory.newInstance();
transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, "");
transFac.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "");
Transformer transformer = transFac.newTransformer(); Transformer transformer = transFac.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.ENCODING, FILE_ENCODING); transformer.setOutputProperty(OutputKeys.ENCODING, FILE_ENCODING);

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]));
}
}

32
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -598,8 +598,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}); });
// 重名提示 // 重名提示
warnLabel = new UILabel(); warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30)); warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT); warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED); warnLabel.setForeground(Color.RED);
warnLabel.setVisible(false); warnLabel.setVisible(false);
@ -609,7 +610,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
// 确认按钮 // 确认按钮
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -619,7 +619,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
// 取消按钮 // 取消按钮
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
cancelButton.setPreferredSize(new Dimension(60, 25));
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@ -629,25 +628,26 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
}); });
JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15)); JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0));
bottomPanel.add(confirmButton); buttonsPane.setBorder(BorderFactory.createEmptyBorder(10, 15, 10, 10));
bottomPanel.add(cancelButton); buttonsPane.add(confirmButton);
buttonsPane.add(cancelButton);
this.add( this.add(
TableLayoutHelper.createTableLayoutPane( TableLayoutHelper.createTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{topPanel}, new Component[]{topPanel},
new Component[]{midPanel}, new Component[]{midPanel},
new Component[]{bottomPanel} new Component[]{buttonsPane}
}, },
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL} new double[]{TableLayout.FILL}
), ),
BorderLayout.CENTER); BorderLayout.CENTER);
this.setSize(340, 180); this.setSize(340, 200);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename")); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Rename"));
this.setResizable(false); this.setResizable(false);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);
@ -760,7 +760,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
); );
newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
newNameLabel.setPreferredSize(new Dimension(118, 15));
// 文件名输入框 // 文件名输入框
nameField = new UITextField(); nameField = new UITextField();
@ -804,8 +803,9 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}); });
// 重名提示 // 重名提示
warnLabel = new UILabel(); warnLabel = new UILabel();
warnLabel.setPreferredSize(new Dimension(300, 30)); warnLabel.setPreferredSize(new Dimension(300, 50));
warnLabel.setHorizontalAlignment(SwingConstants.LEFT); warnLabel.setHorizontalAlignment(SwingConstants.LEFT);
warnLabel.setVerticalAlignment(SwingConstants.TOP);
warnLabel.setForeground(Color.RED); warnLabel.setForeground(Color.RED);
warnLabel.setVisible(false); warnLabel.setVisible(false);
@ -836,8 +836,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
}); });
JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0));
bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15)); bottomPanel.setBorder(BorderFactory.createEmptyBorder(10, 15, 10, 10));
bottomPanel.add(confirmButton); bottomPanel.add(confirmButton);
bottomPanel.add(cancelButton); bottomPanel.add(cancelButton);
@ -848,13 +848,13 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
new Component[]{midPanel}, new Component[]{midPanel},
new Component[]{bottomPanel} new Component[]{bottomPanel}
}, },
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, new double[]{TableLayout.FILL, TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.FILL} new double[]{TableLayout.FILL}
), ),
BorderLayout.CENTER); BorderLayout.CENTER);
this.setSize(380, 180); this.setSize(380, 200);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir")); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Mkdir"));
this.setResizable(false); this.setResizable(false);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);

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

@ -9,17 +9,7 @@ import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.BBSAction; import com.fr.design.actions.community.*;
import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.BugNeedAction;
import com.fr.design.actions.community.CenterAction;
import com.fr.design.actions.community.FacebookFansAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.TechSolutionAction;
import com.fr.design.actions.community.TechSupportAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction; import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction; import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef; import com.fr.design.actions.file.OpenRecentReportMenuDef;
@ -41,6 +31,7 @@ import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.OemProcessor; import com.fr.design.fun.OemProcessor;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.fun.TableDataPaneProcessor; import com.fr.design.fun.TableDataPaneProcessor;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -72,6 +63,7 @@ import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType; import com.fr.plugin.observer.PluginEventType;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.ObjectHolder;
import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.os.support.OSSupportCenter;
import com.fr.start.OemHandler; import com.fr.start.OemHandler;
@ -487,11 +479,7 @@ public abstract class ToolBarMenuDock {
} }
if (!DesignerMode.isAuthorityEditing()) { if (!DesignerMode.isAuthorityEditing()) {
if (shouldShowPlugin()) { addPluginManagerAction(menuDef);
menuDef.addShortCut(
new PluginManagerAction()
);
}
menuDef.addShortCut( menuDef.addShortCut(
new FunctionManagerAction(), new FunctionManagerAction(),
new GlobalParameterAction() new GlobalParameterAction()
@ -502,6 +490,23 @@ public abstract class ToolBarMenuDock {
return menuDef; 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() { private ShortCut createGlobalTDAction() {
TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG); TableDataPaneProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TableDataPaneProcessor.XML_TAG);
return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction(); return processor == null ? new GlobalTableDataAction() : processor.createServerTDAction();
@ -610,7 +615,7 @@ public abstract class ToolBarMenuDock {
}, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY); }, SupportLocaleImpl.TECH_SUPPORT_COMMUNITY);
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new WorkOrderCenterAction());
shortCuts.add(new CenterAction()); shortCuts.add(new CenterAction());
shortCuts.add(new SignAction()); shortCuts.add(new SignAction());
LocaleCenter.buildAction(new LocaleAction() { LocaleCenter.buildAction(new LocaleAction() {

4
designer-base/src/main/java/com/fr/design/os/impl/PMDialogAction.java

@ -19,11 +19,11 @@ public class PMDialogAction implements OSBasedAction {
private static String PLUGIN_MANAGER_ROUTE = "#management/plugin"; private static String PLUGIN_MANAGER_ROUTE = "#management/plugin";
@Override @Override
public void execute(Object... objects) { public void execute(Object... objects) {
if(Arch.getArch() == Arch.ARM || OperatingSystem.isLinux()){ if(Arch.getArch() == Arch.ARM || OperatingSystem.isLinux() || SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT.support()){
DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null); DesignUtils.visitEnvServerByParameters( PLUGIN_MANAGER_ROUTE,null,null);
return; return;
} }
if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() && JdkVersion.LE_8.support()) { if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() || SupportOSImpl.MACOS_NEW_PLUGIN_MANAGEMENT.support()) {
UpmFinder.showUPMDialog(); UpmFinder.showUPMDialog();
} else { } else {
WebViewDlgHelper.createPluginDialog(); WebViewDlgHelper.createPluginDialog();

28
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -1,6 +1,7 @@
package com.fr.design.os.impl; package com.fr.design.os.impl;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.jdk.JdkVersion;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.json.JSON; import com.fr.json.JSON;
@ -124,6 +125,33 @@ public enum SupportOSImpl implements SupportOS {
public boolean support() { public boolean support() {
return OperatingSystem.isWindows(); return OperatingSystem.isWindows();
} }
},
MACOS_NEW_PLUGIN_MANAGEMENT {
@Override
public boolean support() {
return JdkVersion.GE_9.support() && OperatingSystem.isMacos() && getMacOsVersion() < BIG_SUR_VERSION_NUMBER;
}
},
MACOS_WEB_PLUGIN_MANAGEMENT {
@Override
public boolean support() {
return JdkVersion.GE_9.support() && OperatingSystem.isMacos() && getMacOsVersion() >= BIG_SUR_VERSION_NUMBER;
}
};
private static final int BIG_SUR_VERSION_NUMBER = 16;
protected int getMacOsVersion() {
String version = System.getProperty("os.version");
String[] versionSlice = version.split("\\.");
try {
return Integer.parseInt(versionSlice[1]);
} catch (Exception ignored) {
return 0;
}
} }
} }

21
designer-base/src/main/java/com/fr/design/plugin/DesignerPluginContext.java

@ -0,0 +1,21 @@
package com.fr.design.plugin;
import com.fr.design.dialog.UIDialog;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/3/8
*/
public class DesignerPluginContext {
private static UIDialog DIALOG;
public static UIDialog getPluginDialog() {
return DIALOG;
}
public static void setPluginDialog(UIDialog pluginDialog) {
DesignerPluginContext.DIALOG = pluginDialog;
}
}

11
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -3,6 +3,7 @@ package com.fr.design.ui;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserContext; import com.teamdev.jxbrowser.chromium.BrowserContext;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.ProtocolService; import com.teamdev.jxbrowser.chromium.ProtocolService;
import com.teamdev.jxbrowser.chromium.URLResponse; import com.teamdev.jxbrowser.chromium.URLResponse;
@ -12,6 +13,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
/** /**
* @author richie * @author richie
@ -20,6 +23,14 @@ import java.nio.file.Path;
*/ */
public class Assistant { public class Assistant {
public static void addChromiumSwitches(String... switches) {
List<String> list = BrowserPreferences.getChromiumSwitches();
Collections.addAll(list, switches);
BrowserPreferences.setChromiumSwitches((list.toArray(new String[0])));
}
public static URLResponse inputStream2Response(InputStream inputStream, String filePath) throws Exception { public static URLResponse inputStream2Response(InputStream inputStream, String filePath) throws Exception {
URLResponse response = new URLResponse(); URLResponse response = new URLResponse();
DataInputStream stream = new DataInputStream(inputStream); DataInputStream stream = new DataInputStream(inputStream);

14
designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java

@ -8,18 +8,18 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.web.struct.AssembleComponent; import com.fr.web.struct.AssembleComponent;
import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.Browser;
import com.teamdev.jxbrowser.chromium.BrowserPreferences;
import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent;
import com.teamdev.jxbrowser.chromium.events.LoadAdapter;
import com.teamdev.jxbrowser.chromium.events.LoadListener; import com.teamdev.jxbrowser.chromium.events.LoadListener;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import com.teamdev.jxbrowser.chromium.events.ScriptContextListener; import com.teamdev.jxbrowser.chromium.events.ScriptContextListener;
import com.teamdev.jxbrowser.chromium.swing.BrowserView; import com.teamdev.jxbrowser.chromium.swing.BrowserView;
import javax.swing.*; import javax.swing.JDialog;
import java.awt.*; import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Map; import java.util.Map;
@ -44,7 +44,7 @@ public class ModernUIPane<T> extends BasicPane {
private void initialize() { private void initialize() {
if (browser == null) { if (browser == null) {
setLayout(new BorderLayout()); setLayout(new BorderLayout());
BrowserPreferences.setChromiumSwitches("--disable-google-traffic"); Assistant.addChromiumSwitches("--disable-google-traffic");
if (DesignerEnvManager.getEnvManager().isOpenDebug()) { if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
UIToolbar toolbar = new UIToolbar(); UIToolbar toolbar = new UIToolbar();
add(toolbar, BorderLayout.NORTH); add(toolbar, BorderLayout.NORTH);
@ -75,7 +75,7 @@ public class ModernUIPane<T> extends BasicPane {
SwingUtilities.getWindowAncestor(ModernUIPane.this).setVisible(false); SwingUtilities.getWindowAncestor(ModernUIPane.this).setVisible(false);
} }
}); });
BrowserPreferences.setChromiumSwitches("--remote-debugging-port=9222"); Assistant.addChromiumSwitches("--remote-debugging-port=9222");
initializeBrowser(); initializeBrowser();
add(new BrowserView(browser), BorderLayout.CENTER); add(new BrowserView(browser), BorderLayout.CENTER);
} else { } else {

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

@ -6,6 +6,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.update.ui.dialog.UpdateMainDialog; import com.fr.design.update.ui.dialog.UpdateMainDialog;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
@ -114,6 +115,7 @@ public class UpmFinder {
dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
dialog.setVisible(false); dialog.setVisible(false);
dialog = null; dialog = null;
DesignerPluginContext.setPluginDialog(null);
} }
} }
} }

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

@ -2,6 +2,7 @@ package com.fr.design.upm;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
import com.fr.design.plugin.DesignerPluginContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*; import javax.swing.*;
@ -25,6 +26,7 @@ public class UpmShowDialog extends UIDialog {
setSize(DEFAULT_SHOP); setSize(DEFAULT_SHOP);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
setResizable(false); setResizable(false);
DesignerPluginContext.setPluginDialog(this);
} }
@Override @Override

10
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -38,6 +38,7 @@ import com.fr.stable.Constants;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.awt.Container;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -318,7 +319,14 @@ public final class GUICoreUtils {
public static void centerWindow(Window win) { public static void centerWindow(Window win) {
// Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小 // Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小
// getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标 // getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标
Rectangle rectangle = win.getGraphicsConfiguration().getBounds(); Rectangle rectangle;
Container parent = win.getParent();
boolean displayByDesignerFrame = (DesignerContext.getDesignerFrame() != null && parent == null) || (parent != null && !parent.isVisible() && DesignerContext.getDesignerFrame() != null);
if (displayByDesignerFrame) {
rectangle = DesignerContext.getDesignerFrame().getGraphicsConfiguration().getBounds();
} else {
rectangle = win.getGraphicsConfiguration().getBounds();
}
centerWindow(win, rectangle); centerWindow(win, rectangle);
} }

6
designer-base/src/main/java/com/fr/design/utils/gui/GUIPaintUtils.java

@ -1,6 +1,5 @@
package com.fr.design.utils.gui; package com.fr.design.utils.gui;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -40,7 +39,10 @@ public class GUIPaintUtils {
g2d.drawLine(x, y, x, height - 1); g2d.drawLine(x, y, x, height - 1);
g2d.drawLine(x, height - 1, x + 3, height - 1); g2d.drawLine(x, height - 1, x + 3, height - 1);
} else { } else {
g2d.drawRoundRect(x, y, width - 1, height - 1, UIConstants.ARC, UIConstants.ARC); double offsetX = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX() - 1, 0.5d);
double offsetY = Math.min(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleY() - 1, 0.5d);
Shape shape = new RoundRectangle2D.Double(x + offsetX, y + offsetY, width - 1d, height - 1d, UIConstants.ARC, UIConstants.ARC);
g2d.draw(shape);
} }
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
} else { } else {

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

@ -1,12 +1,16 @@
package com.fr.env; 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.actions.server.PluginManagerAction;
import com.fr.design.fun.PluginManagerProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.bridge.ObjectHolder;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -23,6 +27,7 @@ import java.awt.Frame;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; 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")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With"));
cancelButton.addActionListener(this); cancelButton.addActionListener(this);
okButton.addActionListener(new PluginManagerActionAdapter(this)); okButton.addActionListener(new PluginManagerHandleAction(this));
// 按钮 // 按钮
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
@ -102,18 +107,34 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener {
this.dispose(); this.dispose();
} }
private static class PluginManagerActionAdapter extends PluginManagerAction { private static class PluginManagerHandleAction extends UpdateAction {
private JDialog jDialog; private JDialog jDialog;
private UpdateAction pluginManagerAction;
public PluginManagerActionAdapter(JDialog jDialog) { public PluginManagerHandleAction(JDialog jDialog) {
this.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 @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
this.jDialog.dispose(); this.jDialog.dispose();
super.actionPerformed(e); this.pluginManagerAction.actionPerformed(e);
} }
} }

5
designer-base/src/main/java/com/fr/start/server/FineEmbedServerActivator.java

@ -12,6 +12,7 @@ import com.fr.third.springframework.web.context.support.AnnotationConfigWebAppli
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import org.apache.catalina.Context; import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException; import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
import org.apache.catalina.loader.WebappLoader; import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.startup.Tomcat; import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.webresources.StandardRoot; import org.apache.catalina.webresources.StandardRoot;
@ -73,6 +74,10 @@ public class FineEmbedServerActivator extends Activator {
String contextPath = "/" + ProductConstants.getAppFolderName(); String contextPath = "/" + ProductConstants.getAppFolderName();
final Context context = tomcat.addContext(contextPath, docBase); final Context context = tomcat.addContext(contextPath, docBase);
context.setResources(new StandardRoot(context)); context.setResources(new StandardRoot(context));
Wrapper servlet = Tomcat.addServlet(context, "DruidStatView", "com.fr.third.alibaba.druid.support.http.StatViewServlet");
context.addServletMappingDecoded("/druid/*", "DruidStatView");
servlet.setLoadOnStartup(1);
servlet.setOverridable(true);
Tomcat.initWebappDefaults(context); Tomcat.initWebappDefaults(context);
//覆盖tomcat的WebAppClassLoader //覆盖tomcat的WebAppClassLoader
context.setLoader(new FRTomcatLoader()); context.setLoader(new FRTomcatLoader());

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

BIN
designer-base/src/main/resources/com/fr/design/images/bbs/workOrderCenter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

7
designer-base/src/main/resources/com/fr/design/images/bbs/workOrderCenter_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="M14,1 L14,10.999 L10,15 L2,15 L2,1 L14,1 Z M13.001,2 L3,2 L3,14 L9.0002,14 L9.0002,9.9998 L13.001,9.9998 L13.001,2 Z M12.5862,10.9998 L10.0002,10.9998 L10.0002,13.5858 L12.5862,10.9998 Z M7,10 L7,11 L5,11 L5,10 L7,10 Z M11,7 L11,8 L5,8 L5,7 L11,7 Z M11,4 L11,5 L5,5 L5,4 L11,4 Z" id="形状结合" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 696 B

0
designer-base/src/main/resources/com/fr/design/images/control/edit_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/edit_disabled.svg

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 864 B

0
designer-base/src/main/resources/com/fr/design/images/control/remove_disable.svg → designer-base/src/main/resources/com/fr/design/images/control/remove_disabled.svg

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

0
designer-base/src/main/resources/com/fr/design/images/m_file/preview_disable.svg → designer-base/src/main/resources/com/fr/design/images/m_file/preview_disabled.svg

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 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);
}
}

10
designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java

@ -6,6 +6,7 @@ import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
import java.util.Locale; import java.util.Locale;
import org.powermock.reflect.Whitebox;
/** /**
* @author hades * @author hades
@ -21,4 +22,13 @@ public class SupportOSImplTest extends TestCase {
Assert.assertFalse(SupportOSImpl.AUTOPUSHUPDATE.support()); Assert.assertFalse(SupportOSImpl.AUTOPUSHUPDATE.support());
} }
@Test
public void testGetMacOsVersion() throws Exception {
String backUp = System.getProperty("os.version");
System.setProperty("os.version", "10.16");
int number = Whitebox.invokeMethod(SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT, "getMacOsVersion");
Assert.assertEquals(16, number);
System.setProperty("os.version", backUp);
}
} }

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -221,12 +221,9 @@ public class GisLayerPane extends JPanel implements UIObserver {
/* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO); /* mapPlot.getGisLayer().setGisLayerType(GISLayerType.AUTO);
mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/ mapPlot.getGisLayer().setLayerName(GISLayerType.getLocString(GISLayerType.AUTO));*/
GaoDeGisType gaoDeGisType= mapPlot.getDefaultGisLayerType(); GisLayer defaultGisLayer = mapPlot.getDefaultGisLayer();
mapPlot.setGisLayer(defaultGisLayer);
mapPlot.getGisLayer().setGisLayerType(GISLayerType.GAO_DE_API); populate(defaultGisLayer);
mapPlot.getGisLayer().setLayerName(gaoDeGisType.getTypeName());
mapPlot.getGisLayer().setGaoDeGisType(gaoDeGisType);
populate(mapPlot.getGisLayer());
} }
public void populate(GisLayer layer) { public void populate(GisLayer layer) {

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -74,10 +74,10 @@
}], }],
layouts: [{ layouts: [{
type: "bi.left", type: "bi.left",
rgap: 5 rgap: 2
}], }],
value: this.model.mode, value: this.model.mode,
width: 125 width: 170
}, this._getToolBar()], }, this._getToolBar()],
height: 24 height: 24
}, { }, {

4
designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js

@ -18,7 +18,7 @@
return [{ return [{
type: "bi.single_select_radio_item", type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Auto"), text: BI.i18nText("BI-Basic_Auto"),
width: 50, width: 70,
logic: { logic: {
dynamic: true dynamic: true
}, },
@ -27,7 +27,7 @@
}, { }, {
type: "bi.single_select_radio_item", type: "bi.single_select_radio_item",
text: BI.i18nText("BI-Basic_Custom"), text: BI.i18nText("BI-Basic_Custom"),
width: 60, width: 80,
logic: { logic: {
dynamic: true dynamic: true
}, },

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 810 B

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 905 B

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 819 B

BIN
designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

4
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -694,8 +694,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query")); formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query"));
XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton); XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION if (this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION
+ V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE))) {
currentIndex = ((int) Math.ceil((currentIndex + 1) / (double) NUM_IN_A_LINE)) * NUM_IN_A_LINE; currentIndex = ((int) Math.ceil((currentIndex + 1) / (double) NUM_IN_A_LINE)) * NUM_IN_A_LINE;
} }
} }

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java

@ -31,6 +31,8 @@ public abstract class AbstractFRLayoutDefinePane<T extends WSortLayout> extends
for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) { for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) {
destLayout.addListener(srcLayout.getListener(i)); destLayout.addListener(srcLayout.getListener(i));
} }
srcLayout.clearListeners();
srcLayout.clearMobileWidgetList();
} }
} }

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -207,7 +207,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
} }
xwAbsoluteBodyLayout.add(component); xwAbsoluteBodyLayout.add(component);
} }
copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout); copyLayoutAttr(wFitLayout, xwAbsoluteBodyLayout.toData());
xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); xWFitLayout.setBackupParent(xwAbsoluteBodyLayout);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe.cell.settingpane;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.mainframe.cell.settingpane.style.StylePane;
import com.fr.design.style.BorderUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
@ -67,6 +68,7 @@ public class CellStylePane extends AbstractCellAttrPane {
@Override @Override
public void updateBeans() { public void updateBeans() {
Object[] selectionCellBorderObjects = BorderUtils.createCellBorderObject(elementCasePane);
if (stylePane.getSelectedIndex() == 1) { if (stylePane.getSelectedIndex() == 1) {
Style s = stylePane.updateBean(); Style s = stylePane.updateBean();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
@ -110,7 +112,8 @@ public class CellStylePane extends AbstractCellAttrPane {
} }
} }
} }
stylePane.updateBorder();// border必须特别处理 // border必须特别处理
stylePane.updateBorder(selectionCellBorderObjects);
} }
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java

@ -136,8 +136,8 @@ public class CustomStylePane extends MultiTabPane<Style> {
/** /**
* *
*/ */
public void updateBorder() { public void updateBorder(Object[] selectionCellBorderObjects) {
BorderUtils.update(reportPane, ((BorderPane) paneList.get(ONE_INDEX)).update()); BorderUtils.update(reportPane, selectionCellBorderObjects, ((BorderPane) paneList.get(ONE_INDEX)).update());
} }
/** /**

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/style/StylePane.java

@ -38,10 +38,9 @@ public class StylePane extends UIComboBoxPane<Style> {
customStylePane.addTabChangeListener(changeListener); customStylePane.addTabChangeListener(changeListener);
} }
public void updateBorder(Object[] selectionCellBorderObjects) {
public void updateBorder() {
if (getSelectedIndex() == 0 && customStylePane.isBorderPaneSelected()) { if (getSelectedIndex() == 0 && customStylePane.isBorderPaneSelected()) {
customStylePane.updateBorder(); customStylePane.updateBorder(selectionCellBorderObjects);
} }
} }

3
designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/solid/SolidCollector.java

@ -40,9 +40,6 @@ public class SolidCollector {
* 回传文件给云中心并删除服务端本地文件 * 回传文件给云中心并删除服务端本地文件
*/ */
public void sendToCloudCenterAndDeleteFile() { public void sendToCloudCenterAndDeleteFile() {
if (WorkContext.getCurrent().isLocal()) {
return;
}
String url = CloudCenter.getInstance().acquireConf("design.solid", "https://cloud.fanruan.com/api/solid/upload"); String url = CloudCenter.getInstance().acquireConf("design.solid", "https://cloud.fanruan.com/api/solid/upload");
if (StringUtils.isEmpty(url)) { if (StringUtils.isEmpty(url)) {
FineLoggerFactory.getLogger().info("failed to get solid content upload url..."); FineLoggerFactory.getLogger().info("failed to get solid content upload url...");

23
designer-realize/src/main/java/com/fr/design/style/BorderUtils.java

@ -464,8 +464,13 @@ public abstract class BorderUtils {
* changed, need to support undo/redo * changed, need to support undo/redo
*/ */
public static boolean update(ElementCasePane reportPane, CellBorderStyle newCellBorderStyle) { public static boolean update(ElementCasePane reportPane, CellBorderStyle newCellBorderStyle) {
Object[] selectionCellBorderObjects = createCellBorderObject(reportPane);
return update(reportPane, selectionCellBorderObjects, newCellBorderStyle);
}
public static boolean update(ElementCasePane reportPane, Object[] selectionCellBorderObjects, CellBorderStyle newCellBorderStyle) {
boolean isBorderColorStyleChanged = false; boolean isBorderColorStyleChanged = false;
Object[] fourObjectArray = createCellBorderObject(reportPane); Object[] fourObjectArray = selectionCellBorderObjects;
if (fourObjectArray == null || fourObjectArray.length < NUMBER) { if (fourObjectArray == null || fourObjectArray.length < NUMBER) {
return false; return false;
} }
@ -526,44 +531,60 @@ public abstract class BorderUtils {
if (cellBorderStyle.getLeftStyle() != newCellBorderStyle.getLeftStyle() if (cellBorderStyle.getLeftStyle() != newCellBorderStyle.getLeftStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getLeftColor(), newCellBorderStyle.getLeftColor())) { || !ComparatorUtils.equals(cellBorderStyle.getLeftColor(), newCellBorderStyle.getLeftColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getLeftStyle(), newCellBorderStyle.getLeftColor()); style = style.deriveBorderLeft(newCellBorderStyle.getLeftStyle(), newCellBorderStyle.getLeftColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor());
} }
} else { } else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle() if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) { || !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderLeft(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor()); style = style.deriveBorderLeft(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderLeft(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
} }
} }
if (tmpCellElement.getColumn() + tmpCellElement.getColumnSpan() == column + columnSpan) { if (tmpCellElement.getColumn() + tmpCellElement.getColumnSpan() == column + columnSpan) {
if (cellBorderStyle.getRightStyle() != newCellBorderStyle.getRightStyle() if (cellBorderStyle.getRightStyle() != newCellBorderStyle.getRightStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getRightColor(), newCellBorderStyle.getRightColor())) { || !ComparatorUtils.equals(cellBorderStyle.getRightColor(), newCellBorderStyle.getRightColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getRightStyle(), newCellBorderStyle.getRightColor()); style = style.deriveBorderRight(newCellBorderStyle.getRightStyle(), newCellBorderStyle.getRightColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor());
} }
} else { } else {
if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle() if (cellBorderStyle.getVerticalStyle() != newCellBorderStyle.getVerticalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) { || !ComparatorUtils.equals(cellBorderStyle.getVerticalColor(), newCellBorderStyle.getVerticalColor())) {
style = style.deriveBorderRight(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor()); style = style.deriveBorderRight(newCellBorderStyle.getVerticalStyle(), newCellBorderStyle.getVerticalColor());
} else {
style = style.deriveBorderRight(cellBorderStyle.getVerticalStyle(), cellBorderStyle.getVerticalColor());
} }
} }
if (tmpCellElement.getRow() == row) { if (tmpCellElement.getRow() == row) {
if (cellBorderStyle.getTopStyle() != newCellBorderStyle.getTopStyle() if (cellBorderStyle.getTopStyle() != newCellBorderStyle.getTopStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getTopColor(), newCellBorderStyle.getTopColor())) { || !ComparatorUtils.equals(cellBorderStyle.getTopColor(), newCellBorderStyle.getTopColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getTopStyle(), newCellBorderStyle.getTopColor()); style = style.deriveBorderTop(newCellBorderStyle.getTopStyle(), newCellBorderStyle.getTopColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor());
} }
} else { } else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle() if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) { || !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderTop(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor()); style = style.deriveBorderTop(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderTop(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
} }
} }
if (tmpCellElement.getRow() + tmpCellElement.getRowSpan() == row + rowSpan) { if (tmpCellElement.getRow() + tmpCellElement.getRowSpan() == row + rowSpan) {
if (cellBorderStyle.getBottomStyle() != newCellBorderStyle.getBottomStyle() if (cellBorderStyle.getBottomStyle() != newCellBorderStyle.getBottomStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getBottomColor(), newCellBorderStyle.getBottomColor())) { || !ComparatorUtils.equals(cellBorderStyle.getBottomColor(), newCellBorderStyle.getBottomColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getBottomStyle(), newCellBorderStyle.getBottomColor()); style = style.deriveBorderBottom(newCellBorderStyle.getBottomStyle(), newCellBorderStyle.getBottomColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor());
} }
} else { } else {
if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle() if (cellBorderStyle.getHorizontalStyle() != newCellBorderStyle.getHorizontalStyle()
|| !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) { || !ComparatorUtils.equals(cellBorderStyle.getHorizontalColor(), newCellBorderStyle.getHorizontalColor())) {
style = style.deriveBorderBottom(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor()); style = style.deriveBorderBottom(newCellBorderStyle.getHorizontalStyle(), newCellBorderStyle.getHorizontalColor());
} else {
style = style.deriveBorderBottom(cellBorderStyle.getHorizontalStyle(), cellBorderStyle.getHorizontalColor());
} }
} }
return style; return style;

Loading…
Cancel
Save