From 9ffb6ea90f4ef711e8a322ecf4e3ceda49db3123 Mon Sep 17 00:00:00 2001 From: Yvan Date: Wed, 23 Dec 2020 21:24:34 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-42238=20=E3=80=9010.0.13=E3=80=91JDK11?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=9B=BE=E6=A0=87=E6=A8=A1=E7=B3=8A?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BC=98=E5=8C=96=20No.10:=20=E2=91=A0?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E5=BC=80=E5=8F=91=E8=AF=84=E5=AE=A1=E6=84=8F?= =?UTF-8?q?=E8=A7=81=EF=BC=8C=E6=96=B0=E5=A2=9ESVGIconUtils=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=EF=BC=8C=E4=B9=8B=E5=90=8E=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=E9=83=BD=E5=8F=AF=E4=BB=A5=E7=94=A8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=E4=B8=AD=E7=9A=84=E6=96=B9=E6=B3=95=EF=BC=9B?= =?UTF-8?q?=E2=91=A1=E4=BF=AE=E6=94=B9UpdateAction=E3=80=81MenuDef?= =?UTF-8?q?=E3=80=81UIButton=E9=80=82=E9=85=8D=E5=B7=A5=E5=85=B7=E7=B1=BB?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=9B=E2=91=A2=E4=BF=AE=E6=94=B9=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E4=B8=8A=E4=BC=A0=E7=9A=84=E5=9B=BE=E6=A0=87=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=96=B9=E5=BC=8F=E4=BB=A5=E5=8F=8A=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E6=96=B9=E5=BC=8F=EF=BC=9B=E2=91=A3?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E4=BA=86=E8=8F=9C=E5=8D=95=E6=A0=8F-?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E4=B8=AD=E7=9A=84=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=AD=90=E9=A1=B9=E7=9A=84=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/base/svg/IconType.java | 62 +++++++++++ .../main/java/com/fr/base/svg/SVGIcon.java | 11 +- .../java/com/fr/base/svg/SVGIconUtils.java | 104 ++++++++++++++++++ .../main/java/com/fr/base/svg/SVGLoader.java | 25 +++-- .../actions/AllowAuthorityEditAction.java | 4 +- .../actions/ExitAuthorityEditAction.java | 3 +- .../design/actions/TableDataSourceAction.java | 4 +- .../com/fr/design/actions/UpdateAction.java | 31 +++++- .../fr/design/actions/edit/CopyAction.java | 4 +- .../com/fr/design/actions/edit/CutAction.java | 5 +- .../fr/design/actions/edit/PasteAction.java | 4 +- .../fr/design/actions/edit/RedoAction.java | 4 +- .../fr/design/actions/edit/UndoAction.java | 4 +- .../actions/file/OpenTemplateAction.java | 4 +- .../actions/file/SaveAsTemplateAction.java | 4 +- .../actions/file/SaveTemplateAction.java | 4 +- .../design/actions/file/SwitchExistEnv.java | 8 +- .../actions/server/ConnectionListAction.java | 6 +- .../com/fr/design/constants/UIConstants.java | 4 +- .../design/data/BasicTableDataTreePane.java | 6 +- .../data/datapane/TableDataTreePane.java | 7 +- .../data/datapane/sqlpane/SQLEditPane.java | 2 +- .../com/fr/design/gui/core/WidgetOption.java | 32 +++--- .../com/fr/design/gui/ibutton/UIButton.java | 11 +- .../com/fr/design/icon/IconPathConstants.java | 2 +- .../DesignerFrameFileDealerPane.java | 18 +-- .../mainframe/EastRegionContainerPane.java | 11 +- .../mainframe/vcs/common/VcsHelper.java | 4 +- .../main/java/com/fr/design/menu/MenuDef.java | 13 +-- .../fit/menupane/ReportFitAttrAction.java | 3 +- .../style/color/UIToolbarColorButton.java | 5 +- .../images/FileDealerPaneIcon/new_folder.png | Bin 0 -> 288 bytes .../images/FileDealerPaneIcon/refresh.png | Bin 0 -> 530 bytes .../images/FileDealerPaneIcon/remove.png | Bin 0 -> 167 bytes .../images/FileDealerPaneIcon/rename.png | Bin 0 -> 433 bytes .../images/FileDealerPaneIcon/vcs_list.png | Bin 0 -> 286 bytes .../images/FileDealerPaneIcon/view_folder.png | Bin 0 -> 208 bytes ...6_normal.svg => comboboxtree16_normal.svg} | 0 ..._normal.svg => distanceconnect_normal.svg} | 0 ...ect_normal.svg => localconnect_normal.svg} | 0 .../data/source/dataDictionary_normal.svg | 7 ++ .../fr/design/images/edit/redo_disabled.svg | 7 ++ .../fr/design/images/edit/undo_disabled.svg | 7 ++ .../design/images/expand/cellAttr_normal.svg | 7 ++ .../fr/design/images/m_edit/redo_disabled.svg | 7 ++ .../fr/design/images/m_edit/redo_normal.svg | 7 ++ .../fr/design/images/m_edit/undo_disabled.svg | 7 ++ .../fr/design/images/m_edit/undo_normal.svg | 7 ++ .../images/m_file/repeatAndFrozen_normal.svg | 7 ++ .../images/m_format/cellAttr_normal.svg | 7 ++ .../images/m_format/highlight_normal.svg | 7 ++ .../images/m_format/modified_normal.svg | 7 ++ .../fr/design/images/m_insert/cell_normal.svg | 7 ++ .../design/images/m_insert/float_normal.svg | 7 ++ .../images/m_insert/hyperLink_normal.svg | 7 ++ .../images/m_insert/insertColumn_normal.svg | 13 +++ .../images/m_insert/insertRow_normal.svg | 14 +++ .../m_report/exit_authority_edit_normal.svg | 9 +- ..._attr_normal.svg => linearAttr_normal.svg} | 0 .../design/images/m_report/mobile_normal.svg | 7 ++ ...rameter_report_normal.svg => p_normal.svg} | 0 ...normal.svg => reportEngineAttr_normal.svg} | 0 ..._normal.svg => reportWriteAttr_normal.svg} | 0 ...rmal.svg => webreportattribute_normal.svg} | 0 .../fr/design/images/m_web/style_normal.svg | 7 ++ .../fr/design/images/reportfit/fit_normal.svg | 7 ++ .../com/fr/design/actions/NewFormAction.java | 6 +- .../designer/beans/actions/CopyAction.java | 5 +- .../designer/beans/actions/CutAction.java | 5 +- .../beans/actions/FormDeleteAction.java | 5 +- .../designer/beans/actions/PasteAction.java | 4 +- .../form/parameter/FormParaTargetMode.java | 5 +- .../fr/design/gui/core/FormWidgetOption.java | 10 +- .../design/mainframe/FormParaWidgetPane.java | 4 +- .../fr/design/mainframe/FormTargetMode.java | 5 +- .../java/com/fr/design/mainframe/JForm.java | 2 +- .../actions/cell/CellAttributeAction.java | 6 +- .../actions/cell/CellExpandAttrAction.java | 6 +- .../actions/cell/CellWidgetAttrAction.java | 5 +- .../cell/ConditionAttributesAction.java | 6 +- .../design/actions/cell/EditCellAction.java | 9 +- .../actions/cell/GlobalStyleMenuDef.java | 2 +- .../actions/cell/UIToolbarBorderButton.java | 5 +- .../actions/cell/style/AlignmentAction.java | 9 +- .../cell/style/ReportFontBoldAction.java | 4 +- .../style/ReportFontForegroundAction.java | 6 +- .../cell/style/ReportFontItalicAction.java | 4 +- .../cell/style/ReportFontUnderlineAction.java | 4 +- .../cell/style/StyleBackgroundAction.java | 6 +- .../actions/columnrow/InsertColumnAction.java | 5 +- .../actions/columnrow/InsertRowAction.java | 6 +- .../fr/design/actions/edit/DeleteAction.java | 4 +- .../design/actions/edit/HyperlinkAction.java | 6 +- .../actions/edit/merge/MergeCellAction.java | 5 +- .../actions/edit/merge/UnmergeCellAction.java | 6 +- .../file/newReport/NewPolyReportAction.java | 5 +- .../file/newReport/NewWorkBookAction.java | 5 +- .../actions/insert/cell/BiasCellAction.java | 5 +- .../actions/insert/cell/ChartCellAction.java | 5 +- .../insert/cell/DSColumnCellAction.java | 5 +- .../insert/cell/FormulaCellAction.java | 5 +- .../insert/cell/GeneralCellAction.java | 5 +- .../actions/insert/cell/ImageCellAction.java | 5 +- .../insert/cell/RichTextCellAction.java | 5 +- .../insert/cell/SubReportCellAction.java | 6 +- .../actions/insert/flot/ChartFloatAction.java | 4 +- .../insert/flot/FormulaFloatAction.java | 4 +- .../actions/insert/flot/ImageFloatAction.java | 5 +- .../insert/flot/TextBoxFloatAction.java | 3 +- .../report/ReportBackgroundAction.java | 5 +- .../actions/report/ReportColumnsAction.java | 5 +- .../report/ReportEngineAttrAction.java | 5 +- .../report/ReportExportAttrAction.java | 5 +- .../actions/report/ReportFooterAction.java | 5 +- .../actions/report/ReportHeaderAction.java | 5 +- .../report/ReportMobileAttrAction.java | 3 +- .../actions/report/ReportPageAttrAction.java | 5 +- .../actions/report/ReportPageSetupAction.java | 6 +- .../actions/report/ReportParameterAction.java | 4 +- .../report/ReportPrintSettingAction.java | 5 +- .../actions/report/ReportWatermarkAction.java | 5 +- .../actions/report/ReportWebAttrAction.java | 5 +- .../actions/report/ReportWriteAttrAction.java | 6 +- .../utils/DeprecatedActionManager.java | 4 +- .../fr/design/mainframe/ElementCasePane.java | 3 +- .../mainframe/ElementCasePaneDelegate.java | 2 +- .../design/mainframe/FormatBrushAction.java | 5 +- .../com/fr/design/mainframe/JWorkBook.java | 2 +- .../fr/design/mainframe/SheetNameTabPane.java | 19 ++-- .../fr/poly/actions/DeleteBlockAction.java | 5 +- .../cellquick/CellDSColumnEditor.java | 3 +- .../cellquick/CellRichTextEditor.java | 3 +- .../cellquick/CellSubReportEditor.java | 3 +- .../main/java/com/fr/start/MainDesigner.java | 11 +- .../com/fr/start/preload/ImagePreLoader.java | 25 ++++- 135 files changed, 648 insertions(+), 299 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/base/svg/IconType.java create mode 100644 designer-base/src/main/java/com/fr/base/svg/SVGIconUtils.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png rename designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/{combo_box_tree_16_normal.svg => comboboxtree16_normal.svg} (100%) rename designer-base/src/main/resources/com/fr/design/images/data/bind/{distance_connect_normal.svg => distanceconnect_normal.svg} (100%) rename designer-base/src/main/resources/com/fr/design/images/data/bind/{local_connect_normal.svg => localconnect_normal.svg} (100%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg rename designer-base/src/main/resources/com/fr/design/images/m_report/{linear_attr_normal.svg => linearAttr_normal.svg} (100%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg rename designer-base/src/main/resources/com/fr/design/images/m_report/{parameter_report_normal.svg => p_normal.svg} (100%) rename designer-base/src/main/resources/com/fr/design/images/m_report/{report_engine_attr_normal.svg => reportEngineAttr_normal.svg} (100%) rename designer-base/src/main/resources/com/fr/design/images/m_report/{report_write_attr_normal.svg => reportWriteAttr_normal.svg} (100%) rename designer-base/src/main/resources/com/fr/design/images/m_report/{web_report_attribute_normal.svg => webreportattribute_normal.svg} (100%) create mode 100644 designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg create mode 100644 designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg diff --git a/designer-base/src/main/java/com/fr/base/svg/IconType.java b/designer-base/src/main/java/com/fr/base/svg/IconType.java new file mode 100644 index 000000000..7df9a0954 --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/IconType.java @@ -0,0 +1,62 @@ +package com.fr.base.svg; + +import com.fr.stable.StringUtils; + +/** + * @author Yvan + * @version 10.0 + * Created by Yvan on 2020/12/22 + */ +public enum IconType { + + /** + * png图片转化的Icon + */ + PNG(".png", 0), + /** + * svg图片转化的normalIcon + */ + NORMAL_SVG("_normal", 1), + /** + * SVG图片转化的disabledIcon + */ + DISABLED_SVG("_disabled", 2), + /** + * SVG图片转化的selectedIcon + */ + SELECTED_SVG("_selected", 3); + + private String iconType; + private int iconCode; + + IconType(String iconType, int iconCode) { + this.iconType = iconType; + this.iconCode = iconCode; + } + + public String getIconType() { + return iconType; + } + + public void setIconType(String iconType) { + this.iconType = iconType; + } + + public int getIconCode() { + return iconCode; + } + + public void setIconCode(int iconCode) { + this.iconCode = iconCode; + } + + public static String getIconType(int iconCode) { + for (IconType iconType : IconType.values()) { + if (iconType.getIconCode() == iconCode) { + return iconType.getIconType(); + } + } + return StringUtils.EMPTY; + } + +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java b/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java index 07583f3d7..aebb22ae1 100644 --- a/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java +++ b/designer-base/src/main/java/com/fr/base/svg/SVGIcon.java @@ -1,8 +1,9 @@ package com.fr.base.svg; +import com.fr.general.IOUtils; + import javax.swing.Icon; import java.awt.Component; -import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; @@ -52,7 +53,7 @@ public class SVGIcon implements Icon { } /** - * 外界读取高清图标,默认尺寸为16*16 + * 读取高清图标 * @param url * @return */ @@ -60,7 +61,8 @@ public class SVGIcon implements Icon { if (!url.startsWith(ICON_PREFIX)) { url = ICON_PREFIX + url; } - return new SVGIcon((BufferedImage) SVGLoader.load(url)); + BufferedImage image = (BufferedImage) SVGLoader.load(url); + return image == null ? IOUtils.readIcon(url) : new SVGIcon(image); } /** @@ -74,6 +76,7 @@ public class SVGIcon implements Icon { if (!url.startsWith(ICON_PREFIX)) { url = ICON_PREFIX + url; } - return new SVGIcon((BufferedImage) SVGLoader.load(url, width, height)); + BufferedImage image = (BufferedImage) SVGLoader.load(url, width, height); + return image == null ? IOUtils.readIcon(url) : new SVGIcon(image); } } diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGIconUtils.java b/designer-base/src/main/java/com/fr/base/svg/SVGIconUtils.java new file mode 100644 index 000000000..ba4aaa40f --- /dev/null +++ b/designer-base/src/main/java/com/fr/base/svg/SVGIconUtils.java @@ -0,0 +1,104 @@ +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 SVGIconUtils { + + 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图标或者普通图标,并且可以读取不带扩展名的文件 + * @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_NORMAL、ICON_TYPE_DISABLED、ICON_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(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); + } +} diff --git a/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java b/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java index 5f4f9e5dc..3c0b7a036 100644 --- a/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java +++ b/designer-base/src/main/java/com/fr/base/svg/SVGLoader.java @@ -26,7 +26,11 @@ public class SVGLoader { @Nullable public static Image load(@NotNull String url) { try { - return load(IOUtils.getResource(url, SVGLoader.class), SVGIcon.SYSTEM_SCALE); + URL resource = IOUtils.getResource(url, SVGLoader.class); + if (resource == null) { + return null; + } + return load(resource, SVGIcon.SYSTEM_SCALE); } catch (IOException ignore) { return null; } @@ -43,8 +47,8 @@ public class SVGLoader { String svgUri = url.toString(); TranscoderInput input = new TranscoderInput(svgUri); return SVGTranscoder.createImage(scale, input).getImage(); - } catch (TranscoderException e) { - throw new IOException(e); + } catch (TranscoderException ignore) { + return null; } } @@ -55,8 +59,8 @@ public class SVGLoader { TranscoderInput input = new TranscoderInput(svgUri); return SVGTranscoder.createImage(scale, input, (float) (dimension.getWidth() * scale), (float) (dimension.getHeight() * scale)).getImage(); - } catch (TranscoderException e) { - throw new IOException(e); + } catch (TranscoderException ignore) { + return null; } } @@ -67,16 +71,19 @@ public class SVGLoader { String svgUri = url.toString(); TranscoderInput input = new TranscoderInput(svgUri); return SVGTranscoder.createImage(scale, input, (float) (overriddenWidth * scale), (float) (overriddenHeight * scale)).getImage(); - } catch (TranscoderException e) { - throw new IOException(e); + } catch (TranscoderException ignore) { + return null; } } @Nullable public static Image load(@NotNull String url, float width, float height) { try { - String svgUri = IOUtils.getResource(url, SVGLoader.class).toString(); - TranscoderInput input = new TranscoderInput(svgUri); + 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; diff --git a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java index 49e8670bd..048a8e193 100644 --- a/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/AllowAuthorityEditAction.java @@ -1,6 +1,6 @@ package com.fr.design.actions; -import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; 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(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/allow_authority_edit_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit_normal.svg")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java b/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java index 44bd365a2..aca5f3f54 100644 --- a/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/ExitAuthorityEditAction.java @@ -1,6 +1,7 @@ package com.fr.design.actions; import com.fr.base.BaseUtils; +import com.fr.base.svg.SVGIconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.DesignModelAdapter; @@ -19,7 +20,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(SVGIconUtils.readIcon("/com/fr/design/images/m_report/exit_authority_edit_normal.svg")); } diff --git a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java index 74c4f1e76..4420feb8f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/TableDataSourceAction.java @@ -1,7 +1,7 @@ package com.fr.design.actions; import javax.swing.SwingUtilities; -import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.data.TableDataSource; import com.fr.design.data.datapane.ReportTableDataPane; @@ -26,7 +26,7 @@ public class TableDataSourceAction extends TemplateComponentAction> { this.setMenuKeySet(KeySetUtils.SAVE_AS_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_file/saveAs_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/m_file/saveAs_normal.svg")); } /** diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java b/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java index d6be9b618..3557eb307 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SaveTemplateAction.java +++ b/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.svg.SVGIcon; import com.fr.design.actions.JTemplateAction; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.KeySetUtils; @@ -21,8 +20,7 @@ public class SaveTemplateAction extends JTemplateAction> { this.setMenuKeySet(KeySetUtils.SAVE_TEMPLATE); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_file/save_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_file/save_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_file/save.png"); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index 944e8493d..d8cf3eff1 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/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.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; 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 nameIt = DesignerEnvManager.getEnvManager().getEnvNameIterator(); while (nameIt.hasNext()) { String name = nameIt.next(); - this.setIconPath("com/fr/design/images/m_file/switch_normal.svg", true); + this.setIconPath("com/fr/design/images/m_file/switch_normal.svg"); 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(SVGIcon.readSVGIcon("com/fr/design/images/data/bind/local_connect_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("com/fr/design/images/data/bind/localconnect_normal.svg")); break; } case Remote: { - this.setSmallIcon(SVGIcon.readSVGIcon("com/fr/design/images/data/bind/distance_connect_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("com/fr/design/images/data/bind/distanceconnect_normal.svg")); break; } } diff --git a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java index 50ecd0ea6..ca7bf90f7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java +++ b/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.SVGIconUtils; 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(SVGIconUtils.readIcon("/com/fr/design/images/m_web/connection_normal.svg")); this.generateAndSetSearchText(DatabaseConnectionPane.JDBC.class.getName()); } @@ -96,4 +96,4 @@ public class ConnectionListAction extends UpdateAction { public void update() { this.setEnabled(true); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index 5bd0fa222..a1eee5b9a 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -3,7 +3,7 @@ */ package com.fr.design.constants; -import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; import com.fr.general.IOUtils; import com.fr.stable.Constants; @@ -180,7 +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 = SVGIcon.readSVGIcon("com/fr/design/images/buttonicon/prewidget_normal.svg", 30, 20); + public static final Icon PRE_WIDGET_NORMAL_ICON = SVGIconUtils.readIcon("com/fr/design/images/buttonicon/prewidget_normal.svg"); 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"); diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index ecaac5f41..486315058 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -2,7 +2,6 @@ package com.fr.design.data; import com.fr.base.BaseUtils; import com.fr.base.TableData; -import com.fr.base.svg.SVGIcon; import com.fr.data.TableDataSource; import com.fr.data.api.StoreProcedureAssist; import com.fr.data.impl.storeproc.StoreProcedure; @@ -399,8 +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(SVGIcon.readSVGIcon(IconPathConstants.PREVIEW_NORMAL_ICON_PATH)); - this.setDisabledIcon(SVGIcon.readSVGIcon(IconPathConstants.PREVIEW_DISABLED_ICON_PATH)); + this.setSmallIcon(IconPathConstants.PREVIEW_ICON_PATH); this.dataTree = dataTree; } @@ -439,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(SVGIcon.readSVGIcon(IconPathConstants.TD_CONNECTION_NORMAL_ICON_PATH)); + this.setSmallIcon(IconPathConstants.TD_CONNECTION_ICON_PATH); } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 50cb5f1c8..76fd78edd 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -1,7 +1,6 @@ package com.fr.design.data.datapane; import com.fr.base.TableData; -import com.fr.base.svg.SVGIcon; import com.fr.data.TableDataSource; import com.fr.data.impl.TableDataSourceDependent; import com.fr.design.DesignModelAdapter; @@ -279,8 +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(SVGIcon.readSVGIcon(IconPathConstants.TD_EDIT_NORMAL_ICON_PATH)); - this.setDisabledIcon(SVGIcon.readSVGIcon(IconPathConstants.TD_EDIT_DISABLED_ICON_PATH)); + this.setSmallIcon(IconPathConstants.TD_EDIT_ICON_PATH); } public void actionPerformed(ActionEvent e) { @@ -298,8 +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(SVGIcon.readSVGIcon(IconPathConstants.TD_REMOVE_NORMAL_ICON_PATH)); - this.setDisabledIcon(SVGIcon.readSVGIcon(IconPathConstants.TD_REMOVE_DISABLED_ICON_PATH)); + this.setSmallIcon(IconPathConstants.TD_REMOVE_ICON_PATH); } @Override diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index 3241e0588..1cba4df96 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1 +1 @@ -package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(null); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file +package com.fr.design.data.datapane.sqlpane; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import java.awt.Point; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.Transferable; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetAdapter; import java.awt.dnd.DropTargetContext; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.event.ActionEvent; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-5-2 * Time: 上午11:09 */ public class SQLEditPane extends RSyntaxTextArea { public static final boolean REQUEST_DROPTARGET = true; public static final boolean UNREQUEST_DROPTARGET = false; public SQLEditPane() { this(REQUEST_DROPTARGET); } public SQLEditPane(boolean requestDroptarget) { super(); setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_SQL); setAnimateBracketMatching(true); setAntiAliasingEnabled(true); setAutoIndentEnabled(true); setCodeFoldingEnabled(true); setUseSelectedTextColor(true); setCloseCurlyBraces(true); setBracketMatchingEnabled(true); setAntiAliasingEnabled(true); setCloseMarkupTags(true); setLineWrap(true); if (requestDroptarget) { new SQLPaneDropTarget(this); } } private static class SQLPaneDropTarget extends DropTargetAdapter { private TableProcedure sqlTable; public SQLPaneDropTarget(SQLEditPane sqlTextPane) { new DropTarget(sqlTextPane, this); } public void dragEnter(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void dragOver(DropTargetDragEvent dtde) { dtde.acceptDrag(dtde.getDropAction()); } public void drop(DropTargetDropEvent dtde) { Point p = dtde.getLocation(); DropTargetContext dtc = dtde.getDropTargetContext(); SQLEditPane jTextPane = (SQLEditPane) dtc.getComponent(); try { Transferable tr = dtde.getTransferable(); DataFlavor[] flavors = tr.getTransferDataFlavors(); for (int i = 0; i < flavors.length; i++) { if (!tr.isDataFlavorSupported(flavors[i])) { continue; } dtde.acceptDrop(dtde.getDropAction()); Object userObj = tr.getTransferData(flavors[i]); if (userObj instanceof TableProcedure) { this.sqlTable = (TableProcedure) userObj; JPopupMenu popupMenu = new JPopupMenu(); popupMenu.add(new NameAction(jTextPane, sqlTable).createMenuItem()); if (ComparatorUtils.equals(sqlTable.getType(), TableProcedure.PROCEDURE)) { popupMenu.add(new CallAction(jTextPane, sqlTable).createMenuItem()); } else { popupMenu.add(new SelectAction(jTextPane, sqlTable).createMenuItem()); } GUICoreUtils.showPopupMenu(popupMenu, jTextPane, (int) p.getX() + 1, (int) p.getY() + 1); } dtde.dropComplete(true); } dtde.rejectDrop(); } catch (Exception e) { dtde.rejectDrop(); } } class NameAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public NameAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name")); this.setMnemonic('N'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { if (sqlTable != null) { insertStringTo(sqlTextPane, sqlTable.toString()); } } } class SelectAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public SelectAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("SELECT *"); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { //daniel: 添加参数 insertStringTo(sqlTextPane, DataCoreUtils.createSelectSQL(sqlTable.getSchema(), sqlTable.getName(), sqlTable.getDialect())); } } class CallAction extends UpdateAction { private SQLEditPane sqlTextPane; private TableProcedure sqlTable; public CallAction(SQLEditPane sqlTextPane, TableProcedure sqlTable) { this.sqlTextPane = sqlTextPane; this.sqlTable = sqlTable; this.setName("CALL PROCEDURE "); this.setMnemonic('s'); this.setSmallIcon(UIConstants.BLACK_ICON); } public void actionPerformed(ActionEvent evt) { StringBuffer sBuf = new StringBuffer(); sBuf.append("{call "); if (sqlTable != null) { sBuf.append(sqlTable.toString()).append("()"); } sBuf.append('}'); insertStringTo(sqlTextPane, sBuf.toString()); } } private void insertStringTo(SQLEditPane sqlTextPane, String str) { Document document = sqlTextPane.getDocument(); try { document.insertString(sqlTextPane.getCaretPosition(), str, null); } catch (BadLocationException badLocationException) { FineLoggerFactory.getLogger().error(badLocationException.getMessage(), badLocationException); } sqlTextPane.requestFocus(); } } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java index 13b441239..0773dd41a 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/WidgetOption.java @@ -1,7 +1,7 @@ package com.fr.design.gui.core; import com.fr.base.BaseUtils; -import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; import com.fr.form.ui.*; import com.fr.general.ComparatorUtils; @@ -128,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"), - SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/date_16_normal.svg"), + SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/date_16_normal.svg"), DateEditor.class); public static final WidgetOption TREE = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_View_Tree"), - SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/tree_16_normal.svg"), TreeEditor.class); + SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/tree_16_normal.svg"), TreeEditor.class); - public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/combo_box_tree_16_normal.svg"), + public static final WidgetOption TREECOMBOBOX = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Tree_ComboBox"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg"), TreeComboBoxEditor.class); public static final WidgetOption CHECKBOXGROUP = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg"), CheckBoxGroup.class); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox_Group"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg"), CheckBoxGroup.class); public static final WidgetOption RADIOGROUP = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Radio_Group"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_group_16_normal.svg"), RadioGroup.class); public static final WidgetOption NUMBEREDITOR = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg"), NumberEditor.class); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Number"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/number_field_16_normal.svg"), NumberEditor.class); public static final WidgetOption LABEL = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/label_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Label"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/label_16_normal.svg"), Label.class); public static final WidgetOption BUTTON = WidgetOptionFactory.createByWidgetClass( @@ -156,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"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/button_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Button"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/button_16_normal.svg"), FreeButton.class); public static final WidgetOption MULTI_FILEEDITOR = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/files_up_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_File"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/files_up_normal.svg"), MultiFileEditor.class); public static final WidgetOption COMBOBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Box"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg"), ComboBox.class); public static final WidgetOption COMBOCHECKBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Combo_Checkbox"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/combo_check_16_normal.svg"), ComboCheckBox.class); public static final WidgetOption CHECKBOX = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Checkbox"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/check_box_16_normal.svg"), CheckBox.class); public static final WidgetOption LIST = WidgetOptionFactory.createByWidgetClass( @@ -182,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") - , SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg"), + , SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_field_16_normal.svg"), TextEditor.class); public static final WidgetOption TEXTAREA = WidgetOptionFactory.createByWidgetClass( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Textarea"), SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/text_area_16_normal.svg"), TextArea.class); public static final WidgetOption PASSWORD = WidgetOptionFactory.createByWidgetClass( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Type_Password"), - SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg"), Password.class); + SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/widget/password_field_16_normal.svg"), 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); diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java index 32f20ad56..ea592a072 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButton.java +++ b/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.SVGIconUtils; 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(SVGIconUtils.readSVGIcon(resource, SVGIconUtils.ICON_TYPE_NORMAL)); + if (needSetDisabledIcon) { + this.setDisabledIcon(SVGIconUtils.readSVGIcon(resource, SVGIconUtils.ICON_TYPE_DISABLED)); + } + init(); + } + protected void initListener() { if (shouldResponseChangeListener()) { this.addActionListener(new ActionListener() { @@ -388,4 +397,4 @@ public class UIButton extends JButton implements UIObserver, UITextComponent { public boolean shouldResponseChangeListener() { return true; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java index c4a3250e7..d977e4be4 100644 --- a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java +++ b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java @@ -32,7 +32,7 @@ public class IconPathConstants { public static final String TD_EDIT_DISABLED_ICON_PATH = "/com/fr/design/images/control/edit_disabled.svg"; 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_REMOVE_NORMAL_ICON_PATH = "/com/fr/design/images/control/remove_normal.svg"; public static final String TD_REMOVE_DISABLED_ICON_PATH = "/com/fr/design/images/control/remove_disabled.svg"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index 5624ae9f6..2d4149662 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.extension.FileExtension; -import com.fr.base.svg.SVGIcon; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; @@ -317,8 +316,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public NewFolderAction() { this.setName(KeySetUtils.NEW_FOLDER.getMenuKeySetName()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/new_folder_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/new_folder_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/new_folder.png"); } @Override @@ -344,8 +342,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private class VcsAction extends UpdateAction { public VcsAction() { - this.setSmallIcon(VcsHelper.VCS_LIST_NORMAL_SVG); - this.setDisabledIcon(VcsHelper.VCS_LIST_DISABLED_SVG); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/vcs_list.png"); } @Override @@ -427,8 +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(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/view_folder_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/view_folder_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/view_folder.png"); } @Override @@ -445,7 +441,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public RefreshTreeAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/refresh_normal.svg")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/refresh.png"); } @Override @@ -463,8 +459,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public RenameAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Rename")); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/rename_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/rename_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/rename.png"); } @Override @@ -503,8 +498,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt public DelFileAction() { this.setName(Toolkit.i18nText("Fine-Design_Basic_Remove")); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/remove_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/remove_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/FileDealerPaneIcon/remove.png"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 0e035bcc0..7c91b0253 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,7 +1,8 @@ package com.fr.design.mainframe; import com.fr.base.FRContext; -import com.fr.base.svg.SVGIcon; + +import com.fr.base.svg.SVGIconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -847,7 +848,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void resetButtonIcon() { if (iconSuffix.equals(ICON_SUFFIX_SELECTED)) { iconSuffix = ICON_SUFFIX_NORMAL; - button.setIcon(SVGIcon.readSVGIcon(getBtnIconUrl(), ICON_WIDTH, ICON_HEIGHT)); + button.setIcon(SVGIconUtils.readIcon(getBtnIconUrl())); button.setBackground(originBtnBackground); button.setOpaque(false); } @@ -856,7 +857,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { public void setTabButtonSelected() { resetPropertyIcons(); iconSuffix = ICON_SUFFIX_SELECTED; - button.setIcon(SVGIcon.readSVGIcon(getBtnIconUrl(), ICON_WIDTH, ICON_HEIGHT)); + button.setIcon(SVGIconUtils.readIcon(getBtnIconUrl())); button.setBackground(selectedBtnBackground); button.setOpaque(true); selectedItem = this; @@ -867,7 +868,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } private void initButton() { - button = new UIButton(SVGIcon.readSVGIcon(getBtnIconUrl(), ICON_WIDTH, ICON_HEIGHT)) { + button = new UIButton(SVGIconUtils.readIcon(getBtnIconUrl())) { public Dimension getPreferredSize() { return new Dimension(TAB_BUTTON_WIDTH, TAB_BUTTON_HEIGHT); } @@ -876,7 +877,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { super.paintComponent(g); } }; - button.setDisabledIcon(SVGIcon.readSVGIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED, ICON_WIDTH, ICON_HEIGHT)); + button.setDisabledIcon(SVGIconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); button.set4LargeToolbarButton(); button.setUI(new UIButtonUI() { @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index 22e2c798f..0ec5b9c4f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -1,6 +1,6 @@ package com.fr.design.mainframe.vcs.common; -import com.fr.base.svg.SVGIcon; + import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -40,8 +40,6 @@ public class VcsHelper implements JTemplateActionListener { public final static EmptyBorder EMPTY_BORDER_MEDIUM = new EmptyBorder(5, 10, 0, 10); public final static EmptyBorder EMPTY_BORDER_BOTTOM = new EmptyBorder(10, 10, 10, 10); public final static Icon VCS_LIST_PNG = IOUtils.readIcon("/com/fr/design/images/vcs/vcs_list.png"); - public final static Icon VCS_LIST_NORMAL_SVG = SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/vcs_list_normal.svg"); - public final static Icon VCS_LIST_DISABLED_SVG = SVGIcon.readSVGIcon("/com/fr/design/images/FileDealerPaneIcon/vcs_list_disabled.svg"); public final static Icon VCS_BACK_PNG = IOUtils.readIcon("/com/fr/design/images/vcs/vcs_back.png"); public final static Icon VCS_FILTER_PNG = IOUtils.readIcon("/com/fr/design/images/vcs/icon_filter@1x.png"); public final static Icon VCS_EDIT_PNG = IOUtils.readIcon("/com/fr/design/images/vcs/icon_edit.png"); diff --git a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java index fb657f475..8a0cf4aa8 100644 --- a/designer-base/src/main/java/com/fr/design/menu/MenuDef.java +++ b/designer-base/src/main/java/com/fr/design/menu/MenuDef.java @@ -1,7 +1,6 @@ package com.fr.design.menu; -import com.fr.base.BaseUtils; -import com.fr.base.svg.SVGIcon; +import com.fr.base.svg.SVGIconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.*; import com.fr.design.gui.iscrollbar.UIScrollBar; @@ -41,7 +40,6 @@ public class MenuDef extends ShortCut { protected JPopupMenu popupMenu; protected boolean hasScrollSubMenu; protected boolean isHeadMenu; - private boolean isSVGIcon = false; private String anchor; @@ -101,11 +99,6 @@ public class MenuDef extends ShortCut { this.iconPath = iconPath; } - public void setIconPath(String iconPath, boolean isSVGIcon) { - this.iconPath = iconPath; - this.isSVGIcon = isSVGIcon; - } - public int getShortCutCount() { return this.shortcutList.size(); } @@ -173,7 +166,7 @@ public class MenuDef extends ShortCut { public UIButton createUIButton() { if (createdButton == null) { if (iconPath != null) { - createdButton = new UIButton(isSVGIcon ? SVGIcon.readSVGIcon(iconPath) : BaseUtils.readIcon(iconPath)); + createdButton = new UIButton(SVGIconUtils.readIcon(iconPath)); createdButton.set4ToolbarButton(); } else { createdButton = new UIButton(name); @@ -201,7 +194,7 @@ public class MenuDef extends ShortCut { createdJMenu = createJMenu0(); createdJMenu.setMnemonic(this.getMnemonic()); if (this.iconPath != null) { - createdJMenu.setIcon(isSVGIcon ? SVGIcon.readSVGIcon(iconPath) : BaseUtils.readIcon(iconPath)); + createdJMenu.setIcon(SVGIconUtils.readIcon(iconPath)); } MenuListener menuListener = createMenuListener(); createdJMenu.addMenuListener(menuListener); diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java index c24125059..ba507644a 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrAction.java +++ b/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.SVGIconUtils; import com.fr.design.actions.JTemplateAction; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; @@ -65,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(SVGIconUtils.readIcon("/com/fr/design/images/reportfit/fit_normal.svg")); } /** diff --git a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java index 24328ef41..c0e9199fd 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java +++ b/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.svg.SVGIcon; + +import com.fr.base.svg.SVGIconUtils; 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(SVGIcon.readSVGIcon("/com/fr/design/images/gui/popup_normal.svg"))); + super(new UIColorButton(icon), new UIButton(SVGIconUtils.readIcon("/com/fr/design/images/gui/popup_normal.svg"))); getLeftButton().setEventBanned(true); getRightButton().addFocusListener(new FocusListener() { diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..9ea75fc6d857fef4e30a72519a4afd56ac7d0759 GIT binary patch literal 288 zcmV+*0pI?KP)Px#+DSw~R5%gEQZWv~Fbs4MVnN~&NHDM_p?`o*d;oU-!9REbQ$B&n3KD#!jd9YZ zL{^Iw7P8d7JD;680RKK>Xn>+9W_9gOhd_UWW_n3Ypv)08z%4pKh|E)B%07QE@ZUiymM#>D+As)0WaWr ztQm14H_tYZQa{rs*#@+cg*TuTh9~fYLE8Vz7E)O=cGKD8@dwfyc?I1ENXzPx$%t=H+R5%g6QZYyyQ5gQ;<(i5hVhE)sp%Ii&P!}(O++o4NC8(1myHh7o5ZCHx z=^_$3b}VQ>hwPd~tvNC{h(oE3LWqPQxHWh2p5JTx9|=O}ApPOp_uv12-}nA^_lW*? zq*AG^WHR}c_tiP+M8mK~g=oJg@+>JSB!p-PL5I4o=N-qL0QU{^HBK0@!xE8mE~U3F zr5J+vT1px7Jh=h!5Add#tFX%eqpgGZ1)^_6eep`g9-p6|o5SvTtbOnYv4)k9!#{#$ zS@BlO*(4GNwq0I?iBzOwu@nNJ{#y)CAuj(Qk#B(UHc<3}L4BFUid3nTnmEExE|>GC zEffk5PYh6)#h9mv8aEmL8u}uxEA(Bl%PV}e@14zm$$bNm@38#e(@UIAr$;iG%uB`b z4KU^jk$h(u3;n&srfH73Zu_FqXyTr97)YsY<9$Gg`c5wc$7$!$cXeIcRlER`>-E}A zEEau%o3|Q`MqVcpiQ{Uu`iuL9F%ynN!h3knXqs3nm&+y96Y9Z{&1M5vSJjXB8!M>Y z<49+q{6zj1AKAn)HT2eO+y2a&E(0zahB+yO`vKx<2-QWpMSi4d^a-4Q2+n{ literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb2baac51ead86742e20545aa0a62413be50b12 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|5K|k5|2~(;g&RwlQDDH z6mGYiaof(gobd%$;YW8~2X4ulg}lLC>)IYUq%_XtS$r|Kq4RPN8^beAv5Lrm+Yvy^ O7(8A5T-G@yGywp$2|2L< literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png new file mode 100644 index 0000000000000000000000000000000000000000..5c244dd5d48b170673b7027067115be464b40e92 GIT binary patch literal 433 zcmV;i0Z#sjP)Px$Ye_^wR5%f}Qaw+@Fc7tykJ5z=u@trJWWk_>pbWr&VdbYFR{jPv5h5Z|1Ys#V zkzgttLxY+Gb1$teD?=oNI4SY-^WDqyT^RdgaI@a`{mm@PK7}}t;Pd>6D-Qc02&P!g z&;mjnUUAOOMx%|B#iE=eX*hJZm&+=alHKO{;{^#9W-;MOD}b*w&G&yu00IZ}>Uc4phw4jy1|IO`Up4$(SLcLsq%N`??4XXCnV-hdJ4 z$qKFB+JQ;_7Hh>Qinhw~>zM>*bl-CbQD3fU@#qTsNs@ekGebK-6RDWG-8RpI?X`6e z9L|tq7AtH6pg}aom>R~-F}kiJ)?P&q;zd4vnygHB%WHVnfFdAXsHPLZgm05!+4cl)Z9ZIy?;DNytk b|J&IQ*9Ev-ia$+h00000NkvXXu0mjf!mPe( literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png new file mode 100644 index 0000000000000000000000000000000000000000..df6cd02de67c069a372e1342661652a8c9673956 GIT binary patch literal 286 zcmV+(0pb3MP)Px#*hxe|R5%f(Qtc7KAPfbsW9Sq_ox!??Lv;|H!IMs*dte_nxfn|2PW~kCgFph# z)mI3VMEwH7RuiKAlf`0dL9jDNy_E%U8wM$*E$1A;iNSmSVu2$#4}em-0)!YJJ2tjO zqGPX}Aso&b6VYk4zg2N6AzkS5Iu}Fr4ogR9uJhjYnm~DQd`un`14MK+Sq42gtt0){&T49(8_T?t=RJO_5M$2~~aNTjdU#-}JWy~$+B~QMA7BFG^`?QXH9-_QN k{;t1ffX|1*w%FhJ4RGa2%S^h7EC2ui07*qoM6N<$f~l)@dH?_b literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png new file mode 100644 index 0000000000000000000000000000000000000000..4d16dc7aea783ce693256d5f013d9de8f7f5c8da GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|x;$MRLo5WB zPQJ+7pupo2{n)L9>-$m76tyjCzUQ_n3jTP>SpNP;V@Bb|jw|kDKe9mmQ z&9`%I6z%!cB;Leu<(k2)SNHcSHg750`2D6G!-Y8qbux?@-Z-fr`XE!vkg`@efMJ1U zbK>q-3=YgNp$qH}dL?;ohw9fZQ;)a(@ckd#bS`~OzPrbrfv#fkboFyt=akR{02Z)O ANdN!< literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_tree_16_normal.svg b/designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/combo_box_tree_16_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/data/bind/distance_connect_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/data/bind/distance_connect_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/data/bind/distanceconnect_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/data/bind/local_connect_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/data/bind/local_connect_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/data/bind/localconnect_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg b/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg new file mode 100644 index 000000000..5ca77fe5b --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/data/source/dataDictionary_normal.svg @@ -0,0 +1,7 @@ + + + icon_形态_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg new file mode 100644 index 000000000..7866d7b44 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/redo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重做_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg new file mode 100644 index 000000000..ca7b9f1c6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/edit/undo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_撤销_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg new file mode 100644 index 000000000..557ab9d03 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/expand/cellAttr_normal.svg @@ -0,0 +1,7 @@ + + + icon_扩展_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg new file mode 100644 index 000000000..7866d7b44 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_重做_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg new file mode 100644 index 000000000..6723f533a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/redo_normal.svg @@ -0,0 +1,7 @@ + + + icon_重做_下拉列表用 + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg new file mode 100644 index 000000000..ca7b9f1c6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_disabled.svg @@ -0,0 +1,7 @@ + + + icon_撤销_disabled + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg new file mode 100644 index 000000000..f66553747 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_edit/undo_normal.svg @@ -0,0 +1,7 @@ + + + icon_撤销_下拉列表用 + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg new file mode 100644 index 000000000..537d76854 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen_normal.svg @@ -0,0 +1,7 @@ + + + icon_重复与冻结设置_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg new file mode 100644 index 000000000..2c8311fed --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/cellAttr_normal.svg @@ -0,0 +1,7 @@ + + + icon_其他属性_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg new file mode 100644 index 000000000..7d05f4183 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/highlight_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_条件属性_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg new file mode 100644 index 000000000..93b9e7a6d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_format/modified_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_控件设置_下拉列表用_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg new file mode 100644 index 000000000..7122f3db8 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/cell_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_单元格元素_下拉列表用_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg new file mode 100644 index 000000000..ba67578c1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/float_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_下拉列表用_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg new file mode 100644 index 000000000..85b0fd1d4 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/hyperLink_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_超级链接_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg new file mode 100644 index 000000000..358dcc357 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertColumn_normal.svg @@ -0,0 +1,13 @@ + + + icon_列_normal + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg new file mode 100644 index 000000000..ecf535ba6 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_insert/insertRow_normal.svg @@ -0,0 +1,14 @@ + + + icon_行_normal + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg index 1897f7488..cb214cf19 100644 --- a/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/exit_authority_edit_normal.svg @@ -1,8 +1,7 @@ - - icon_关闭_权限编辑_normal - - - + + icon_退出权限编辑_normal + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/linear_attr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/m_report/linear_attr_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/m_report/linearAttr_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg new file mode 100644 index 000000000..f13090adb --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_report/mobile_normal.svg @@ -0,0 +1,7 @@ + + + icon_移动端属性_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/parameter_report_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/m_report/parameter_report_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/m_report/p_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/report_engine_attr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/m_report/report_engine_attr_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/m_report/reportEngineAttr_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/report_write_attr_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/m_report/report_write_attr_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/m_report/reportWriteAttr_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/m_report/web_report_attribute_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/m_report/web_report_attribute_normal.svg rename to designer-base/src/main/resources/com/fr/design/images/m_report/webreportattribute_normal.svg diff --git a/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg b/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg new file mode 100644 index 000000000..de5f21cc5 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/m_web/style_normal.svg @@ -0,0 +1,7 @@ + + + icon_样式_normal + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg b/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg new file mode 100644 index 000000000..21717e20a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/images/reportfit/fit_normal.svg @@ -0,0 +1,7 @@ + + + icon_模板自适应属性_normal + + + + \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java b/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java index d56e1ef2d..1ea306685 100644 --- a/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java +++ b/designer-form/src/main/java/com/fr/design/actions/NewFormAction.java @@ -1,7 +1,7 @@ package com.fr.design.actions; -import com.fr.base.svg.SVGIcon; -import com.fr.design.actions.UpdateAction; + +import com.fr.base.svg.SVGIconUtils; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -21,7 +21,7 @@ public class NewFormAction extends UpdateAction { this.setMenuKeySet(NEW_FORM); this.setName(getMenuKeySet().getMenuKeySetName()); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/new_form_for_dock_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/buttonicon/new_form_for_dock_normal.svg")); this.setAccelerator(getMenuKeySet().getKeyStroke()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java index 2ae2ae973..98663dedd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CopyAction.java @@ -1,6 +1,6 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.svg.SVGIcon; + import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -16,8 +16,7 @@ public class CopyAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Copy")); this.setMnemonic('C'); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/copy_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/copy_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_edit/copy.png"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER)); setUpdateBehavior(new ComponentEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java index f366602f9..60c4f4fa3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/CutAction.java @@ -1,6 +1,6 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.svg.SVGIcon; + import com.fr.design.base.mode.DesignModeContext; import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -16,8 +16,7 @@ public class CutAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Edit_Cut")); this.setMnemonic('T'); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/cut_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/cut_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_edit/cut.png"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, DEFAULT_MODIFIER)); this.setUpdateBehavior(new ComponentEnable()); this.setEnabled(!DesignModeContext.isBanCopyAndCut()); diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java index 94e434cc8..8c5194225 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormDeleteAction.java @@ -7,7 +7,7 @@ import java.awt.event.KeyEvent; import javax.swing.*; -import com.fr.base.svg.SVGIcon; + import com.fr.design.designer.beans.actions.behavior.ComponentEnable; import com.fr.design.mainframe.FormDesigner; @@ -24,8 +24,7 @@ public class FormDeleteAction extends FormWidgetEditAction { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); this.setMnemonic('D'); // Richie:删除菜单图标 - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/delete_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/delete_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_report/delete.png"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)); this.setUpdateBehavior(new ComponentEnable()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java index 1e6a17b2e..1670e3083 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/PasteAction.java @@ -1,6 +1,5 @@ package com.fr.design.designer.beans.actions; -import com.fr.base.svg.SVGIcon; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.mainframe.FormDesigner; @@ -15,8 +14,7 @@ public class PasteAction extends FormWidgetEditAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Edit_Paste")); this.setMnemonic('P'); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/paste_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/paste_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_edit/paste.png"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, DEFAULT_MODIFIER)); } diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java index ad58ccf35..fa43aa097 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaTargetMode.java @@ -1,6 +1,7 @@ package com.fr.design.form.parameter; -import com.fr.base.svg.SVGIcon; + +import com.fr.base.svg.SVGIconUtils; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.gui.core.WidgetOption; @@ -27,7 +28,7 @@ public class FormParaTargetMode extends FormDesignerModeForSpecial { public WidgetOption[] getPredefinedWidgetOptions() { return new WidgetOption[]{ WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query_Button"), - SVGIcon.readSVGIcon("/com/fr/web/images/form/resources/preview_16_normal.svg"), FormSubmitButton.class)}; + SVGIconUtils.readIcon("/com/fr/web/images/form/resources/preview_16_normal.svg"), FormSubmitButton.class)}; } public ArrayList createRootDesignerPropertyGroup() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 95d846836..3c5e0d14f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -247,7 +247,7 @@ public class JForm extends JTemplate implements BaseJForm { this.setMenuKeySet(KeySetUtils.REPORT_FOOTER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/footer_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/m_report/footer_normal.svg")); } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java index eccee9e26..8323f7295 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportHeaderAction.java @@ -3,7 +3,8 @@ */ package com.fr.design.actions.report; -import com.fr.base.svg.SVGIcon; + +import com.fr.base.svg.SVGIconUtils; import com.fr.design.actions.ReportComponentAction; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.headerfooter.EditHeaderPane; @@ -32,7 +33,7 @@ public class ReportHeaderAction extends ReportComponentAction { this.setMenuKeySet(KeySetUtils.REPORT_HEADER); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/header_normal.svg")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/m_report/header_normal.svg")); } /** diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index a002f56e8..8329004f9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -2,6 +2,7 @@ package com.fr.design.actions.report; import com.fr.base.PaperSize; import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark; +import com.fr.base.svg.SVGIconUtils; import com.fr.design.actions.JWorkBookAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -35,7 +36,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ this.setMenuKeySet(REPORT_APP_ATTR); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_report/mobile.png")); + this.setSmallIcon(SVGIconUtils.readIcon("/com/fr/design/images/m_report/mobile_normal.svg")); this.generateAndSetSearchText(ReportMobileAttrPane.class.getName()); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java index 8c804863e..eb409a8e3 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.report; +import com.fr.base.svg.SVGIconUtils; import com.fr.design.actions.ReportComponentAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -27,7 +28,7 @@ public class ReportPageAttrAction extends ReportComponentAction extends Tar MenuDef insertFloatMenu = new MenuDef(); insertFloatMenu.setName(KeySetUtils.INSERT_FLOAT.getMenuKeySetName()); insertFloatMenu.setTooltip(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_T_Insert_Float")); - insertFloatMenu.setIconPath("/com/fr/design/images/m_insert/floatPop_normal.svg", true); + insertFloatMenu.setIconPath("/com/fr/design/images/m_insert/floatPop_normal.svg"); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 83a1c0850..44992a84b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -182,7 +182,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { private void addInsertFloatMenuDef(MenuDef menuDef) { // 悬浮元素菜单 MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuName()); - subMenuDef.setIconPath("/com/fr/design/images/m_insert/float.png"); + subMenuDef.setIconPath("/com/fr/design/images/m_insert/float_normal.svg"); menuDef.addShortCut(subMenuDef); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java index b2b29421c..572538558 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/FormatBrushAction.java @@ -1,8 +1,7 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.base.Style; -import com.fr.base.svg.SVGIcon; + import com.fr.design.actions.ElementCaseAction; import com.fr.grid.selection.CellSelection; @@ -32,7 +31,7 @@ public class FormatBrushAction extends ElementCaseAction { super(t); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_FormatBrush")); this.setMnemonic('B'); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_edit/formatBrush_normal.svg")); + this.setSmallIcon("/com/fr/design/images/m_edit/formatBrush.png"); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, DEFAULT_MODIFIER)); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 6be7acfc2..3aa08926a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -690,7 +690,7 @@ public class JWorkBook extends JTemplate { .addShortCut(new PageExcelExportAction(this), new ExcelExportAction(this), new PageToSheetExcelExportAction(this)); // Export - MenuDef MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName()); - exportMenuDef.setIconPath("/com/fr/design/images/m_file/export_normal.svg", true); + exportMenuDef.setIconPath("/com/fr/design/images/m_file/export_normal.svg"); addShortCut(exportMenuDef, excelExportMenuDef); return exportMenuDef; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java index 30d46767f..12702a9fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/SheetNameTabPane.java @@ -24,7 +24,8 @@ import javax.swing.UIManager; import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; -import com.fr.base.svg.SVGIcon; + +import com.fr.base.svg.SVGIconUtils; import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; @@ -58,14 +59,14 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private static final Color LINE_COLOR = new Color(0xababab); - private static final Icon ADD_WORK_SHEET = SVGIcon.readSVGIcon("com/fr/base/images/oem/add_worksheet_normal.svg", 22, 12); - protected static final Icon ADD_POLY_SHEET = SVGIcon.readSVGIcon("com/fr/design/images/sheet/add_polysheet_normal.svg", 22, 12); - private static final Icon WORK_SHEET_ICON = SVGIcon.readSVGIcon("com/fr/base/images/oem/worksheet_normal.svg", 12, 12); - private static final Icon POLY_SHEET_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/polysheet_normal.svg", 12, 12); - private static final Icon LEFT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/pre_page_normal.svg"); - private static final Icon RIGHT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/next_page_normal.svg"); - private static final Icon DISABLED_LEFT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/pre_page_disabled.svg"); - private static final Icon DISABLED_RIGHT_ICON = SVGIcon.readSVGIcon("com/fr/design/images/sheet/next_page_disabled.svg"); + private static final Icon ADD_WORK_SHEET = SVGIconUtils.readIcon("com/fr/base/images/oem/add_worksheet_normal.svg"); + protected static final Icon ADD_POLY_SHEET = SVGIconUtils.readIcon("com/fr/design/images/sheet/add_polysheet_normal.svg"); + private static final Icon WORK_SHEET_ICON = SVGIconUtils.readIcon("com/fr/base/images/oem/worksheet_normal.svg"); + private static final Icon POLY_SHEET_ICON = SVGIconUtils.readIcon("com/fr/design/images/sheet/polysheet_normal.svg"); + private static final Icon LEFT_ICON = SVGIconUtils.readIcon("com/fr/design/images/sheet/pre_page_normal.svg"); + private static final Icon RIGHT_ICON = SVGIconUtils.readIcon("com/fr/design/images/sheet/next_page_normal.svg"); + private static final Icon DISABLED_LEFT_ICON = SVGIconUtils.readIcon("com/fr/design/images/sheet/pre_page_disabled.svg"); + private static final Icon DISABLED_RIGHT_ICON = SVGIconUtils.readIcon("com/fr/design/images/sheet/next_page_disabled.svg"); private static final int NUM = 10; private static final int ICON_SEP_DISTANCE = 8; diff --git a/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java b/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java index d9a8cbf35..f5e9cface 100644 --- a/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java +++ b/designer-realize/src/main/java/com/fr/poly/actions/DeleteBlockAction.java @@ -8,7 +8,7 @@ import java.awt.event.KeyEvent; import javax.swing.KeyStroke; -import com.fr.base.svg.SVGIcon; + import com.fr.base.vcs.DesignerMode; import com.fr.design.actions.TemplateComponentActionInterface; import com.fr.design.actions.UpdateAction; @@ -26,8 +26,7 @@ public class DeleteBlockAction extends UpdateAction implements TemplateComponent this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Edit_Delete")); this.setMnemonic('D'); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)); - this.setSmallIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/delete_normal.svg")); - this.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/m_report/delete_disabled.svg")); + this.setSmallIcon("/com/fr/design/images/m_report/delete.png"); } @Override diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index fb80e8891..fe1693726 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -4,6 +4,7 @@ import com.fr.base.BaseFormula; import com.fr.design.actions.columnrow.DSColumnConditionAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.DSColumnCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dscolumn.DSColumnAdvancedPane; @@ -258,7 +259,7 @@ public class CellDSColumnEditor extends CellQuickEditor { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 - condition.setSmallIcon(null); + condition.setSmallIcon(UIConstants.BLACK_ICON); condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 438d440f6..a515c7204 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -2,6 +2,7 @@ package com.fr.quickeditor.cellquick; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.RichTextCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -47,7 +48,7 @@ public class CellRichTextEditor extends CellQuickEditor { protected void refreshDetails() { RichTextCellAction subReportCellAction = new RichTextCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(null); + subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); richTextButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java index 3f29b592a..e6c3ddf82 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -2,6 +2,7 @@ package com.fr.quickeditor.cellquick; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.SubReportCellAction; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -43,7 +44,7 @@ public class CellSubReportEditor extends CellQuickEditor { protected void refreshDetails() { SubReportCellAction subReportCellAction = new SubReportCellAction(tc); subReportCellAction.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit")); - subReportCellAction.setSmallIcon(null); + subReportCellAction.setSmallIcon(UIConstants.BLACK_ICON); subReportButton.setAction(subReportCellAction); } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index a538416fc..a9a1ccbd1 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -1,6 +1,6 @@ package com.fr.start; -import com.fr.base.svg.SVGIcon; + import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.file.WebPreviewUtils; @@ -222,8 +222,7 @@ public class MainDesigner extends BaseDesigner { private void createSaveButton() { - saveButton = new UIButton(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/save_normal.svg")); - saveButton.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/save_disabled.svg")); + saveButton = new UIButton("/com/fr/design/images/buttonicon/save.png", true); saveButton.setToolTipText(KeySetUtils.SAVE_TEMPLATE.getMenuKeySetName()); saveButton.set4ToolbarButton(); saveButton.addActionListener(new ActionListener() { @@ -239,8 +238,7 @@ public class MainDesigner extends BaseDesigner { private void createUndoButton() { - undo = new UIButton(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/undo_normal.svg")); - undo.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/undo_disabled.svg")); + undo = new UIButton("/com/fr/design/images/buttonicon/undo.png", true); undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName()); undo.set4ToolbarButton(); undo.addActionListener(new ActionListener() { @@ -255,8 +253,7 @@ public class MainDesigner extends BaseDesigner { } private void createRedoButton() { - redo = new UIButton(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/redo_normal.svg")); - redo.setDisabledIcon(SVGIcon.readSVGIcon("/com/fr/design/images/buttonicon/redo_disabled.svg")); + redo = new UIButton("/com/fr/design/images/buttonicon/redo.png", true); redo.setToolTipText(KeySetUtils.REDO.getMenuKeySetName()); redo.set4ToolbarButton(); redo.addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index f35d1e5e9..911533437 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java @@ -203,6 +203,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/type_string.png", "com/fr/base/images/cell/control/add.png", "com/fr/design/images/expand/cellAttr.gif", + "com/fr/design/images/expand/cellAttr_normal.svg", "com/fr/design/images/expand/none16x16.png", "com/fr/design/images/expand/asc.png", "com/fr/design/images/expand/des.png", @@ -212,7 +213,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/widget/tree_16.png", "com/fr/design/images/buttonicon/widget/tree_16_normal.svg", "com/fr/design/images/buttonicon/widget/comboboxtree.png", - "com/fr/design/images/buttonicon/widget/combo_box_tree_16_normal.svg", + "com/fr/design/images/buttonicon/widget/comboboxtree16_normal.svg", "com/fr/design/images/buttonicon/widget/checkbox_group_16.png", "com/fr/design/images/buttonicon/widget/checkbox_group_16_normal.svg", "com/fr/design/images/buttonicon/widget/button_group_16.png", @@ -225,6 +226,7 @@ public class ImagePreLoader { "com/fr/design/images/buttonicon/widget/button_16.png", "com/fr/design/images/buttonicon/widget/button_16_normal.svg", "com/fr/design/images/buttonicon/widget/files_up.png", + "com/fr/design/images/buttonicon/widget/files_up_normal.svg", "com/fr/design/images/buttonicon/widget/combo_box_16.png", "com/fr/design/images/buttonicon/widget/combo_box_16_normal.svg", "com/fr/design/images/buttonicon/widget/combo_check_16.png", @@ -362,11 +364,12 @@ public class ImagePreLoader { "com/fr/design/images/m_file/text.png", "com/fr/design/images/m_web/datasource.png", "com/fr/design/images/m_report/webreportattribute.png", - "com/fr/design/images/m_report/web_report_attribute_normal.svg", + "com/fr/design/images/m_report/webreportattribute_normal.svg", "com/fr/design/images/m_report/exportAttr.png", "com/fr/design/images/m_report/p.png", - "com/fr/design/images/m_report/parameter_report_normal.svg", + "com/fr/design/images/m_report/p_normal.svg", "com/fr/design/images/m_report/mobile.png", + "com/fr/design/images/m_report/mobile_normal.svg", "com/fr/web/images/print.png", "com/fr/web/images/print_normal.svg", "com/fr/design/images/m_report/watermark.png", @@ -380,11 +383,11 @@ public class ImagePreLoader { "com/fr/design/images/m_report/background.png", "com/fr/design/images/m_report/background_normal.svg", "com/fr/design/images/m_report/reportWriteAttr.png", - "com/fr/design/images/m_report/report_write_attr_normal.svg", + "com/fr/design/images/m_report/reportWriteAttr_normal.svg", "com/fr/design/images/m_report/linearAttr.png", - "com/fr/design/images/m_report/linear_attr_normal.svg", + "com/fr/design/images/m_report/linearAttr_normal.svg", "com/fr/design/images/m_report/reportEngineAttr.png", - "com/fr/design/images/m_report/report_engine_attr_normal.svg", + "com/fr/design/images/m_report/reportEngineAttr_normal.svg", "com/fr/design/images/m_report/allow_authority_edit.png", "com/fr/design/images/m_report/allow_authority_edit_normal.svg", "com/fr/design/images/m_insert/bindColumn.png", @@ -414,13 +417,18 @@ public class ImagePreLoader { "com/fr/design/images/control/addPopup.png", "com/fr/design/images/toolbarbtn/toolbarbtnclear.png", "com/fr/design/images/m_insert/insertRow.png", + "com/fr/design/images/m_insert/insertRow_normal.svg", "com/fr/design/images/m_insert/insertColumn.png", + "com/fr/design/images/m_insert/insertColumn_normal.svg", "com/fr/design/images/m_format/modified.png", + "com/fr/design/images/m_format/modified_normal.svg", "com/fr/design/images/m_format/highlight.png", + "com/fr/design/images/m_format/highlight_normal.svg", "com/fr/web/images/form/resources/preview_16.png", "com/fr/web/images/form/resources/preview_16_normal.svg", "com/fr/web/images/save.png", "com/fr/design/images/m_insert/hyperLink.png", + "com/fr/design/images/m_insert/hyperLink_normal.svg", "com/fr/web/images/flashPrint.png", "com/fr/design/images/m_edit/merge.png", "com/fr/design/images/m_edit/merge_normal.svg", @@ -431,6 +439,7 @@ public class ImagePreLoader { "com/fr/design/images/m_edit/unmerge_disabled.svg", "com/fr/web/images/pdf.png", "com/fr/design/images/m_format/cellAttr.png", + "com/fr/design/images/m_format/cellAttr_normal.svg", "com/fr/web/images/pdfPrint.png", "com/fr/web/images/serverPrint.png", "com/fr/web/images/email.png", @@ -447,6 +456,7 @@ public class ImagePreLoader { "com/fr/web/images/pageNumber.png", "com/fr/web/images/first.png", "com/fr/design/images/m_web/style.png", + "com/fr/design/images/m_web/style_normal.svg", "com/fr/web/images/last.png", "com/fr/web/images/previous.png", "com/fr/web/images/next.png", @@ -456,17 +466,20 @@ public class ImagePreLoader { "com/fr/web/images/verify.png", "com/fr/web/images/save2.png", "com/fr/design/images/m_file/export.png", + "com/fr/design/images/m_file/export_normal.svg", "com/fr/web/images/showValue.png", "com/fr/web/images/pianyi.png", "com/fr/web/images/writeOffline.png", "com/fr/web/images/edit/stash.png", "com/fr/web/images/edit/clearstash.png", "com/fr/design/images/m_insert/cell.png", + "com/fr/design/images/m_insert/cell_normal.svg", "com/fr/design/images/m_insert/float.png", "com/fr/design/images/gui/color/background.png", "com/fr/design/images/gui/color/background_normal.svg", "com/fr/design/images/m_format/cell.png", "com/fr/design/images/data/source/dataDictionary.png", + "com/fr/design/images/data/source/dataDictionary_normal.svg", "com/fr/design/images/m_format/cellstyle/bold_white.png", "com/fr/design/images/m_format/cellstyle/italic_white.png", "com/fr/design/images/m_format/cellstyle/underline_white.png",