Browse Source

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

* commit 'dc801317d73124a3702c71d093830bf205c5c64c': (54 commits)
  REPORT-44803 清除下之前关闭的pr中的已改动文件
  REPORT-44803 参数面板拖动组件大小右侧不能跟随显示大小--来源【客户需求 508884】 【问题原因】之前的frm缩放的改动——REPORT-37353,把当前的像素值给设置成了组件的x、y值,这样当拖动组件改变大小的时候,x、y不变,右侧也不会变动,因为没有加上组件宽高 【改动思路】为x、y加上当前组件的宽高值
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.15: 修改打印日志语句,将中文去掉,改成英文
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.14: ①vito建议中的前三点功能其实已经实现了,只是没用一个类似Manager的方式写出来,对这种不是很熟,听vito说要配齐一大套,而这次任务已经是超时了,所以放在下次迭代任务中与缓存一起做;②将几乎所有已经改成svg的图标,传入方式统一为传入url;③补充了test
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.14: 将SVGIconUtils的名字修改为IconUtils
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.13: 上传下因为之前代码冲突丢失的代码
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.12: 删除误传代码
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.11: 替换了菜单栏-帮助和菜单栏-社区的图标
  REPORT-45460 帆软市场国际化标签设计器适配
  REPORT-44644 设计器接口开放 fix实现层级
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 No.10: ①根据开发评审意见,新增SVGIconUtils工具类,之后读取图标都可以用工具类中的方法;②修改UpdateAction、MenuDef、UIButton适配工具类方法;③修改之前上传的图标读取方式以及一些初始化方式;④替换了菜单栏-单元格中的所有子项的图标
  REPORT-44644 fix无用import
  REPORT-44644 设计器接口开发 fix
  REPORT-44644 添加判断是否存在接口
  REPORT-44644 fix调整名称
  REPORT-40684 绘制表格辅助线时提前适配合并单元格,去除合并之后使用背景覆盖辅助线的方式
  REPORT-44644 设计器接口开放
  REPORT-44644 设计器接口开放
  标记点兼容
  REPORT-43744 【10.0.13】插件与jar包不匹配问题优化
  ...
research/11.0
Qinghui.Liu 4 years ago
parent
commit
122f54edfb
  1. 105
      designer-base/src/main/java/com/fr/base/svg/IconUtils.java
  2. 82
      designer-base/src/main/java/com/fr/base/svg/SVGIcon.java
  3. 92
      designer-base/src/main/java/com/fr/base/svg/SVGLoader.java
  4. 181
      designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java
  5. 96
      designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java
  6. 19
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  7. 4
      designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java
  8. 4
      designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java
  9. 5
      designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java
  10. 54
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  11. 4
      designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java
  12. 5
      designer-base/src/main/java/com/fr/design/actions/community/BugAction.java
  13. 4
      designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java
  14. 4
      designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java
  15. 5
      designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java
  16. 4
      designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java
  17. 4
      designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java
  18. 5
      designer-base/src/main/java/com/fr/design/actions/community/SignAction.java
  19. 4
      designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java
  20. 5
      designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java
  21. 3
      designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java
  22. 3
      designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java
  23. 3
      designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java
  24. 3
      designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java
  25. 3
      designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java
  26. 4
      designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java
  27. 4
      designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java
  28. 3
      designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java
  29. 8
      designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java
  30. 4
      designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java
  31. 4
      designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java
  32. 4
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java
  33. 4
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  34. 4
      designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java
  35. 4
      designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java
  36. 4
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  37. 4
      designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java
  38. 4
      designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java
  39. 2
      designer-base/src/main/java/com/fr/design/constants/UIConstants.java
  40. 4
      designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java
  41. 5
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java
  42. 2
      designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java
  43. 50
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  44. 1
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  45. 11
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  46. 32
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  47. 27
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java
  48. 14
      designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java
  49. 27
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java
  50. 37
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java
  51. 12
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java
  52. 3
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  53. 4
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  54. 71
      designer-base/src/main/java/com/fr/design/file/TemplateResource.java
  55. 66
      designer-base/src/main/java/com/fr/design/file/TemplateResourceManager.java
  56. 21
      designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java
  57. 19
      designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java
  58. 52
      designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java
  59. 34
      designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java
  60. 19
      designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java
  61. 23
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java
  62. 24
      designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java
  63. 31
      designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java
  64. 6
      designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java
  65. 9
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java
  66. 7
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  67. 2
      designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java
  68. 14
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  69. 20
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  70. 25
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  71. 19
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java
  72. 3
      designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java
  73. 1
      designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java
  74. 6
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java
  75. 4
      designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java
  76. 4
      designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java
  77. 2
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  78. 5
      designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java
  79. 4
      designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java
  80. 37
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  81. 2
      designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java
  82. 108
      designer-base/src/main/java/com/fr/env/PluginErrorRemindDialog.java
  83. 18
      designer-base/src/main/java/com/fr/file/FileNodeFILE.java
  84. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png
  85. 8
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg
  86. 8
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg
  87. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png
  88. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg
  89. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png
  90. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg
  91. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg
  92. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png
  93. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg
  94. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg
  95. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png
  96. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg
  97. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg
  98. BIN
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png
  99. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg
  100. 7
      designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg
  101. Some files were not shown because too many files have changed in this diff Show More

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

@ -0,0 +1,105 @@
package com.fr.base.svg;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
/**
* 主要是用来读取svgIcon的工具类
* @author Yvan
* @version 10.0
* Created by Yvan on 2020/12/23
*/
public class IconUtils {
private static final String ICON_SUFFIX_SVG = ".svg";
private static final String ICON_SUFFIX_PNG = ".png";
private static final String ICON_SUFFIX_GIF = ".gif";
private static final String SUFFIX_SEPARATOR = ".";
public static final String ICON_TYPE_NORMAL= "_normal.svg";
public static final String ICON_TYPE_DISABLED= "_disabled.svg";
public static final String ICON_TYPE_PRESSED= "_pressed.svg";
/**
* 可以读取SVG图标或者普通图标并且可以读取不带扩展名的文件
* 不带扩展名时以svg优先其次png最后gif
* @param resource 图片路径
* @return 图标
*/
public static Icon readIcon(String resource) {
// 判断是否有.XXX文件后缀
if (resource.contains(SUFFIX_SEPARATOR)) {
// 判断是否以.svg结尾
if (resource.endsWith(ICON_SUFFIX_SVG)) {
return SVGIcon.readSVGIcon(resource);
}
return IOUtils.readIcon(resource);
}
// 文件无后缀时
return readNoSuffixResource(resource, ICON_TYPE_NORMAL);
}
/**
* 尝试读取不带扩展名的图标svg优先其次png最后gif都没读到就打印错误日志返回空白Icon
* @param resource 图片路径
* @param svgIconType 针对svg来说的图标类型
* 取值为ICON_TYPE_NORMALICON_TYPE_DISABLEDICON_TYPE_PRESSED
* @return 图标
*/
private static Icon readNoSuffixResource(String resource, String svgIconType) {
String svgPath = resource + svgIconType;
if (IOUtils.readResource(svgPath) != null) {
return SVGIcon.readSVGIcon(svgPath);
}
String pngPath = resource + ICON_SUFFIX_PNG;
if (IOUtils.readResource(pngPath) != null) {
return IOUtils.readIcon(pngPath);
}
String gifPath = resource + ICON_SUFFIX_GIF;
if (IOUtils.readResource(gifPath) != null) {
return IOUtils.readIcon(gifPath);
}
FineLoggerFactory.getLogger().error("File not exists:{}", resource);
return new ImageIcon();
}
/**
* 读取指定类型的svgIcon
* @param resource
* @param svgIconType
* @return
*/
public static Icon readSVGIcon(String resource, String svgIconType) {
// 判断下是否有后缀
if (!resource.contains(SUFFIX_SEPARATOR)) {
return readNoSuffixResource(resource, svgIconType);
}
// 如果是".png"后缀,就替换为传入的svgIconType,然后读取图标
if (resource.endsWith(ICON_SUFFIX_PNG)) {
return readSpecifiedTypeIcon(resource, ICON_SUFFIX_PNG, svgIconType);
}
// 如果是"_XXXXXX.svg"后缀
if (resource.endsWith(ICON_TYPE_NORMAL)) {
return readSpecifiedTypeIcon(resource, ICON_TYPE_NORMAL, svgIconType);
}
if (resource.endsWith(ICON_TYPE_DISABLED)) {
return readSpecifiedTypeIcon(resource, ICON_TYPE_DISABLED, svgIconType);
}
if (resource.endsWith(ICON_TYPE_PRESSED)) {
return readSpecifiedTypeIcon(resource, ICON_TYPE_PRESSED, svgIconType);
}
return readIcon(resource);
}
private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) {
String iconPath = resource.replace(oldSuffix, newSuffix);
if (IOUtils.readResource(iconPath) != null) {
return SVGIcon.readSVGIcon(iconPath);
}
return readIcon(resource);
}
}

82
designer-base/src/main/java/com/fr/base/svg/SVGIcon.java

@ -0,0 +1,82 @@
package com.fr.base.svg;
import com.fr.general.IOUtils;
import javax.swing.Icon;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
/**
* SVG转化而来的Icon
* @author Yvan
* @version 10.0
* Created by Yvan on 2020/12/17
*/
public class SVGIcon implements Icon {
private BufferedImage image;
private static final boolean HI_DPI_SURPORT = SystemScaleUtils.isJreHiDPIEnabled();
public static final float SYSTEM_SCALE = SystemScaleUtils.sysScale();
private static final String ICON_PREFIX = "/";
public SVGIcon(BufferedImage image) {
this.image = image;
}
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
if (HI_DPI_SURPORT) {
Graphics2D graphics = (Graphics2D) g.create(x, y, image.getWidth(null), image.getHeight(null));
float scale = SYSTEM_SCALE;
graphics.scale(1 / scale, 1 / scale);
graphics.drawImage(image, 0, 0, null);
graphics.scale(1.0D, 1.0D);
graphics.dispose();
} else {
g.drawImage(image, x, y, null);
}
}
@Override
public int getIconWidth() {
return HI_DPI_SURPORT ? (int) (image.getWidth() / SYSTEM_SCALE) : image.getWidth();
}
@Override
public int getIconHeight() {
return HI_DPI_SURPORT ? (int) (image.getHeight() / SYSTEM_SCALE) : image.getHeight();
}
/**
* 读取高清图标
* @param url
* @return
*/
public static Icon readSVGIcon(String url) {
if (!url.startsWith(ICON_PREFIX)) {
url = ICON_PREFIX + url;
}
BufferedImage image = (BufferedImage) SVGLoader.load(url);
return image == null ? IOUtils.readIcon(url) : new SVGIcon(image);
}
/**
* 读取指定尺寸的图标
* @param url 资源路径
* @param width 宽度
* @param height 高度
* @return
*/
public static Icon readSVGIcon(String url, float width, float height) {
if (!url.startsWith(ICON_PREFIX)) {
url = ICON_PREFIX + url;
}
BufferedImage image = (BufferedImage) SVGLoader.load(url, width, height);
return image == null ? IOUtils.readIcon(url) : new SVGIcon(image);
}
}

92
designer-base/src/main/java/com/fr/base/svg/SVGLoader.java

@ -0,0 +1,92 @@
package com.fr.base.svg;
import com.fr.general.IOUtils;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.xmlgraphics.java2d.Dimension2DDouble;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.Image;
import java.io.IOException;
import java.net.URL;
/**
* SVG图标加载器
* @author Yvan
* @version 10.0
* Created by Yvan on 2020/12/17
*/
public class SVGLoader {
public static final int ICON_DEFAULT_SIZE = 16;
public SVGLoader() {
}
@Nullable
public static Image load(@NotNull String url) {
try {
URL resource = IOUtils.getResource(url, SVGLoader.class);
if (resource == null) {
return null;
}
return load(resource, SVGIcon.SYSTEM_SCALE);
} catch (IOException ignore) {
return null;
}
}
@Nullable
public static Image load(@NotNull URL url) throws IOException {
return load(url, SVGIcon.SYSTEM_SCALE);
}
@Nullable
public static Image load(@NotNull URL url, double scale) throws IOException {
try {
String svgUri = url.toString();
TranscoderInput input = new TranscoderInput(svgUri);
return SVGTranscoder.createImage(scale, input).getImage();
} catch (TranscoderException ignore) {
return null;
}
}
@Nullable
public static Image load(@NotNull URL url, double scale, Dimension2DDouble dimension) throws IOException {
try {
String svgUri = url.toString();
TranscoderInput input = new TranscoderInput(svgUri);
return SVGTranscoder.createImage(scale, input,
(float) (dimension.getWidth() * scale), (float) (dimension.getHeight() * scale)).getImage();
} catch (TranscoderException ignore) {
return null;
}
}
@Nullable
public static Image load(@NotNull URL url, double scale, double overriddenWidth, double overriddenHeight) throws IOException {
try {
String svgUri = url.toString();
TranscoderInput input = new TranscoderInput(svgUri);
return SVGTranscoder.createImage(scale, input, (float) (overriddenWidth * scale), (float) (overriddenHeight * scale)).getImage();
} catch (TranscoderException ignore) {
return null;
}
}
@Nullable
public static Image load(@NotNull String url, float width, float height) {
try {
URL resource = IOUtils.getResource(url, SVGLoader.class);
if (resource == null) {
return null;
}
TranscoderInput input = new TranscoderInput(resource.toString());
return SVGTranscoder.createImage(SVGIcon.SYSTEM_SCALE, input, -1, -1, width, height).getImage();
} catch (TranscoderException ignore) {
return null;
}
}
}

181
designer-base/src/main/java/com/fr/base/svg/SVGTranscoder.java

@ -0,0 +1,181 @@
package com.fr.base.svg;
import com.fr.stable.AssistUtils;
import com.fr.value.AtomicNotNullLazyValue;
import org.apache.batik.anim.dom.SAXSVGDocumentFactory;
import org.apache.batik.anim.dom.SVGOMDocument;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.UserAgent;
import org.apache.batik.transcoder.SVGAbstractTranscoder;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.ImageTranscoder;
import org.apache.batik.util.XMLResourceDescriptor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.w3c.dom.Element;
import org.w3c.dom.svg.SVGDocument;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.StringReader;
/**
* 可以根据某个缩放倍数scale将SVG图片转化为Image对象
* @author Yvan
* @version 10.0
* Created by Yvan on 2020/12/17
*/
public class SVGTranscoder extends ImageTranscoder {
private static final float DEFAULT_VALUE = -1.0F;
public static final float ICON_DEFAULT_SIZE = 16F;
private float origDocWidth;
private float origDocHeight;
@Nullable
private BufferedImage image;
private final double scale;
@NotNull
private static AtomicNotNullLazyValue<Double> iconMaxSize = new AtomicNotNullLazyValue<Double>() {
@NotNull
@Override
protected Double compute() {
double maxSize = Double.MAX_VALUE;
if (!GraphicsEnvironment.isHeadless()) {
GraphicsDevice defaultScreenDevice = GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getDefaultScreenDevice();
Rectangle bounds = defaultScreenDevice.getDefaultConfiguration().getBounds();
AffineTransform tx = defaultScreenDevice
.getDefaultConfiguration()
.getDefaultTransform();
maxSize = Math.max(bounds.width * tx.getScaleX(), bounds.height * tx.getScaleY());
}
return maxSize;
}
};
public SVGTranscoder(double scale) {
this.scale = scale;
this.width = ICON_DEFAULT_SIZE;
this.height = ICON_DEFAULT_SIZE;
}
public SVGTranscoder(double scale, float width, float height) {
this.scale = scale;
this.width = width;
this.height = height;
}
public final float getOrigDocWidth() {
return this.origDocWidth;
}
public final void setOrigDocWidth(float origDocWidth) {
this.origDocWidth = origDocWidth;
}
public final float getOrigDocHeight() {
return this.origDocHeight;
}
public final void setOrigDocHeight(float origDocHeight) {
this.origDocHeight = origDocHeight;
}
public static double getIconMaxSize() {
return iconMaxSize.getValue();
}
@Nullable
public final BufferedImage getImage() {
return this.image;
}
@NotNull
public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input) throws TranscoderException {
return createImage(scale, input, -1, -1);
}
@NotNull
public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input, float overriddenWidth, float overriddenHeight) throws TranscoderException {
return createImage(scale, input, overriddenWidth, overriddenHeight, ICON_DEFAULT_SIZE, ICON_DEFAULT_SIZE);
}
@NotNull
public static SVGTranscoder createImage(double scale, @NotNull TranscoderInput input, float overriddenWidth, float overriddenHeight, float width, float height) throws TranscoderException {
SVGTranscoder transcoder = new SVGTranscoder(scale, width, height);
if (!AssistUtils.equals(overriddenWidth, DEFAULT_VALUE)) {
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_WIDTH, overriddenWidth);
}
if (!AssistUtils.equals(overriddenHeight, DEFAULT_VALUE)) {
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_HEIGHT, overriddenHeight);
}
double iconMaxSize = SVGTranscoder.iconMaxSize.getValue();
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_WIDTH, (float) iconMaxSize);
transcoder.addTranscodingHint(SVGAbstractTranscoder.KEY_MAX_HEIGHT, (float) iconMaxSize);
transcoder.transcode(input, null);
return transcoder;
}
private static SVGDocument createFallbackPlaceholder() {
try {
String fallbackIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\">\n" +
" <rect x=\"1\" y=\"1\" width=\"14\" height=\"14\" fill=\"none\" stroke=\"red\" stroke-width=\"2\"/>\n" +
" <line x1=\"1\" y1=\"1\" x2=\"15\" y2=\"15\" stroke=\"red\" stroke-width=\"2\"/>\n" +
" <line x1=\"1\" y1=\"15\" x2=\"15\" y2=\"1\" stroke=\"red\" stroke-width=\"2\"/>\n" +
"</svg>\n";
SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(XMLResourceDescriptor.getXMLParserClassName());
return (SVGDocument) factory.createDocument(null, new StringReader(fallbackIcon));
} catch (IOException e) {
throw new IllegalStateException(e);
}
}
@Override
protected void setImageSize(float docWidth, float docHeight) {
super.setImageSize((float) (docWidth * this.scale), (float) (docHeight * this.scale));
this.origDocWidth = docWidth;
this.origDocHeight = docHeight;
}
@Override
@NotNull
public BufferedImage createImage(int width, int height) {
return new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
}
@Override
public void writeImage(@NotNull BufferedImage image, @Nullable TranscoderOutput output) {
this.image = image;
}
@Override
@NotNull
protected UserAgent createUserAgent() {
return new SVGAbstractTranscoderUserAgent() {
@Override
@NotNull
public SVGDocument getBrokenLinkDocument(@NotNull Element e, @NotNull String url, @NotNull String message) {
return createFallbackPlaceholder();
}
};
}
/**
* 开放访问权限
*/
@Override
public BridgeContext createBridgeContext(SVGOMDocument doc) {
return super.createBridgeContext(doc);
}
}

96
designer-base/src/main/java/com/fr/base/svg/SystemScaleUtils.java

@ -0,0 +1,96 @@
package com.fr.base.svg;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StableUtils;
import com.fr.stable.os.OperatingSystem;
import org.jetbrains.annotations.NotNull;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.lang.reflect.Method;
import java.util.concurrent.atomic.AtomicReference;
/**
* 获取系统Scale相关的工具类
* @author Yvan
* @version 10.0
* Created by Yvan on 2020/12/17
*/
public class SystemScaleUtils {
private static final AtomicReference<Boolean> JRE_HIDPI = new AtomicReference<>();
private static final String HI_DPI = "hidpi";
/**
* 判断是否支持高清
* @return
*/
public static boolean isJreHiDPIEnabled() {
if (JRE_HIDPI.get() != null) {
return JRE_HIDPI.get();
}
if (OperatingSystem.isMacos()) {
// 如果是mac os系统,直接返回true
return true;
}
if (OperatingSystem.isWindows() && StableUtils.getMajorJavaVersion() <= 8) {
// 如果是jdk8 + Windows系统,直接返回false
return false;
}
synchronized (JRE_HIDPI) {
if (JRE_HIDPI.get() != null) {
return JRE_HIDPI.get();
}
boolean result = false;
if (getBooleanProperty(HI_DPI, true)) {
try {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
Class<?> sunGraphicsEnvironmentClass = Class.forName("sun.java2d.SunGraphicsEnvironment");
if (sunGraphicsEnvironmentClass.isInstance(ge)) {
try {
Method method = sunGraphicsEnvironmentClass.getDeclaredMethod("isUIScaleEnabled");
method.setAccessible(true);
result = (Boolean)method.invoke(ge);
}
catch (NoSuchMethodException e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
}
}
catch (Throwable ignore) {
}
}
JRE_HIDPI.set(result);
return result;
}
}
public static boolean getBooleanProperty(@NotNull final String key, final boolean defaultValue) {
final String value = System.getProperty(key);
return value == null ? defaultValue : Boolean.parseBoolean(value);
}
/**
* 获取系统Scale
* @return
*/
public static float sysScale() {
float scale = 1.0f;
// 先判断是否支持高清,不支持代表此时是Windows + jdk8 的设计器,返回的scale值为1.0
if (isJreHiDPIEnabled()) {
// 获取屏幕图形设备对象
GraphicsDevice graphicsDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if (graphicsDevice != null) {
// 获取图形配置对象
GraphicsConfiguration configuration = graphicsDevice.getDefaultConfiguration();
if (configuration != null && configuration.getDevice().getType() != GraphicsDevice.TYPE_PRINTER) {
// 获取屏幕缩放率,mac下固定为2,Windows+jdk11则将得到用户设置的dpi值
scale = (float) configuration.getDefaultTransform().getScaleX();
}
}
}
return scale;
}
}

19
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -1,6 +1,7 @@
package com.fr.design;
import com.fr.common.report.ReportState;
import com.fr.decision.webservice.v10.plugin.helper.PluginErrorRemindHandler;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -35,6 +36,7 @@ import com.fr.process.engine.core.FineProcessContext;
import com.fr.rpc.Result;
import com.fr.stable.AssistUtils;
import com.fr.stable.StringUtils;
import com.fr.env.PluginErrorRemindDialog;
import com.fr.start.server.ServerTray;
import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback;
@ -144,6 +146,7 @@ public class EnvChangeEntrance {
template.refreshToolArea();
}
showServiceDialog(selectedEnv);
pluginErrorRemind(selectedEnv);
} catch (WorkspaceAuthException | RegistEditionException e) {
// String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed");
// String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote");
@ -297,6 +300,22 @@ public class EnvChangeEntrance {
}
}
/**
* 插件启动错误信息提示
* @param selectedEnv 选择的工作环境
*/
public void pluginErrorRemind(DesignerWorkspaceInfo selectedEnv) {
if (selectedEnv.getType() == DesignerWorkspaceType.Remote) {
return;
}
String content = PluginErrorRemindHandler.pluginErrorContent();
if (StringUtils.isNotEmpty(content)) {
PluginErrorRemindDialog dialog = new PluginErrorRemindDialog(DesignerContext.getDesignerFrame(), content);
dialog.setVisible(true);
}
}
/**
* 判断是否需要做版本验证判断依据为
* 1选择的环境为远程环境

4
designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
@ -22,7 +22,7 @@ public class AllowAuthorityEditAction extends TemplateComponentAction {
this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png"));
this.setSmallIcon("/com/fr/design/images/m_report/allow_authority_edit");
}
/**

4
designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.DesignModelAdapter;
@ -19,7 +19,7 @@ public class ExitAuthorityEditAction extends TemplateComponentAction {
public ExitAuthorityEditAction(TargetComponent t) {
super(t);
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Authority_Edit_Status_Exit"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit.png"));
this.setSmallIcon("/com/fr/design/images/m_report/exit_authority_edit");
}

5
designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java

@ -1,8 +1,7 @@
package com.fr.design.actions;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.design.data.datapane.ReportTableDataPane;
@ -27,7 +26,7 @@ public class TableDataSourceAction extends TemplateComponentAction<JTemplate<?,
this.setMenuKeySet(KeySetUtils.TEMPLATE_TABLE_DATA_SOURCE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_web/datasource.png"));
this.setSmallIcon("/com/fr/design/images/m_web/datasource");
}
/**

54
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -6,6 +6,8 @@ package com.fr.design.actions;
import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.svg.SVGIcon;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
@ -78,6 +80,16 @@ public abstract class UpdateAction extends ShortCut implements Action {
private String searchText = StringUtils.EMPTY;
/**
* 按钮在按压状态的图标key
*/
public static final String PRESSED_ICON = "pressedIcon";
/**
* 按钮在灰化状态的图标key
*/
public static final String DISABLED_ICON = "disabledIcon";
/**
@ -162,6 +174,19 @@ public abstract class UpdateAction extends ShortCut implements Action {
this.putValue(Action.SMALL_ICON, smallIcon);
}
/**
* 使用传入资源url的方式设置Icon可以自动设置对应的"_normal.svg""_disabled.svg"
* 但是要保证文件名的统一例如a.png对应a_normal.svga_disabled.svg
* 如果a_disabled.svg或者a_pressed.svg缺失则不会被设置成灰化状态或者按压状态图标
* 如果a_normal.svg缺失则会读到a.png这也就不是一个SVGIcon了
* 如果连 a.png 也不存在那么这个action的图标就是空白的
* @param resource
*/
public void setSmallIcon(String resource) {
this.putValue(Action.SMALL_ICON, IconUtils.readIcon(resource));
this.putValue(UpdateAction.DISABLED_ICON, IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}
public void setSmallIcon(Icon[] smallIcon, boolean white) {
this.putValue(Action.SMALL_ICON, smallIcon);
}
@ -251,6 +276,14 @@ public abstract class UpdateAction extends ShortCut implements Action {
}
public void setPressedIcon(Icon pressedIcon) {
this.putValue(UpdateAction.PRESSED_ICON, pressedIcon);
}
public void setDisabledIcon(Icon disabledIcon) {
this.putValue(UpdateAction.DISABLED_ICON, disabledIcon);
}
@Override
public synchronized void addPropertyChangeListener(PropertyChangeListener listener) {
@ -271,6 +304,8 @@ public abstract class UpdateAction extends ShortCut implements Action {
UIMenuItem menuItem = new UIMenuItem(this);
// 设置名字用作单元测
menuItem.setName(getName());
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
object = menuItem;
this.putValue(UIMenuItem.class.getName(), object);
@ -282,6 +317,8 @@ public abstract class UpdateAction extends ShortCut implements Action {
UIMenuEastAttrItem menuItem = new UIMenuEastAttrItem(this);
// 设置名字用作单元测
menuItem.setName(getName());
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
this.putValue(UIMenuItem.class.getName(), menuItem);
return menuItem;
}
@ -307,6 +344,8 @@ public abstract class UpdateAction extends ShortCut implements Action {
}
button.setIcon((Icon) this.getValue(Action.SMALL_ICON));
setPressedIcon4Button(button);
setDisabledIcon4Button(button);
button.addActionListener(this);
button.registerKeyboardAction(this, this.getAccelerator(), JComponent.WHEN_IN_FOCUSED_WINDOW);
@ -454,6 +493,8 @@ public abstract class UpdateAction extends ShortCut implements Action {
object = new UseMenuItem(this);
this.putValue(UseMenuItem.class.getName(), object);
}
setPressedIcon4Button((UseMenuItem) object);
setDisabledIcon4Button((UseMenuItem) object);
return (UseMenuItem) object;
}
@ -594,4 +635,17 @@ public abstract class UpdateAction extends ShortCut implements Action {
shortPinyin.append(PinyinHelper.getShortPinyin(title)).append(separator);
}
private void setPressedIcon4Button(AbstractButton button) {
Icon pressedIcon = (Icon) this.getValue(UpdateAction.PRESSED_ICON);
if (pressedIcon != null && pressedIcon instanceof SVGIcon) {
button.setPressedIcon(pressedIcon);
}
}
private void setDisabledIcon4Button(AbstractButton button) {
Icon disabledIcon = (Icon) this.getValue(UpdateAction.DISABLED_ICON);
if (disabledIcon != null && disabledIcon instanceof SVGIcon) {
button.setDisabledIcon(disabledIcon);
}
}
}

4
designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
@ -20,7 +20,7 @@ public class BBSAction extends UpdateAction
this.setMenuKeySet(BBS);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bbs.png"));
this.setSmallIcon("/com/fr/design/images/bbs/bbs");
}

5
designer-base/src/main/java/com/fr/design/actions/community/BugAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
@ -17,8 +17,7 @@ public class BugAction extends UpdateAction
{ this.setMenuKeySet(BUG);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/bug.png"));
this.setSmallIcon("/com/fr/design/images/bbs/bug");
}
@Override

4
designer-base/src/main/java/com/fr/design/actions/community/BugNeedAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.locale.impl.BugNeedMark;
import com.fr.design.menu.MenuKeySet;
@ -20,7 +20,7 @@ public class BugNeedAction extends UpdateAction {
this.setMenuKeySet(BugAndNeed);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png"));
this.setSmallIcon("/com/fr/design/images/bbs/need");
}
@Override

4
designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
@ -17,7 +17,7 @@ public class CenterAction extends UpAction{
this.setMenuKeySet(CENTER);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/center.png"));
this.setSmallIcon("/com/fr/design/images/bbs/center");
}

5
designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java

@ -1,10 +1,9 @@
package com.fr.design.actions.community;
import com.fr.base.svg.IconUtils;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.general.IOUtils;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@ -14,7 +13,7 @@ public class FacebookFansAction extends UpAction {
this.setMenuKeySet(FACEBOOKFANS);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/facebook.png"));
this.setSmallIcon("/com/fr/design/images/bbs/facebook");
}
@Override

4
designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
@ -18,7 +18,7 @@ public class NeedAction extends UpdateAction
this.setMenuKeySet(NEED);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/need.png"));
this.setSmallIcon("/com/fr/design/images/bbs/need");
}

4
designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
@ -16,7 +16,7 @@ public class QuestionAction extends UpdateAction {
this.setMenuKeySet(QUESTIONS);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/question.png"));
this.setSmallIcon("/com/fr/design/images/bbs/question");
}

5
designer-base/src/main/java/com/fr/design/actions/community/SignAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
@ -19,8 +19,7 @@ public class SignAction extends UpdateAction
this.setMenuKeySet(SIGN);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/sign.png"));
this.setSmallIcon("/com/fr/design/images/bbs/sign");
}
@Override

4
designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.community;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
@ -21,7 +21,7 @@ public class TechSolutionAction extends UpdateAction{
this.setMenuKeySet(TSO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs/solution.png"));
this.setSmallIcon("/com/fr/design/images/bbs/solution");
}

5
designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java

@ -1,10 +1,10 @@
package com.fr.design.actions.community;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.locale.impl.VideoMark;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.IOUtils;
import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark;
@ -20,8 +20,7 @@ public class VideoAction extends UpdateAction
this.setMenuKeySet(VIDEO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/video.png"));
this.setSmallIcon("/com/fr/design/images/bbs/video");
}
@Override

3
designer-base/src/main/java/com/fr/design/actions/edit/CopyAction.java

@ -3,7 +3,6 @@
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.TargetComponent;
@ -22,7 +21,7 @@ public class CopyAction extends TemplateComponentAction {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy"));
this.setMnemonic('C');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
this.setSmallIcon("/com/fr/design/images/m_edit/copy");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER));
this.setEnabled(!DesignModeContext.isBanCopyAndCut());
}

3
designer-base/src/main/java/com/fr/design/actions/edit/CutAction.java

@ -3,7 +3,6 @@
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.TargetComponent;
@ -26,7 +25,7 @@ public class CutAction extends TemplateComponentAction {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut"));
this.setMnemonic('T');
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_edit/cut.png"));
this.setSmallIcon("/com/fr/design/images/m_edit/cut");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER));
this.setEnabled(!DesignModeContext.isBanCopyAndCut());
}

3
designer-base/src/main/java/com/fr/design/actions/edit/PasteAction.java

@ -3,7 +3,6 @@
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.TargetComponent;
@ -25,7 +24,7 @@ public class PasteAction extends TemplateComponentAction {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste"));
this.setMnemonic('P');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/paste.png"));
this.setSmallIcon("/com/fr/design/images/m_edit/paste");
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER));
}

3
designer-base/src/main/java/com/fr/design/actions/edit/RedoAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.edit;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.TemplateComponentActionInterface;
import com.fr.design.actions.UpdateAction;
@ -23,7 +22,7 @@ public class RedoAction extends UpdateAction implements TemplateComponentActionI
this.setMenuKeySet(KeySetUtils.REDO);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/redo.png"));
this.setSmallIcon("com/fr/design/images/m_edit/redo");
this.setAccelerator(getMenuKeySet().getKeyStroke());
}

3
designer-base/src/main/java/com/fr/design/actions/edit/UndoAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.edit;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.TemplateComponentActionInterface;
import com.fr.design.actions.UpdateAction;
@ -23,7 +22,7 @@ public class UndoAction extends UpdateAction implements TemplateComponentActionI
this.setMenuKeySet(KeySetUtils.UNDO);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/undo.png"));
this.setSmallIcon("/com/fr/design/images/m_edit/undo");
this.setAccelerator(getMenuKeySet().getKeyStroke());
}

4
designer-base/src/main/java/com/fr/design/actions/file/OpenTemplateAction.java

@ -5,7 +5,7 @@ package com.fr.design.actions.file;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.KeySetUtils;
@ -22,7 +22,7 @@ public class OpenTemplateAction extends UpdateAction {
this.setMenuKeySet(KeySetUtils.OPEN_TEMPLATE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/open.png"));
this.setSmallIcon("/com/fr/design/images/buttonicon/open");
this.setAccelerator(getMenuKeySet().getKeyStroke());
}

4
designer-base/src/main/java/com/fr/design/actions/file/SaveAsTemplateAction.java

@ -5,7 +5,7 @@ package com.fr.design.actions.file;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils;
@ -20,7 +20,7 @@ public class SaveAsTemplateAction extends JTemplateAction<JTemplate<?, ?>> {
this.setMenuKeySet(KeySetUtils.SAVE_AS_TEMPLATE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/saveAs.png"));
this.setSmallIcon("/com/fr/design/images/m_file/saveAs");
}
/**

3
designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java

@ -5,7 +5,6 @@ package com.fr.design.actions.file;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils;
@ -21,7 +20,7 @@ public class SaveTemplateAction extends JTemplateAction<JTemplate<?, ?>> {
this.setMenuKeySet(KeySetUtils.SAVE_TEMPLATE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/save.png"));
this.setSmallIcon("/com/fr/design/images/m_file/save");
this.setAccelerator(getMenuKeySet().getKeyStroke());
}

8
designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java

@ -1,6 +1,6 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.EnvChangeEntrance;
import com.fr.design.actions.UpdateAction;
@ -25,7 +25,7 @@ public class SwitchExistEnv extends MenuDef {
Iterator<String> nameIt = DesignerEnvManager.getEnvManager().getEnvNameIterator();
while (nameIt.hasNext()) {
String name = nameIt.next();
this.setIconPath("com/fr/design/images/m_file/switch.png");
this.setIconPath("com/fr/design/images/m_file/switch");
this.addShortCut(new GetExistEnvAction(name));
}
this.addShortCut(SeparatorDef.DEFAULT);
@ -42,11 +42,11 @@ public class SwitchExistEnv extends MenuDef {
DesignerWorkspaceInfo env = DesignerEnvManager.getEnvManager().getWorkspaceInfo(envName);
switch (env.getType()) {
case Local: {
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/localconnect.png"));
this.setSmallIcon("com/fr/design/images/data/bind/localconnect");
break;
}
case Remote: {
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/data/bind/distanceconnect.png"));
this.setSmallIcon("com/fr/design/images/data/bind/distanceconnect");
break;
}
}

4
designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java

@ -1,10 +1,10 @@
package com.fr.design.actions.help;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.http.HttpToolbox;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.CommonUtils;
@ -28,7 +28,7 @@ public class TutorialAction extends UpdateAction {
this.setMenuKeySet(HELP_TUTORIAL);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/bbs/help.png"));
this.setSmallIcon("/com/fr/design/images/bbs/help");
this.setAccelerator(getMenuKeySet().getKeyStroke());
}

4
designer-base/src/main/java/com/fr/design/actions/help/WebDemoAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.help;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
@ -16,7 +16,7 @@ public class WebDemoAction extends UpdateAction {
this.setMenuKeySet(PRODUCT_DEMO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_help/demo.png"));
this.setSmallIcon("/com/fr/design/images/m_help/demo");
}
/**

4
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.help.alphafine;
import com.fr.base.svg.SVGIcon;
import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -8,7 +9,6 @@ import com.fr.design.dialog.DialogActionListener;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import javax.swing.KeyStroke;
import java.awt.event.ActionEvent;
@ -21,7 +21,7 @@ public class AlphaFineAction extends UpdateAction {
this.setMenuKeySet(ALPHAFINE);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/smallsearch.png"));
this.setSmallIcon("com/fr/design/mainframe/alphafine/images/smallsearch");
this.generateAndSetSearchText(AlphaFineConfigPane.class.getName());
}

4
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.server;
import com.fr.base.svg.IconUtils;
import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionShowPane;
@ -11,7 +12,6 @@ import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
import com.fr.design.os.impl.DatabaseDialogAction;
import com.fr.file.ConnectionConfig;
import com.fr.general.IOUtils;
import javax.swing.*;
import java.awt.event.ActionEvent;
@ -26,7 +26,7 @@ public class ConnectionListAction extends UpdateAction {
this.setMenuKeySet(DEFINE_DATA_CONNECTION);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/connection.png"));
this.setSmallIcon("/com/fr/design/images/m_web/connection");
this.generateAndSetSearchText(DatabaseConnectionPane.JDBC.class.getName());
}

4
designer-base/src/main/java/com/fr/design/actions/server/FunctionManagerAction.java

@ -4,6 +4,7 @@
package com.fr.design.actions.server;
import com.fr.base.svg.IconUtils;
import com.fr.config.Configuration;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
@ -12,7 +13,6 @@ import com.fr.design.formula.FunctionManagerPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.FunctionConfig;
import com.fr.general.IOUtils;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
@ -29,7 +29,7 @@ public class FunctionManagerAction extends UpdateAction {
this.setMenuKeySet(FUNCTION_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_web/function.png"));
this.setSmallIcon("/com/fr/design/images/m_web/function");
this.generateAndSetSearchText(FunctionManagerPane.class.getName());
}

4
designer-base/src/main/java/com/fr/design/actions/server/GlobalParameterAction.java

@ -3,8 +3,8 @@
*/
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.ParameterConfig;
import com.fr.base.svg.IconUtils;
import com.fr.config.ServerPreferenceConfig;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
@ -31,7 +31,7 @@ public class GlobalParameterAction extends UpdateAction {
this.setMenuKeySet(GLOBAL_PARAMETER);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.png"));
this.setSmallIcon("/com/fr/design/images/m_report/p");
}
/**

4
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -3,8 +3,8 @@
*/
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.TableData;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
@ -40,7 +40,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
this.setMenuKeySet(SERVER_TABLEDATA);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png"));
this.setSmallIcon("/com/fr/design/images/data/dock/serverdatabase");
}
public static final MenuKeySet SERVER_TABLEDATA = new MenuKeySet() {

4
designer-base/src/main/java/com/fr/design/actions/server/PlatformManagerAction.java

@ -1,6 +1,6 @@
package com.fr.design.actions.server;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.utils.DesignUtils;
@ -14,7 +14,7 @@ public class PlatformManagerAction extends UpdateAction {
this.setMenuKeySet(PLATEFORM_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/server/platform_16_16.png"));
this.setSmallIcon("/com/fr/design/images/server/platform_16_16");
}
/**

4
designer-base/src/main/java/com/fr/design/actions/server/PluginManagerAction.java

@ -1,9 +1,9 @@
package com.fr.design.actions.server;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.os.impl.PMDialogAction;
import com.fr.general.IOUtils;
import com.fr.stable.os.support.OSBasedAction;
import com.fr.stable.os.support.OSSupportCenter;
@ -20,7 +20,7 @@ public class PluginManagerAction extends UpdateAction {
this.setMenuKeySet(PLUGIN_MANAGER);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/server/plugin.png"));
this.setSmallIcon("/com/fr/design/images/server/plugin");
}
@Override
public void actionPerformed(ActionEvent e) {

2
designer-base/src/main/java/com/fr/design/constants/UIConstants.java

@ -3,6 +3,7 @@
*/
package com.fr.design.constants;
import com.fr.base.svg.IconUtils;
import com.fr.general.IOUtils;
import com.fr.stable.Constants;
@ -179,6 +180,7 @@ public interface UIConstants {
public static final Icon YES_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/yes.png");
public static final Icon CHOOSEN_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/select_item.png");
public static final Icon PRE_WIDGET_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png");
public static final Icon PRE_WIDGET_NORMAL_ICON = IconUtils.readIcon("com/fr/design/images/buttonicon/prewidget");
public static final Icon EDIT_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editn.png");
public static final Icon EDIT_PRESSED_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/editp.png");
public static final Icon HIDE_NORMAL_ICON = IOUtils.readIcon("com/fr/design/images/buttonicon/hiden.png");

4
designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java

@ -398,7 +398,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
public PreviewTableDataAction(TableDataTree dataTree) {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.setMnemonic('p');
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.PREVIEW_ICON_PATH));
this.setSmallIcon("/com/fr/design/images/m_file/preview");
this.dataTree = dataTree;
}
@ -437,7 +437,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
public ConnectionTableAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Define_Data_Connection"));
this.setMnemonic('D');
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH));
this.setSmallIcon("/com/fr/design/images/m_web/connection");
}
}

5
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java

@ -1,6 +1,5 @@
package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.TableDataSourceDependent;
@ -279,7 +278,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
public EditAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
this.setMnemonic('E');
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_EDIT_ICON_PATH));
this.setSmallIcon("/com/fr/design/images/control/edit");
}
public void actionPerformed(ActionEvent e) {
@ -297,7 +296,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
public RemoveAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
this.setMnemonic('R');
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH));
this.setSmallIcon("/com/fr/design/images/control/remove");
}
@Override

2
designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java

File diff suppressed because one or more lines are too long

50
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -18,6 +18,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.context.PluginMarkerAdapter;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginControllerHelper;
import com.fr.plugin.manage.control.PluginTask;
@ -26,7 +27,8 @@ import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.view.PluginView;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.io.File;
import java.net.HttpURLConnection;
import java.util.List;
@ -38,11 +40,23 @@ import java.util.List;
public class PluginOperateUtils {
public static void installPluginOnline(final PluginMarker pluginMarker, JSCallback jsCallback) {
PluginMarker marker = updateMarker2Online(pluginMarker);
//下载插件
PluginTask pluginTask = PluginTask.installTask(pluginMarker);
PluginTask pluginTask = PluginTask.installTask(marker);
PluginControllerHelper.installOnline(pluginMarker, new InstallOnlineCallback(pluginTask, jsCallback));
}
public static PluginMarker updateMarker2Online(PluginMarker pluginMarker) {
try {
JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID());
String pluginName = latestPluginInfo.getString("name");
return PluginMarkerAdapter.create(pluginMarker, pluginName);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return pluginMarker;
}
public static void installPluginFromDisk(File zipFile, JSCallback jsCallback) {
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback));
}
@ -57,10 +71,11 @@ public class PluginOperateUtils {
public static void updatePluginOnline(PluginMarker pluginMarker, JSCallback jsCallback) {
try {
JSONObject latestPluginInfo = PluginUtils.getLatestPluginInfo(pluginMarker.getPluginID());
String latestPluginVersion = (String) latestPluginInfo.get("version");
PluginMarker toPluginMarker = PluginMarker.create(pluginMarker.getPluginID(), latestPluginVersion);
String latestPluginVersion = latestPluginInfo.getString("version");
String pluginName = latestPluginInfo.getString("name");
PluginMarker toPluginMarker = PluginMarkerAdapter.create(pluginMarker.getPluginID(), latestPluginVersion, pluginName);
//当前已经安装的相同ID插件marker
PluginMarker currentMarker = PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID());
PluginMarker currentMarker = PluginMarkerAdapter.create(PluginUtils.getInstalledPluginMarkerByID(pluginMarker.getPluginID()), pluginName);
PluginTask pluginTask = PluginTask.updateTask(currentMarker, toPluginMarker);
PluginControllerHelper.updateOnline(currentMarker, toPluginMarker, new UpdateOnlineCallback(pluginTask, jsCallback));
} catch (Exception e) {
@ -128,6 +143,10 @@ public class PluginOperateUtils {
}
public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope) {
dealParams(url, category, seller, fee, StringUtils.EMPTY);
}
public static void dealParams(StringBuilder url, String category, String seller, String fee, String scope, String language) {
if (StringUtils.isNotBlank(category)) {
url.append("cid=").append(category.split("-")[1]);
} else {
@ -169,6 +188,9 @@ public class PluginOperateUtils {
url.append("&scope=").append(StringUtils.EMPTY);
}
}
if (StringUtils.isNotBlank(language)) {
url.append("&language=").append(language.split("-")[1]);
}
}
public static void getLoginInfo(JSCallback jsCallback, UILabel uiLabel) {
@ -203,16 +225,22 @@ public class PluginOperateUtils {
continue;
}
PluginMarker pluginMarker = pluginTask.getToMarker();
PluginContext pluginContext = PluginManager.getContext(pluginMarker);
if (pluginContext != null) {
pluginInfo.append(pluginContext.getName()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode()));
} else {
pluginInfo.append(pluginMarker.getPluginID()).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode()));
}
PluginContext pluginContext = PluginManager.getContext(pluginMarker.getPluginID());
pluginInfo.append(getPluginName(pluginContext, pluginMarker)).append(PluginUtils.getMessageByErrorCode(pluginTaskResult.errorCode()));
}
return pluginInfo.toString();
}
private static String getPluginName(PluginContext pluginContext, PluginMarker pluginMarker) {
if (pluginContext != null) {
return pluginContext.getName();
}
else if (pluginMarker instanceof PluginMarkerAdapter) {
return ((PluginMarkerAdapter) pluginMarker).getPluginName();
}
return pluginMarker == null ? StringUtils.EMPTY : pluginMarker.getPluginID();
}
public static String getSwitchedInfo(PluginTaskResult result) {
StringBuilder pluginInfo = new StringBuilder();
List<PluginTaskResult> pluginTaskResults = result.asList();

1
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -10,6 +10,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginVerifyException;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalType;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;

11
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -21,19 +21,26 @@ public class GetPluginFromStoreExecutor implements Executor {
private String seller;
private String fee;
private String scope;
private String language;
public GetPluginFromStoreExecutor(JSONObject info) {
this.category = info.optString("categories");
this.fee = info.optString("fee");
this.seller = info.optString("seller");
this.scope = info.optString("scope");
this.language = info.optString("language");
}
public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope) {
this(category, seller, fee, scope, StringUtils.EMPTY);
}
public GetPluginFromStoreExecutor(String category, String seller, String fee, String scope, String language) {
this.category = category;
this.seller = seller;
this.fee = fee;
this.scope = scope;
this.language = language;
}
@Override
@ -53,7 +60,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override
public void run(Process<String> process) {
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist");
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope);
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope) & StringUtils.isEmpty(language);
if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins();
return;
@ -62,7 +69,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope);
PluginOperateUtils.dealParams(url, category, seller, fee, scope, language);
try {
HttpClient httpClient = new HttpClient(url.toString());
httpClient.asGet();

32
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -3,7 +3,7 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.extra.PluginUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
import java.io.File;
import java.util.List;
@ -41,20 +40,21 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
if (result.isSuccess()) {
String switchedInfo = PluginOperateUtils.getSwitchedInfo(result);
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
FineJOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo;
FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo);
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) {
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
return;
}
List<PluginTask> pluginTasks = result.getPreTasks();
@ -64,24 +64,24 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
}
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback));
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
return;
}
PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback);
}else {
jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));
FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE);
}
}
}

27
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java

@ -3,6 +3,7 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -11,8 +12,6 @@ import com.fr.plugin.manage.control.AbstractDealPreTaskCallback;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
/**
* Created by ibm on 2017/5/26.
@ -38,28 +37,30 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback {
if (result.isSuccess()) {
String switchedInfo = PluginOperateUtils.getSwitchedInfo(result);
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
FineJOptionPane.showMessageDialog(null, pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo);
String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo;
FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo);
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
jsCallback.execute("success");
return;
}
PluginMarker pluginMarker = result.getCurrentTask().getMarker();
PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback);
}else {
} else {
jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE);
}
}

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

@ -2,12 +2,14 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginUtils;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
import javax.swing.JOptionPane;
/**
* Created by ibm on 2017/5/27.
@ -22,12 +24,16 @@ public class ModifyStatusCallback implements PluginTaskCallback{
}
@Override
public void done(PluginTaskResult result) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
jsCallback.execute("success");
String modifyMessage = isActive ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
String modifyMessage = isActive ?
pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Been_Disabled_Duplicate") :
pluginInfo + Toolkit.i18nText("Fine-Design_Plugin_Has_Been_Actived_Duplicate");
FineLoggerFactory.getLogger().info(modifyMessage);
FineJOptionPane.showMessageDialog(null, modifyMessage);
} else {
FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
}
}

27
designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java

@ -2,7 +2,8 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginUtils;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -10,8 +11,6 @@ import com.fr.plugin.error.PluginErrorCode;
import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
/**
* Created by ibm on 2017/5/27.
*/
@ -25,29 +24,31 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback {
@Override
public void done(PluginTaskResult result) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success"));
String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Success");
FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo);
}else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) {
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
return;
}
PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback));
} else {
jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed"));
FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE);
}
}
}

37
designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -3,7 +3,7 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.extra.PluginUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.context.PluginMarker;
@ -12,7 +12,6 @@ import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
import java.io.File;
import java.util.List;
@ -37,22 +36,24 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
@Override
public void done(PluginTaskResult result) {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"));
FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"));
String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success");
FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo);
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) {
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
return;
}
List<PluginTask> pluginTasks = result.getPreTasks();
@ -62,24 +63,24 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
}
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback));
} else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){
int rv = JOptionPane.showOptionDialog(
int rv = FineJOptionPane.showOptionDialog(
null,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.INFORMATION_MESSAGE,
Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"),
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null,
FineJOptionPane.OPTION_YES_NO_CANCEL,
null
);
if (rv == JOptionPane.NO_OPTION || rv == JOptionPane.CANCEL_OPTION || rv == JOptionPane.CLOSED_OPTION) {
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) {
return;
}
PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback);
}else {
jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));
FineJOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE);
}
}
}

12
designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateOnlineCallback.java

@ -3,14 +3,13 @@ package com.fr.design.extra.exe.callback;
import com.fr.design.bridge.exec.JSCallback;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginOperateUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.manage.control.AbstractDealPreTaskCallback;
import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskResult;
import javax.swing.*;
/**
* Created by ibm on 2017/5/26.
*/
@ -33,12 +32,13 @@ public class UpdateOnlineCallback extends AbstractDealPreTaskCallback {
String pluginInfo = PluginOperateUtils.getSuccessInfo(result);
if (result.isSuccess()) {
jsCallback.execute("success");
FineLoggerFactory.getLogger().info(pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"));
FineJOptionPane.showMessageDialog(null,pluginInfo + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success"));
String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Success");
FineLoggerFactory.getLogger().info(successInfo);
FineJOptionPane.showMessageDialog(null, successInfo);
} else {
jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));
FineJOptionPane.showMessageDialog(null, pluginInfo, Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), FineJOptionPane.ERROR_MESSAGE);
}
}
}

3
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -2,7 +2,6 @@ package com.fr.design.file;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.io.BaseBook;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.data.DesignTableDataManager;
@ -23,7 +22,6 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import javax.swing.SwingUtilities;
import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collections;
@ -441,4 +439,5 @@ public class HistoryTemplateListCache implements CallbackEvent {
}
});
}
}

4
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -18,8 +18,6 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.third.javax.annotation.Nonnull;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import javax.swing.BorderFactory;
import javax.swing.ButtonModel;
@ -707,7 +705,7 @@ public class MutilTempalteTabPane extends JComponent {
// 只有是环境内的文件,才执行释放锁
if (file != null && file.isEnvFile()) {
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(file.getPath());
TemplateResourceManager.getResource().closeTemplate(file.getPath());
}
}

71
designer-base/src/main/java/com/fr/design/file/TemplateResource.java

@ -0,0 +1,71 @@
package com.fr.design.file;
import com.fr.common.annotations.Open;
import com.fr.file.FILE;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 模板资源操作可操作模板及模板目录
*
* @author hades
* @version 10.0
* Created by hades on 2020/12/23
*/
@Open
public interface TemplateResource {
/**
* 读取模板
* @param path
* @return
* @throws Exception
*/
InputStream readTemplate(String path) throws Exception;
/**
* 保存模板
* @param file
* @return
* @throws Exception
*/
OutputStream saveTemplate(FILE file) throws Exception;
/**
* 删除某个目录/某个模板
* @param file
* @return
*/
boolean delete(FILE file);
/**
* 关闭模板
* @param path
* @return
*/
boolean closeTemplate(String path);
/**
* 重命名模板/目录
* @param from
* @param to
* @return
*/
boolean rename(String from, String to);
/**
* 模板/目录是否存在
* @param path
* @return
*/
boolean exist(String path);
/**
* 创建目录
* @param path
* @return
*/
boolean mkdir(String path);
}

66
designer-base/src/main/java/com/fr/design/file/TemplateResourceManager.java

@ -0,0 +1,66 @@
package com.fr.design.file;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.file.impl.DefaultTemplateResource;
import com.fr.design.fun.LocalResourceProvider;
import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.file.filetree.FileNodes;
import com.fr.file.filetree.LocalFileNodes;
import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.observer.PluginEventType;
import com.fr.plugin.observer.PluginListenerRegistration;
import com.fr.workspace.WorkContext;
import com.fr.workspace.engine.base.FineObjectPool;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/23
*/
public class TemplateResourceManager {
private static final TemplateResource DEFAULT_OPERATION = new DefaultTemplateResource();
private static TemplateResource OPERATION = DEFAULT_OPERATION;
static {
PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG);
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
registerOperation(new DefaultTemplateResource());
FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes());
UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh());
}
}, filter);
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
LocalResourceProvider provider = ExtraDesignClassManager.getInstance().getSingle(LocalResourceProvider.XML_TAG);
if (provider != null && WorkContext.getCurrent().isLocal()) {
registerOperation(provider.createResourceOperation());
FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, provider.createFileNodes());
UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh());
}
}
}, filter);
}
private static void registerOperation(TemplateResource operation) {
OPERATION = operation;
}
public static TemplateResource getResource() {
if (OPERATION == null) {
return DEFAULT_OPERATION;
}
return OPERATION;
}
}

21
designer-base/src/main/java/com/fr/design/file/TemplateTreePane.java

@ -4,7 +4,9 @@
package com.fr.design.file;
import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.TemplateTreeDefineProcessor;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
@ -23,12 +25,11 @@ import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath;
@ -87,6 +88,16 @@ public class TemplateTreePane extends JPanel implements FileOperations {
}
}
@Override
public void mouseClicked(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e)) {
TemplateTreeDefineProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TemplateTreeDefineProcessor.XML_TAG);
if (processor != null) {
processor.rightClickAction(e);
}
}
}
@Override
public void mouseReleased(MouseEvent e) {
if (toolBarStateChangeListener != null) {
@ -182,7 +193,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
@Override
public boolean mkdir(String path) {
return WorkContext.getWorkResource().createDirectory(path);
return TemplateResourceManager.getResource().mkdir(path);
}
/**
@ -325,7 +336,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
if (node instanceof FileNode) {
FileNodeFILE nodeFILE = new FileNodeFILE((FileNode) node);
if (nodeFILE.exists()) {
if (WorkContext.getCurrent().get(TplOperator.class).delete(nodeFILE.getPath())) {
if (TemplateResourceManager.getResource().delete(nodeFILE)) {
HistoryTemplateListCache.getInstance().deleteFile(nodeFILE);
} else {
success = false;
@ -427,7 +438,7 @@ public class TemplateTreePane extends JPanel implements FileOperations {
try {
// 接收的是WEB-INF下的路径
return WorkContext.getCurrent().get(TplOperator.class).rename(from, to);
return TemplateResourceManager.getResource().rename(from, to);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;

19
designer-base/src/main/java/com/fr/design/file/impl/AbstractTemplateResource.java

@ -0,0 +1,19 @@
package com.fr.design.file.impl;
import com.fr.design.file.TemplateResource;
import com.fr.file.FILE;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/23
*/
public abstract class AbstractTemplateResource implements TemplateResource {
}

52
designer-base/src/main/java/com/fr/design/file/impl/DefaultTemplateResource.java

@ -0,0 +1,52 @@
package com.fr.design.file.impl;
import com.fr.file.FILE;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/23
*/
public class DefaultTemplateResource extends AbstractTemplateResource {
@Override
public InputStream readTemplate(String path) throws Exception {
return new ByteArrayInputStream(WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(path));
}
@Override
public OutputStream saveTemplate(FILE file) throws Exception {
return file.asOutputStream();
}
@Override
public boolean closeTemplate(String path) {
return WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(path);
}
@Override
public boolean delete(FILE file) {
return WorkContext.getCurrent().get(TplOperator.class).delete(file.getPath());
}
@Override
public boolean rename(String from, String to) {
return WorkContext.getCurrent().get(TplOperator.class).rename(from, to);
}
@Override
public boolean exist(String path) {
return WorkContext.getWorkResource().exist(path);
}
@Override
public boolean mkdir(String path) {
return WorkContext.getWorkResource().createDirectory(path);
}
}

34
designer-base/src/main/java/com/fr/design/fun/LocalResourceProvider.java

@ -0,0 +1,34 @@
package com.fr.design.fun;
import com.fr.design.file.TemplateResource;
import com.fr.file.filetree.FileNodes;
import com.fr.stable.fun.mark.Immutable;
/**
* 本地资源操作插件接口
*
* @author hades
* @version 10.0
* Created by hades on 2020/12/22
*/
public interface LocalResourceProvider extends Immutable {
String XML_TAG = "LocalResourceProvider";
int CURRENT_LEVEL = 1;
/**
* eg: DefaultResourceOperation
*
* @return 目录/模板的各种操作
*/
TemplateResource createResourceOperation();
/**
* eg: LocalFileNodes
*
* @return 构建目录树的方式
*/
FileNodes createFileNodes();
}

19
designer-base/src/main/java/com/fr/design/fun/TemplateTreeDefineProcessor.java

@ -0,0 +1,19 @@
package com.fr.design.fun;
import com.fr.stable.fun.mark.Immutable;
import java.awt.event.MouseEvent;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/14
*/
public interface TemplateTreeDefineProcessor extends Immutable {
String XML_TAG = "TemplateTreeDefineProcessor";
int CURRENT_LEVEL = 1;
void rightClickAction(MouseEvent mouseEvent);
}

23
designer-base/src/main/java/com/fr/design/fun/impl/AbstractLocalResourceProvider.java

@ -0,0 +1,23 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.LocalResourceProvider;
import com.fr.stable.fun.mark.API;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/22
*/
@API(level = LocalResourceProvider.CURRENT_LEVEL)
public abstract class AbstractLocalResourceProvider implements LocalResourceProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

24
designer-base/src/main/java/com/fr/design/fun/impl/AbstractTemplateTreeDefineProcessor.java

@ -0,0 +1,24 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.TemplateTreeDefineProcessor;
import com.fr.stable.fun.mark.API;
/**
* @author hades
* @version 10.0
* Created by hades on 2020/12/21
*/
@API(level = TemplateTreeDefineProcessor.CURRENT_LEVEL)
public abstract class AbstractTemplateTreeDefineProcessor implements TemplateTreeDefineProcessor {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public int layerIndex() {
return DEFAULT_LAYER_INDEX;
}
}

31
designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java

@ -1,6 +1,7 @@
package com.fr.design.gui.core;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.form.ui.*;
import com.fr.general.ComparatorUtils;
@ -127,27 +128,27 @@ public abstract class WidgetOption implements Serializable {
}
public static final WidgetOption DATEEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Date"),
BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/date_16.png"),
"/com/fr/design/images/buttonicon/widget/date_16",
DateEditor.class);
public static final WidgetOption TREE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_View_Tree"),
BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/tree_16.png"), TreeEditor.class);
"/com/fr/design/images/buttonicon/widget/tree_16", TreeEditor.class);
public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/comboboxtree.png"),
public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), "/com/fr/design/images/buttonicon/widget/comboboxtree16",
TreeComboBoxEditor.class);
public static final WidgetOption CHECKBOXGROUP = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/checkbox_group_16.png"), CheckBoxGroup.class);
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), "/com/fr/design/images/buttonicon/widget/checkbox_group_16", CheckBoxGroup.class);
public static final WidgetOption RADIOGROUP = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_group_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), "/com/fr/design/images/buttonicon/widget/button_group_16",
RadioGroup.class);
public static final WidgetOption NUMBEREDITOR = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/number_field_16.png"), NumberEditor.class);
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), "/com/fr/design/images/buttonicon/widget/number_field_16", NumberEditor.class);
public static final WidgetOption LABEL = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/label_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), "/com/fr/design/images/buttonicon/widget/label_16",
Label.class);
public static final WidgetOption BUTTON = WidgetOptionFactory.createByWidgetClass(
@ -155,23 +156,23 @@ public abstract class WidgetOption implements Serializable {
Button.class);
public static final WidgetOption FREEBUTTON = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Button"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Button"), "/com/fr/design/images/buttonicon/widget/button_16",
FreeButton.class);
public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/files_up.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), "/com/fr/design/images/buttonicon/widget/files_up",
MultiFileEditor.class);
public static final WidgetOption COMBOBOX = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_box_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), "/com/fr/design/images/buttonicon/widget/combo_box_16",
ComboBox.class);
public static final WidgetOption COMBOCHECKBOX = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_check_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), "/com/fr/design/images/buttonicon/widget/combo_check_16",
ComboCheckBox.class);
public static final WidgetOption CHECKBOX = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/check_box_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), "/com/fr/design/images/buttonicon/widget/check_box_16",
CheckBox.class);
public static final WidgetOption LIST = WidgetOptionFactory.createByWidgetClass(
@ -181,16 +182,16 @@ public abstract class WidgetOption implements Serializable {
public static final WidgetOption TEXTEDITOR = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Text")
, BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_field_16.png"),
, "/com/fr/design/images/buttonicon/widget/text_field_16",
TextEditor.class);
public static final WidgetOption TEXTAREA = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_area_16.png"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), "/com/fr/design/images/buttonicon/widget/text_area_16",
TextArea.class);
public static final WidgetOption PASSWORD = WidgetOptionFactory.createByWidgetClass(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Password"),
BaseUtils.readIcon("/com/fr/design/images/buttonicon/widget/password_field_16.png"), Password.class);
"/com/fr/design/images/buttonicon/widget/password_field_16", Password.class);
public static final WidgetOption IFRAMEDITOR = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Form_Iframe"), BaseUtils.readIcon("/com/fr/web/images/form/resources/iframe_16.png"),
IframeEditor.class);

6
designer-base/src/main/java/com/fr/design/gui/core/WidgetOptionFactory.java

@ -1,6 +1,7 @@
package com.fr.design.gui.core;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.form.ui.Widget;
import javax.swing.*;
@ -14,4 +15,9 @@ public class WidgetOptionFactory {
public static WidgetOption createByWidgetClass(String optionName, Icon optionIcon, Class<? extends Widget> widgetClass) {
return new CustomWidgetOption(optionName, optionIcon, widgetClass);
}
public static WidgetOption createByWidgetClass(String optionName, String resource, Class<? extends Widget> widgetClass) {
Icon optionIcon = IconUtils.readIcon(resource);
return new CustomWidgetOption(optionName, optionIcon, widgetClass);
}
}

9
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java

@ -3,6 +3,7 @@ package com.fr.design.gui.ibutton;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.base.GraphHelper;
import com.fr.base.svg.IconUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -97,6 +98,14 @@ public class UIButton extends JButton implements UIObserver, UITextComponent {
initListener();
}
public UIButton(String resource, boolean needSetDisabledIcon) {
super(IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_NORMAL));
if (needSetDisabledIcon) {
this.setDisabledIcon(IconUtils.readSVGIcon(resource, IconUtils.ICON_TYPE_DISABLED));
}
init();
}
protected void initListener() {
if (shouldResponseChangeListener()) {
this.addActionListener(new ActionListener() {

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

@ -106,6 +106,13 @@ public class TableViewList extends UIList {
if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
}
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource);
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas;
for (String schema : schemas) {
DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema);
}
return processDataInAnotherThread(databaseName, searchFilter, typesFilter);
}

2
designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java

@ -26,7 +26,7 @@ public class IconPathConstants {
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png";
public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png";
public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/remove.png";
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png";
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png";
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png";

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

@ -17,7 +17,6 @@ import com.fr.design.file.FileToolbarStateChangeListener;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
@ -58,7 +57,6 @@ import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
@ -318,7 +316,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public NewFolderAction() {
this.setName(KeySetUtils.NEW_FOLDER.getMenuKeySetName());
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/icon_NewFolderIcon_normal.png"));
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/new_folder");
}
@Override
@ -344,7 +342,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private class VcsAction extends UpdateAction {
public VcsAction() {
this.setSmallIcon(VcsHelper.VCS_LIST_PNG);
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/vcs_list");
}
@Override
@ -426,7 +424,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public ShowInExplorerAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_In_Containing_Folder"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/view_folder.png"));
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/view_folder");
}
@Override
@ -443,7 +441,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public RefreshTreeAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(UIConstants.REFRESH_ICON);
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/refresh");
}
@Override
@ -461,7 +459,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public RenameAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Rename"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/source/rename.png"));
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/rename");
}
@Override
@ -500,7 +498,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public DelFileAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Remove"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png"));
this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/remove");
}
@Override

20
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -1,7 +1,8 @@
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -105,7 +106,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
FORM_REPORT, // 表单报表块
POLY, // 聚合报表
POLY_REPORT, // 聚合报表-报表块
POLY_CHART, // 聚合报表-图表块
POLY_CHART(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 聚合报表-图表块
AUTHORITY_EDITION, // 权限编辑
AUTHORITY_EDITION_DISABLED; // 权限编辑
@ -701,9 +702,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 完整icon路径为 ICON_BASE_DIR + btnIconName + iconSuffix
private static final String ICON_BASE_DIR = "/com/fr/design/images/buttonicon/propertiestab/";
private static final String ICON_SUFFIX_NORMAL = "_normal.png";
private static final String ICON_SUFFIX_DISABLED = "_disabled.png";
private static final String ICON_SUFFIX_SELECTED = "_selected.png";
private static final String ICON_SUFFIX_NORMAL = "_normal.svg";
private static final String ICON_SUFFIX_DISABLED = "_disabled.svg";
private static final String ICON_SUFFIX_SELECTED = "_selected.svg";
private static final int ICON_WIDTH = 18;
private static final int ICON_HEIGHT = 18;
private String btnIconName;
private String iconBaseDir;
private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一
@ -888,7 +891,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void resetButtonIcon() {
if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) {
iconSuffix = ICON_SUFFIX_NORMAL;
button.setIcon(BaseUtils.readIcon(getBtnIconUrl()));
button.setIcon(IconUtils.readIcon(getBtnIconUrl()));
button.setBackground(originBtnBackground);
button.setOpaque(false);
}
@ -897,7 +900,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
public void setTabButtonSelected() {
resetPropertyIcons();
iconSuffix = ICON_SUFFIX_SELECTED;
button.setIcon(BaseUtils.readIcon(getBtnIconUrl()));
button.setIcon(IconUtils.readIcon(getBtnIconUrl()));
button.setBackground(selectedBtnBackground);
button.setOpaque(true);
selectedItem = this;
@ -908,7 +911,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
private void initButton() {
button = new UIButton(BaseUtils.readIcon(getBtnIconUrl())) {
button = new UIButton(IconUtils.readIcon(getBtnIconUrl())) {
public Dimension getPreferredSize() {
return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT);
}
@ -921,6 +924,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
}
};
button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED));
button.set4LargeToolbarButton();
button.setUI(new UIButtonUI() {
@Override

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

@ -3,7 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.io.BaseBook;
import com.fr.base.iofile.attr.DesignBanCopyAttrMark;
import com.fr.base.iofile.attr.TemplateIdAttrMark;
@ -24,6 +23,7 @@ import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.dialog.InformationWarnPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.TemplateResourceManager;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.fun.DesignerFrameUpButtonProvider;
import com.fr.design.fun.MenuHandler;
@ -49,6 +49,7 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.preview.PagePreview;
import com.fr.design.write.submit.DBManipulationInWidgetEventPane;
import com.fr.design.write.submit.DBManipulationPane;
import com.fr.event.EventDispatcher;
import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.MemFILE;
@ -107,7 +108,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
private DesignModelAdapter<T, ?> designModel;
private PreviewProvider previewType;
protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer();
public int resolution = ScreenResolution.getScreenResolution();
private PluginEventListener pluginListener;
@ -125,6 +125,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public JTemplate(T t, FILE file, boolean isNewFile) {
super(t);
beforeInit();
// 判断是否切换设计器状态到禁止拷贝剪切
if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT);
@ -301,6 +302,20 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
/**
* 模板初始化之前
*/
private void beforeInit() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_INIT, this);
}
/**
* 模板激活之前之前
*/
protected void beforeActive() {
EventDispatcher.fire(JTemplateEvent.BEFORE_TEMPLATE_ACTIVE, this);
}
/**
* 模板关闭时
*/
@ -309,6 +324,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
PluginListenerRegistration.getInstance().stopListen(this.pluginListener);
}
/**
* 刷新内部资源
*
@ -797,7 +813,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
return false;
}
try {
this.getTarget().export(editingFILE.asOutputStream());
this.getTarget().export(TemplateResourceManager.getResource().saveTemplate(editingFILE));
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), e.getMessage(), "Save Error", JOptionPane.ERROR_MESSAGE);
@ -1076,6 +1092,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活指定的template
*/
public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this);
}
@ -1083,6 +1100,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活已存在的模板
*/
public void activeOldJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().activateJTemplate(this);
}
@ -1090,6 +1108,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* 激活新的模板
*/
public void activeNewJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().addAndActivateJTemplate(this);
}

19
designer-base/src/main/java/com/fr/design/mainframe/JTemplateEvent.java

@ -0,0 +1,19 @@
package com.fr.design.mainframe;
import com.fr.event.Event;
/**
* Created by kerry on 2020-12-11
*/
public enum JTemplateEvent implements Event<JTemplate> {
/**
* 模板初始化之前
*/
BEFORE_TEMPLATE_INIT,
/**
* 模板激活之前
*/
BEFORE_TEMPLATE_ACTIVE
}

3
designer-base/src/main/java/com/fr/design/mainframe/JVirtualTemplate.java

@ -208,6 +208,7 @@ public class JVirtualTemplate extends JTemplate {
@Override
public void activeJTemplate(int index, JTemplate jt) {
beforeActive();
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList();
historyList.set(index, jt);
DesignerContext.getDesignerFrame().addAndActivateJTemplate(jt);
@ -217,11 +218,13 @@ public class JVirtualTemplate extends JTemplate {
@Override
public void activeOldJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
}
@Override
public void activeNewJTemplate() {
beforeActive();
DesignerContext.getDesignerFrame().openTemplate(this.getEditingFILE());
}

1
designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.vcs.common;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.file.HistoryTemplateListCache;

6
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -1,6 +1,6 @@
package com.fr.design.menu;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.*;
import com.fr.design.gui.iscrollbar.UIScrollBar;
@ -166,7 +166,7 @@ public class MenuDef extends ShortCut {
public UIButton createUIButton() {
if (createdButton == null) {
if (iconPath != null) {
createdButton = new UIButton(BaseUtils.readIcon(iconPath));
createdButton = new UIButton(IconUtils.readIcon(iconPath));
createdButton.set4ToolbarButton();
} else {
createdButton = new UIButton(name);
@ -194,7 +194,7 @@ public class MenuDef extends ShortCut {
createdJMenu = createJMenu0();
createdJMenu.setMnemonic(this.getMnemonic());
if (this.iconPath != null) {
createdJMenu.setIcon(BaseUtils.readIcon(this.iconPath));
createdJMenu.setIcon(IconUtils.readIcon(iconPath));
}
MenuListener menuListener = createMenuListener();
createdJMenu.addMenuListener(menuListener);

4
designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java

@ -1,6 +1,6 @@
package com.fr.design.remote.action;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -27,7 +27,7 @@ public class RemoteDesignAuthManagerAction extends UpdateAction {
public RemoteDesignAuthManagerAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Authority_Manager"));
// 远程设计权限管理
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x.png"));
this.setSmallIcon("com/fr/design/remote/images/icon_Remote_Design_Auth_Manager_normal@1x");
}

4
designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java

@ -1,5 +1,6 @@
package com.fr.design.report.fit.menupane;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -8,7 +9,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.IOUtils;
import com.fr.report.fit.FitProvider;
import com.fr.report.fit.ReportFitAttr;
@ -66,7 +66,7 @@ public class ReportFitAttrAction extends JTemplateAction {
}
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/reportfit/fit.png"));
this.setSmallIcon("/com/fr/design/images/reportfit/fit");
}
/**

2
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -254,7 +254,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(UIConstants.REFRESH_ICON);
this.setSmallIcon("/com/fr/design/images/buttonicon/refresh");
}
@Override

5
designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java

@ -3,7 +3,8 @@
*/
package com.fr.design.style.color;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
@ -34,7 +35,7 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi
private UIObserverListener uiObserverListener;
public UIToolbarColorButton(Icon icon) {
super(new UIColorButton(icon), new UIButton(BaseUtils.readIcon("/com/fr/design/images/gui/popup.gif")));
super(new UIColorButton(icon), new UIButton(IconUtils.readIcon("/com/fr/design/images/gui/popup")));
getLeftButton().setEventBanned(true);
getRightButton().addFocusListener(new FocusListener() {

4
designer-base/src/main/java/com/fr/design/update/actions/SoftwareUpdateAction.java

@ -1,6 +1,6 @@
package com.fr.design.update.actions;
import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.os.impl.UpdateDialogAction;
import com.fr.stable.os.support.OSBasedAction;
@ -15,7 +15,7 @@ public class SoftwareUpdateAction extends UpdateAction {
public SoftwareUpdateAction() {
setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_UpdateAndUpgrade"));
setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update/update_new.png"));
setSmallIcon("/com/fr/design/images/update/update_new");
}

37
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -19,6 +19,30 @@ import java.awt.Component;
* Created by plough on 2017/8/7.
*/
public class WidgetBoundsPaneFactory {
public enum NameAttribute {
//默认的名称
DEFAULT(Toolkit.i18nText("Fine-Design_Basic_Component_Position"), Toolkit.i18nText("Fine-Design_Basic_Component_Size")),
//控件对应的名称
WIDGET(Toolkit.i18nText("Fine-Design_Basic_Widget_Position"), Toolkit.i18nText("Fine-Design_Basic_Widget_Size"));
private String positionName;
private String sizeName;
NameAttribute(String positionName, String sizeName) {
this.positionName = positionName;
this.sizeName = sizeName;
}
public String getPositionName() {
return positionName;
}
public String getSizeName() {
return sizeName;
}
}
private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
@ -37,7 +61,8 @@ public class WidgetBoundsPaneFactory {
boundsPane.add(panel);
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane);
}
public static JPanel createRightPane(Component com1, Component com2){
public static JPanel createRightPane(Component com1, Component com2) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};
@ -49,16 +74,16 @@ public class WidgetBoundsPaneFactory {
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L6, IntervalConstants.INTERVAL_L1);
}
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) {
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height, NameAttribute nameAttribute) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] northComponents = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Position")), createRightPane(x, y)},
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getPositionName()), createRightPane(x, y)},
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))},
};
Component[][] centerComponents = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)},
new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
};
double[] rowSize = {p, p};
@ -74,6 +99,10 @@ public class WidgetBoundsPaneFactory {
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 230, 24, boundsPane);
}
public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) {
return createAbsoluteBoundsPane(x, y, width, height, NameAttribute.DEFAULT);
}
public static UIExpandablePane createCardTagBoundPane(UISpinner width) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

2
designer-base/src/main/java/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -150,6 +150,7 @@ public class NumberEditorValidatePane extends JPanel {
setMaxListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) {
maxValueSpinner.setEnabled(true);
Double value = (double) 0;
@ -171,6 +172,7 @@ public class NumberEditorValidatePane extends JPanel {
setMinListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
errorMsgTextFieldPane.setVisible(setMaxValueCheckBox.isSelected() || setMinValueCheckBox.isSelected());
if (setMinValueCheckBox.isSelected()) {
minValueSpinner.setEnabled(true);
Double value = (double) 0;

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

@ -0,0 +1,108 @@
package com.fr.env;
import com.fr.design.actions.server.PluginManagerAction;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Locale;
/**
* 插件启动失败提示窗
*/
public class PluginErrorRemindDialog extends JDialog implements ActionListener {
public PluginErrorRemindDialog(Frame parent, String areaText) {
super(parent, true);
//上面的标签面板
JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
JPanel imagePanel = new JPanel();
Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png");
JLabel imageLabel = new JLabel();
imageLabel.setIcon(icon);
imagePanel.add(imageLabel);
imagePanel.setPreferredSize(new Dimension(130, 100));
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title"));
label.setFont(FRFont.getInstance().applySize(18).applyStyle(1));
label.setPreferredSize(new Dimension(650, 100));
verticalPanel.add(label);
topPanel.add(imagePanel, BorderLayout.WEST);
topPanel.add(verticalPanel, BorderLayout.CENTER);
topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
//中间的文本域面板
JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
centerPanel.setPreferredSize(new Dimension(480, 320));
JTextArea checkArea = new JTextArea(areaText);
checkArea.setEnabled(false);
centerPanel.add(checkArea, BorderLayout.CENTER);
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With"));
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With"));
cancelButton.addActionListener(this);
okButton.addActionListener(new PluginManagerActionAdapter(this));
// 按钮
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));
buttonPanel.add(cancelButton);
buttonPanel.add(okButton);
this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"));
this.setResizable(false);
this.add(topPanel, BorderLayout.NORTH);
this.add(centerPanel, BorderLayout.CENTER);
this.add(buttonPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500));
GUICoreUtils.centerWindow(this);
}
@Override
public void actionPerformed(ActionEvent e) {
this.dispose();
}
private static class PluginManagerActionAdapter extends PluginManagerAction {
private JDialog jDialog;
public PluginManagerActionAdapter(JDialog jDialog) {
this.jDialog = jDialog;
}
@Override
public void actionPerformed(ActionEvent e) {
this.jDialog.dispose();
super.actionPerformed(e);
}
}
}

18
designer-base/src/main/java/com/fr/file/FileNodeFILE.java

@ -2,6 +2,7 @@ package com.fr.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.file.TemplateResourceManager;
import com.fr.io.FineEncryptUtils;
import com.fr.base.io.XMLEncryptUtils;
import com.fr.design.file.NodeAuthProcessor;
@ -22,10 +23,8 @@ import com.fr.workspace.WorkContext;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
import com.fr.workspace.resource.WorkResourceTempRenameStream;
import com.fr.workspace.server.lock.TplOperator;
import javax.swing.*;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
@ -324,7 +323,7 @@ public class FileNodeFILE implements FILE {
}
try {
return WorkContext.getWorkResource().exist(node.getEnvPath());
return TemplateResourceManager.getResource().exist(node.getEnvPath());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return false;
@ -379,14 +378,11 @@ public class FileNodeFILE implements FILE {
if (!envPath.startsWith(ProjectConstants.REPORTLETS_NAME)) {
return null;
}
InputStream in = new ByteArrayInputStream(
WorkContext.getCurrent().get(TplOperator.class).readAndLockFile(
StableUtils.pathJoin(
ProjectConstants.REPORTLETS_NAME,
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1)
)
)
);
InputStream in = TemplateResourceManager.getResource().readTemplate(
StableUtils.pathJoin(
ProjectConstants.REPORTLETS_NAME,
envPath.substring(ProjectConstants.REPORTLETS_NAME.length() + 1)
));
return envPath.endsWith(".cpt") || envPath.endsWith(".frm")
? XMLEncryptUtils.decodeInputStream(EncryptUtils.decodeInputStream(FineEncryptUtils.decode(in))) : in;

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

8
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_NewFolderIcon_disable</title>
<g id="icon_NewFolderIcon_disable" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M7,2 L14,2 C14.55,2 15,2.45 15,3 L15,4.26865267 C14.7056021,4.09786765 14.363952,4 14,4 L9,4 C8.82858946,4 8.52433038,3.81190466 8.44778989,3.65851255 L8.33972031,3.4443888 C8.01577562,2.79516387 7.33247527,2.27587935 6.60444984,2.08202852 C6.7259209,2.02927911 6.85970721,2 7,2 Z M10,14 L2,14 C1.45,14 1,13.55 1,13 L1,4 C1,3.45 1.45,3 2,3 L6,3 C6.55,3 7.201,3.402 7.447,3.895 L7.553,4.105 C7.799,4.598 8.45,5 9,5 L14,5 C14.55,5 15,5.45 15,6 L15,9 L14,9 L14,6 L9,6 C8.07067731,6 7.07334254,5.38343985 6.66027969,4.5556112 L6.55221011,4.34148745 C6.47566962,4.18809534 6.17141054,4 6,4 L2,4 L2,13 L10,13 L10,14 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
<path d="M12.5,8 C12.7761424,8 13,8.22385763 13,8.5 L13,11 L15.5,11 C15.7761424,11 16,11.2238576 16,11.5 C16,11.7761424 15.7761424,12 15.5,12 L13,12 L13,14.5 C13,14.7761424 12.7761424,15 12.5,15 C12.2238576,15 12,14.7761424 12,14.5 L12,12 L9.5,12 C9.22385763,12 9,11.7761424 9,11.5 C9,11.2238576 9.22385763,11 9.5,11 L12,11 L12,8.5 C12,8.22385763 12.2238576,8 12.5,8 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

8
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>icon_NewFolderIcon_normal</title>
<g id="icon_NewFolderIcon_normal" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M7,2 L14,2 C14.55,2 15,2.45 15,3 L15,4.26865267 C14.7056021,4.09786765 14.363952,4 14,4 L9,4 C8.82858946,4 8.52433038,3.81190466 8.44778989,3.65851255 L8.33972031,3.4443888 C8.01577562,2.79516387 7.33247527,2.27587935 6.60444984,2.08202852 C6.7259209,2.02927911 6.85970721,2 7,2 Z M10,14 L2,14 C1.45,14 1,13.55 1,13 L1,4 C1,3.45 1.45,3 2,3 L6,3 C6.55,3 7.201,3.402 7.447,3.895 L7.553,4.105 C7.799,4.598 8.45,5 9,5 L14,5 C14.55,5 15,5.45 15,6 L15,9 L14,9 L14,6 L9,6 C8.07067731,6 7.07334254,5.38343985 6.66027969,4.5556112 L6.55221011,4.34148745 C6.47566962,4.18809534 6.17141054,4 6,4 L2,4 L2,13 L10,13 L10,14 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
<path d="M12.5,8 C12.7761424,8 13,8.22385763 13,8.5 L13,11 L15.5,11 C15.7761424,11 16,11.2238576 16,11.5 C16,11.7761424 15.7761424,12 15.5,12 L13,12 L13,14.5 C13,14.7761424 12.7761424,15 12.5,15 C12.2238576,15 12,14.7761424 12,14.5 L12,12 L9.5,12 C9.22385763,12 9,11.7761424 9,11.5 C9,11.2238576 9.22385763,11 9.5,11 L12,11 L12,8.5 C12,8.22385763 12.2238576,8 12.5,8 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh_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="M13.0593807,1 C13.4802225,1 13.8213822,1.34115968 13.8213822,1.76200147 L13.8213822,1.76200147 L13.8213822,5.2534957 C13.8213822,5.67433749 13.4802225,6.01549717 13.0593807,6.01549717 L13.0593807,6.01549717 L9.56788646,6.01549717 C9.14704467,6.01549717 8.80588499,5.67433749 8.80588499,5.2534957 C8.80588499,4.83265391 9.14704467,4.49149423 9.56788646,4.49149423 L9.56788646,4.49149423 L11.169634,4.48959417 C10.8434607,4.27112237 10.4895308,4.09123525 10.1125367,3.95402064 C7.56533579,3.02691531 4.74885407,4.34026231 3.82174874,6.88746326 C2.89464341,9.43466421 4.20799041,12.2511459 6.75519136,13.1782513 C9.30239231,14.1053566 12.118874,12.7920096 13.0459794,10.2448086 C13.1899157,9.84934672 13.6271844,9.64544497 14.0226464,9.78938133 C14.4181083,9.9333177 14.62201,10.3705864 14.4780737,10.7660483 C13.2630956,14.1041731 9.57207646,15.8253236 6.23395166,14.6103456 C2.89582685,13.3953675 1.17467636,9.70434836 2.38965442,6.36622356 C3.60463249,3.02809876 7.29565164,1.30694826 10.6337764,2.52192632 C11.3047108,2.76612647 11.9217951,3.11486447 12.467588,3.55405023 L12.297,3.423 L12.2973792,1.76200147 C12.2973792,1.37622983 12.5840481,1.05741329 12.9559816,1.00695618 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_disabled.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_删除_disabled</title>
<g id="icon_删除_disabled" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 610 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove_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 copy</title>
<g id="icon_删除_normal-copy" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<path d="M11,1 L11,3 L15,3 L15,4 L13,4 L13,15 L3,15 L3,4 L1,4 L1,3 L5,3 L5,1 L11,1 Z M12,4 L4,4 L4,14 L12,14 L12,4 Z M7,6 L7,12 L6,12 L6,6 L7,6 Z M10,6 L10,12 L9,12 L9,6 L10,6 Z M10,2 L6,2 L6,3 L10,3 L10,2 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 602 B

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_disabled.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_重命名_disable</title>
<g id="icon_重命名_disable" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M16,1.875 L16,14.875 L2,14.875 L2,10.875 L3,10.875 L3,13.875 L10.9999,13.8756 L10.9999,9.8746 L15,9.874 L15,2.875 L11,2.875 L11,1.875 L16,1.875 Z M15.0009,11.8756 L13.9999,11.8756 L13.9999,12.8756 L12.9999,12.8756 L12.9999,13.8756 L15.0009,13.8756 L15.0009,11.8756 Z M13.9379,10.8756 L11.9999,10.8756 L11.9999,12.8756 L12.9999,12.8756 L12.9999,11.8756 L13.9379,11.8756 L13.9379,10.8756 Z M7,1 L7.00095826,3.17100877 C7.10111582,3.20644169 7.1988298,3.24704235 7.29377984,3.2924904 L8.8281,1.757 L10.2421,3.171 L8.70798211,4.70720778 C8.75338867,4.80216052 8.79394842,4.89987512 8.82934116,5.00003141 L11,5 L11,7 L8.82899123,7.00095826 C8.79343547,7.10146305 8.75267608,7.19950728 8.70703675,7.29476726 L10.242,8.8291 L8.828,10.2431 L7.29279222,8.70798211 C7.19815226,8.7532391 7.1007686,8.79368115 7.00095826,8.82899123 L7,11 L5,11 L5.00003141,8.82934116 C4.89952784,8.79382569 4.80148292,8.75310733 4.70622016,8.7075096 L3.1719,10.243 L1.7579,8.829 L3.29201789,7.29279222 C3.2467609,7.19815226 3.20631885,7.1007686 3.17100877,7.00095826 L1,7 L1,5 L3.17065884,5.00003141 C3.20629703,4.89918056 3.24717413,4.80080537 3.29296325,4.70523274 L1.758,3.1709 L3.172,1.7569 L4.70720778,3.29201789 C4.80216052,3.24661133 4.89987512,3.20605158 5.00003141,3.17065884 L5,1 L7,1 Z M6,4 C4.897,4 4,4.897 4,6 C4,7.103 4.897,8 6,8 C7.103,8 8,7.103 8,6 C8,4.897 7.103,4 6,4 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename_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="M16,1.875 L16,14.875 L2,14.875 L2,10.875 L3,10.875 L3,13.875 L10.9999,13.8756 L10.9999,9.8746 L15,9.874 L15,2.875 L11,2.875 L11,1.875 L16,1.875 Z M15.0009,11.8756 L13.9999,11.8756 L13.9999,12.8756 L12.9999,12.8756 L12.9999,13.8756 L15.0009,13.8756 L15.0009,11.8756 Z M13.9379,10.8756 L11.9999,10.8756 L11.9999,12.8756 L12.9999,12.8756 L12.9999,11.8756 L13.9379,11.8756 L13.9379,10.8756 Z M7,1 L7.00095826,3.17100877 C7.10111582,3.20644169 7.1988298,3.24704235 7.29377984,3.2924904 L8.8281,1.757 L10.2421,3.171 L8.70798211,4.70720778 C8.75338867,4.80216052 8.79394842,4.89987512 8.82934116,5.00003141 L11,5 L11,7 L8.82899123,7.00095826 C8.79343547,7.10146305 8.75267608,7.19950728 8.70703675,7.29476726 L10.242,8.8291 L8.828,10.2431 L7.29279222,8.70798211 C7.19815226,8.7532391 7.1007686,8.79368115 7.00095826,8.82899123 L7,11 L5,11 L5.00003141,8.82934116 C4.89952784,8.79382569 4.80148292,8.75310733 4.70622016,8.7075096 L3.1719,10.243 L1.7579,8.829 L3.29201789,7.29279222 C3.2467609,7.19815226 3.20631885,7.1007686 3.17100877,7.00095826 L1,7 L1,5 L3.17065884,5.00003141 C3.20629703,4.89918056 3.24717413,4.80080537 3.29296325,4.70523274 L1.758,3.1709 L3.172,1.7569 L4.70720778,3.29201789 C4.80216052,3.24661133 4.89987512,3.20605158 5.00003141,3.17065884 L5,1 L7,1 Z M6,4 C4.897,4 4,4.897 4,6 C4,7.103 4.897,8 6,8 C7.103,8 8,7.103 8,6 C8,4.897 7.103,4 6,4 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.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_版本管理_disabled</title>
<g id="icon_版本管理_disabled" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M12,13 C12,14.1045695 11.1045695,15 10,15 L10,15 L3,15 C1.8954305,15 1,14.1045695 1,13 L1,13 L1,6 C1,4.8954305 1.8954305,4 3,4 L3,4 L4,4 L4,3 C4,1.8954305 4.8954305,1 6,1 L13,1 C14.1045695,1 15,1.8954305 15,3 L15,10 C15,11.1045695 14.1045695,12 13,12 L12,12 Z M13,2 L6,2 C5.44771525,2 5,2.44771525 5,3 L5,10 C5,10.5522847 5.44771525,11 6,11 L13,11 C13.5522847,11 14,10.5522847 14,10 L14,3 C14,2.44771525 13.5522847,2 13,2 Z M6,12 C4.8954305,12 4,11.1045695 4,10 L4,5 L3,5 C2.44771525,5 2,5.44771525 2,6 L2,6 L2,13 C2,13.5522847 2.44771525,14 3,14 L3,14 L10,14 C10.5522847,14 11,13.5522847 11,13 L11,13 L11,12 L6,12 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list_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="M12,13 C12,14.1045695 11.1045695,15 10,15 L10,15 L3,15 C1.8954305,15 1,14.1045695 1,13 L1,13 L1,6 C1,4.8954305 1.8954305,4 3,4 L3,4 L4,4 L4,3 C4,1.8954305 4.8954305,1 6,1 L13,1 C14.1045695,1 15,1.8954305 15,3 L15,10 C15,11.1045695 14.1045695,12 13,12 L12,12 Z M13,2 L6,2 C5.44771525,2 5,2.44771525 5,3 L5,10 C5,10.5522847 5.44771525,11 6,11 L13,11 C13.5522847,11 14,10.5522847 14,10 L14,3 C14,2.44771525 13.5522847,2 13,2 Z M6,12 C4.8954305,12 4,11.1045695 4,10 L4,5 L3,5 C2.44771525,5 2,5.44771525 2,6 L2,6 L2,13 C2,13.5522847 2.44771525,14 3,14 L3,14 L10,14 C10.5522847,14 11,13.5522847 11,13 L11,13 L11,12 L6,12 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.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_打开文件_disable</title>
<g id="icon_打开文件_disable" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" opacity="0.3">
<path d="M16,1 L16,14.937 L0,14.937 L0,1 L16,1 Z M3,4.937 L1,4.937 L1,13.937 L7,13.937 L7.001,12.937 L3,12.937 L3,4.937 Z M9,11.937 L9,13.937 L15,13.937 L15,4.937 L4,4.937 L4,5.937 L9,5.937 L9,7.937 L7,7.937 L7.001,6.937 L4,6.937 L4,8.937 L9,8.937 L9,10.937 L7,10.937 L7.001,9.937 L4,9.937 L4,11.937 L9,11.937 Z M15,1.937 L1,1.937 L1,3.937 L15,3.937 L15,1.937 Z" id="Combined-Shape" fill="#333334"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 774 B

7
designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder_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="M15,1 C15.5522847,1 16,1.44771525 16,2 L16,14 C16,14.5522847 15.5522847,15 15,15 L1,15 C0.44771525,15 0,14.5522847 0,14 L0,2 C0,1.44771525 0.44771525,1 1,1 L15,1 Z M3,5 L1,5 L1,14 L7,14 L7,13 L3,13 L3,5 Z M9,12 L9,14 L15,14 L15,5 L4,5 L4,6 L9,6 L9,8 L7,8 L7,7 L4,7 L4,9 L9,9 L9,11 L7,11 L7,10 L4,10 L4,12 L9,12 Z M15,2 L1,2 L1,4 L15,4 L15,2 Z" id="Combined-Shape" fill="#333334" fill-rule="nonzero"></path>
</g>
</svg>

After

Width:  |  Height:  |  Size: 774 B

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save