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 0000000000..7df9a09540 --- /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 07583f3d73..aebb22ae14 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 0000000000..ba4aaa40f1 --- /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 5f4f9e5dcd..3c0b7a0363 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 49e8670bd3..048a8e1938 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 44bd365a25..aca5f3f546 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 74c4f1e76a..4420feb8f9 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 d6be9b6181..3557eb307b 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 944e8493db..d8cf3eff19 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 50ecd0ea6d..ca7bf90f75 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 5bd0fa2221..a1eee5b9a3 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 ecaac5f418..486315058b 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 50cb5f1c8e..76fd78edd8 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 3241e0588b..1cba4df966 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 13b441239d..0773dd41a8 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 32f20ad563..ea592a0726 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 c4a3250e70..d977e4be40 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 5624ae9f61..2d41496621 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 0e035bcc04..7c91b0253d 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 22e2c798ff..0ec5b9c4f5 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 fb657f475a..8a0cf4aa81 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 c24125059c..ba507644ac 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 24328ef41f..c0e9199fd4 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 0000000000..9ea75fc6d8 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/new_folder.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png new file mode 100644 index 0000000000..37df066470 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/refresh.png differ 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 0000000000..6fb2baac51 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/remove.png differ 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 0000000000..5c244dd5d4 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/rename.png differ 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 0000000000..df6cd02de6 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/vcs_list.png differ 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 0000000000..4d16dc7aea Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/FileDealerPaneIcon/view_folder.png differ 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 0000000000..5ca77fe5b2 --- /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 0000000000..7866d7b444 --- /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 0000000000..ca7b9f1c6d --- /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 0000000000..557ab9d032 --- /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 0000000000..7866d7b444 --- /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 0000000000..6723f533a6 --- /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 0000000000..ca7b9f1c6d --- /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 0000000000..f66553747e --- /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 0000000000..537d768548 --- /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 0000000000..2c8311fedd --- /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 0000000000..7d05f41837 --- /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 0000000000..93b9e7a6da --- /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 0000000000..7122f3db8f --- /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 0000000000..ba67578c14 --- /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 0000000000..85b0fd1d41 --- /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 0000000000..358dcc3574 --- /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 0000000000..ecf535ba6f --- /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 1897f74881..cb214cf19f 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 0000000000..f13090adba --- /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 0000000000..de5f21cc5a --- /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 0000000000..21717e20ab --- /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 d56e1ef2d4..1ea306685f 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 2ae2ae973e..98663dedd2 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 f366602f9c..60c4f4fa3e 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 94e434cc8d..8c5194225f 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 1e6a17b2e9..1670e30837 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 ad58ccf35f..fa43aa097a 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 95d8468369..3c5e0d14f6 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 eccee9e266..8323f72957 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 a002f56e8a..8329004f94 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 8c804863ee..eb409a8e3e 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 83a1c08501..44992a84b2 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 b2b29421c9..5725385581 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 6be7acfc23..3aa08926ab 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 30d46767fe..12702a9fb1 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 d9a8cbf35b..f5e9cfaced 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 fb80e8891d..fe16937264 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 438d440f65..a515c72047 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 3f29b592a9..e6c3ddf82e 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 a538416fc3..a9a1ccbd15 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 f35d1e5e98..9115334376 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",