diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java index 84fe9d6609..ea0f00973a 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.SVGLoader; import com.fr.data.impl.DBTableData; import com.fr.design.actions.tabledata.TableDataAction; @@ -140,8 +141,20 @@ public class TableDataNameObjectCreator extends NameObjectCreator { return iconPath; } + /** + * 菜单图标,后续WarningIcon优化 + * @return Icon + */ private Icon createMenuIcon() { - return b ? new WarningIcon(this.menuImage) : this.menuIcon; + if(b) { + if (this.menuIcon instanceof LazyIcon) { + LazyIcon lazyIcon = (LazyIcon) this.menuIcon; + return new LazyIcon(lazyIcon.getId() + "_warning"); + } else { + return new WarningIcon(this.menuImage); + } + } + return this.menuIcon; } /** diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index 6f12289fff..93cd98ffcd 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -166,6 +166,7 @@ public class FileTableDataPane extends AbstractTableDataPane { rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10)); rightPanel.add(getTextSetPanel()); fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel)); + rightPanel.setPreferredSize(FineUIScale.scale(new Dimension(-1, 400))); //文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局 this.add(column(LayoutConstants.VERTICAL_GAP, @@ -274,12 +275,14 @@ public class FileTableDataPane extends AbstractTableDataPane { encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type")); encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); encodingComboBox.setSelectedIndex(4); - return column( + JPanel xmlSetPanel = new JPanel(new BorderLayout()); + xmlSetPanel.add(column( LayoutConstants.VGAP_MEDIUM, row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)), - cell(new XMLNodeTreePane()), + cell(new XMLNodeTreePane()).weight(1), cell(getPreviewPanel()) - ).getComponent(); + ).getComponent()); + return xmlSetPanel; } /** @@ -288,7 +291,9 @@ public class FileTableDataPane extends AbstractTableDataPane { */ private JPanel getExcelSetPanel() { needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false); - return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent(); + JPanel excelSetPanel = new JPanel(new BorderLayout()); + excelSetPanel.add(column(cell(needColumnNameCheckBox), flex(1), cell(getPreviewPanel())).getComponent()); + return excelSetPanel; } private String getFilePathFromUrlOrLocal() { @@ -335,7 +340,9 @@ public class FileTableDataPane extends AbstractTableDataPane { //编码类型 encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type")); charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); - return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent(); + JPanel textSetPanel = new JPanel(new BorderLayout()); + textSetPanel.add(column(cell(getTxtCenterPane()), flex(1), cell(getPreviewPanel())).getComponent()); + return textSetPanel; } /** diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java index f2442e7e84..00a2a7c87c 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java @@ -1,9 +1,8 @@ package com.fr.design.data.tabledata.wrapper; +import com.fine.theme.icon.LazyIcon; import com.fr.base.TableData; -import com.fr.base.svg.SVGLoader; import com.fr.data.impl.DBTableData; -import com.fr.design.icon.WarningIcon; import com.fr.stable.StringUtils; import javax.swing.Icon; @@ -20,7 +19,7 @@ public final class TemplateTableDataWrapper extends AbstractTableDataWrapper { @Override public Icon getIcon() { if (tabledata instanceof DBTableData && StringUtils.isBlank(((DBTableData) tabledata).getQuery())) { - return new WarningIcon(SVGLoader.load("/com/fr/design/standard/database.svg")); + return new LazyIcon("database_warning"); } return TableDataFactory.getIcon(tabledata); } diff --git a/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java b/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java index 5eca345207..e62df8b59b 100644 --- a/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java @@ -42,7 +42,9 @@ public interface PreviewProvider extends Mutable, Filter { * 下拉弹出菜单的图标Id * @return 图标Id */ - String iconIdForPopupItem(); + default String iconIdForPopupItem() { + return StringUtils.EMPTY; + } /** * 点击下拉菜单时触发的事件 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 09f63b9fa6..0a99b80b20 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -9,6 +9,7 @@ import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; import com.fr.base.iofile.attr.TemplateThemeAttrMark; +import com.fr.base.svg.IconUtils; import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateThemeCompatible; import com.fr.base.theme.TemplateThemeConfig; @@ -1458,7 +1459,23 @@ public abstract class JTemplate> */ public Icon getPreviewLargeIcon() { PreviewProvider provider = getPreviewType(); - return new LazyIcon(provider.iconIdForPopupItem(), 32); + if(StringUtils.isEmpty(provider.iconIdForPopupItem())) { + return IconUtils.readIcon(provider.iconPathForLarge()); + } else { + return new LazyIcon(provider.iconIdForPopupItem(), 32); + } + } + + /** + * 获取预览图标,兼容老图标获取方式(存在插件中未实现新图标) + * @return Icon + */ + public Icon getPreviewIcon(PreviewProvider provider) { + if(StringUtils.isEmpty(provider.iconIdForPopupItem())) { + return IconUtils.readIcon(provider.iconPathForPopupItem()); + } else { + return new LazyIcon(provider.iconIdForPopupItem()); + } } /** diff --git a/designer-base/src/main/resources/com/fine/theme/icon/dataset/database_warning.svg b/designer-base/src/main/resources/com/fine/theme/icon/dataset/database_warning.svg new file mode 100644 index 0000000000..b9ab63749f --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/dataset/database_warning.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter.svg b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter.svg new file mode 100644 index 0000000000..72603f8e82 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_disable.svg new file mode 100644 index 0000000000..ec36c9d5cc --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_disable.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_popup.svg b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_popup.svg new file mode 100644 index 0000000000..f5dec3450d --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_popup.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 1aeb2eef61..ff985b133a 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -35,6 +35,7 @@ "views": "views.svg", "preview_sql": "previewSql.svg", "database": "dataset/database.svg", + "database_warning": "dataset/database_warning.svg", "preview": "dataset/preview.svg", "connection": "dataset/connection.svg", "class_table_data": "dataset/class_table_data.svg", @@ -171,6 +172,8 @@ "add_popup": "toolbar/add_popup.svg", "bracket": "toolbar/bracket.svg", "unBracket": "toolbar/unBracket.svg", + "filter": "toolbar/filter.svg", + "filter_popup": "toolbar/filter_popup.svg", "param_edit": "param/edit.svg", "param_edit_pressed": "param/edit_pressed.svg", "param_hide": "param/hide.svg", 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 47265b50ae..7b4206fc87 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 @@ -816,13 +816,6 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm menuItems = new ArrayList(); PreviewProvider[] previewProviders = supportPreview(); for (final PreviewProvider provider : previewProviders) { - UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), new LazyIcon(provider.iconIdForPopupItem())); + UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), getPreviewIcon(provider)); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { 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 b972528be8..2d55945bf3 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 @@ -982,7 +982,7 @@ public class JWorkBook extends JTemplate { List menuItems = new ArrayList(); PreviewProvider[] previewProviders = supportPreview(); for (final PreviewProvider provider : previewProviders) { - UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), new LazyIcon(provider.iconIdForPopupItem())); + UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), getPreviewIcon(provider)); item.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -1082,15 +1082,6 @@ public class JWorkBook extends JTemplate { centerPane.needToShowCoverAndHidPane(); } - @Override - /** - * - */ - public Icon getPreviewLargeIcon() { - PreviewProvider provider = getPreviewType(); - return new LazyIcon(provider.iconIdForPopupItem(), 32); - } - /** * 获取当前workBook的参数及默认值 * 同名参数的话模板参数覆盖全局参数 diff --git a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java index 55ec0a9887..1cdd900a38 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java @@ -3,6 +3,7 @@ */ package com.fr.design.report; +import com.fine.theme.utils.FineUIStyle; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -255,7 +256,7 @@ public class PageSetupPane extends BasicPane { temp.append(" "); } zeroMarginWarn = new UILabel("" + temp + "

"); - zeroMarginWarn.setForeground(Color.RED); + FineUIStyle.setStyle(zeroMarginWarn, FineUIStyle.LABEL_WARNING_TIP); // left marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java index 514b6b0dd7..f8fe2ed6f1 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java @@ -66,7 +66,7 @@ public class ReportWebWidgetConstants { // flash打印按钮 public static final WidgetOption FLASHPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"), - BaseUtils.readIcon("/com/fr/web/images/flashPrint.png"), FlashPrint.class); + new LazyIcon("flashFile"), FlashPrint.class); // appletprint public static final WidgetOption APPLETPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Applet_Print"),