diff --git a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java index 4b5f1b8817..79d3cef76b 100644 --- a/designer-base/src/main/java/com/fr/base/svg/IconUtils.java +++ b/designer-base/src/main/java/com/fr/base/svg/IconUtils.java @@ -2,9 +2,15 @@ package com.fr.base.svg; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.fun.ResourcePathTransformer; +import com.fr.stable.plugin.ExtraClassManagerProvider; import javax.swing.Icon; import javax.swing.ImageIcon; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; /** * 主要是用来读取svgIcon的工具类 @@ -36,7 +42,7 @@ public class IconUtils { // 判断是否以.svg结尾 if (resource.endsWith(ICON_SUFFIX_SVG)) { if (IOUtils.readResource(resource) != null) { - return SVGIcon.readSVGIcon(resource); + return SVGIcon.readSVGIcon(transformPath(resource)); } // 适配插件 return adjustPluginsPng(resource); @@ -68,15 +74,15 @@ public class IconUtils { private static Icon readNoSuffixResource(String resource, String svgIconType) { String svgPath = resource + svgIconType; if (IOUtils.readResource(svgPath) != null) { - return SVGIcon.readSVGIcon(svgPath); + return SVGIcon.readSVGIcon(transformPath(svgPath)); } String pngPath = resource + ICON_SUFFIX_PNG; if (IOUtils.readResource(pngPath) != null) { - return IOUtils.readIcon(pngPath); + return IOUtils.readIcon(transformPath(pngPath)); } String gifPath = resource + ICON_SUFFIX_GIF; if (IOUtils.readResource(gifPath) != null) { - return IOUtils.readIcon(gifPath); + return IOUtils.readIcon(transformPath(gifPath)); } FineLoggerFactory.getLogger().error("File not exists:{}", resource); return new ImageIcon(); @@ -113,8 +119,30 @@ public class IconUtils { 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 SVGIcon.readSVGIcon(transformPath(iconPath)); } return readIcon(resource); } + + private static String transformPath(String path) { + Set set = getResourcePathTransformers(); + for (ResourcePathTransformer transformer : set) { + if (transformer.accept(path)) { + return transformer.transform(path); + } + } + return path; + } + + private static Set getResourcePathTransformers() { + Set set = new HashSet(); + ExtraClassManagerProvider provider = StableFactory.getExtraClassManager(); + if (provider != null) { + Set pluginProvided = provider.getArray(ResourcePathTransformer.MARK_STRING); + set.addAll(pluginProvided); + } + ResourcePathTransformer[] oemSet = StableFactory.getMarkedObjectsFromCollection(ResourcePathTransformer.MARK_STRING, ResourcePathTransformer.class); + set.addAll(Arrays.asList(oemSet)); + return set; + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java index 4b4d668666..a979a20cd6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java @@ -1,27 +1,32 @@ package com.fr.design.data.datapane.connect; import com.fr.base.BaseUtils; +import com.fr.data.core.db.TableProcedure; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; -import com.fr.design.constants.UIConstants; -import com.fr.data.core.db.TableProcedure; import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.ilist.TableViewList; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.dialog.BasicPane; import com.fr.general.GeneralContext; - import com.fr.stable.ArrayUtils; -import javax.swing.*; +import javax.swing.JPanel; +import javax.swing.ToolTipManager; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; import java.util.List; /** @@ -48,10 +53,11 @@ public class ConnectionTableProcedurePane extends BasicPane { filter(connection, conName, nameList); } + @Override protected void refreshItems() { super.refreshItems(); if (tableViewList != null) { - search(); + search(true); } } }; @@ -148,17 +154,17 @@ public class ConnectionTableProcedurePane extends BasicPane { @Override public void removeUpdate(DocumentEvent e) { - search(); + search(false); } @Override public void insertUpdate(DocumentEvent e) { - search(); + search(false); } @Override public void changedUpdate(DocumentEvent e) { - search(); + search(false); } }; @@ -166,14 +172,14 @@ public class ConnectionTableProcedurePane extends BasicPane { @Override public void actionPerformed(ActionEvent e) { - search(); + search(false); } }; /** * 选项改变,需要重新刷新下拉列表里面的项 */ - protected void search() { + protected void search(boolean refresh) { String selectedObj = connectionComboBox.getSelectedItem(); String[] types = ArrayUtils.EMPTY_STRING_ARRAY; @@ -187,7 +193,7 @@ public class ConnectionTableProcedurePane extends BasicPane { } else { types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE); } - tableViewList.populate(selectedObj, searchField.getText().trim(), types); + tableViewList.populate(selectedObj, searchField.getText().trim(), refresh, types); } @Override @@ -196,7 +202,6 @@ public class ConnectionTableProcedurePane extends BasicPane { } /** - * * @param l */ public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) { diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java index ec05732c62..ba29288fc8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java @@ -82,7 +82,7 @@ public class TableViewList extends UIList { * @param searchFilter * @param typesFilter */ - public void populate(final String databaseName, final String searchFilter, final String... typesFilter) { + public void populate(final String databaseName, final String searchFilter, boolean refresh, final String... typesFilter) { DefaultListModel defaultListModel = new DefaultListModel(); defaultListModel.addElement(UIConstants.PENDING); final DefaultListModel failed = new DefaultListModel(); @@ -106,12 +106,9 @@ public class TableViewList extends UIList { if (!status) { throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); } - String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); - schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; - for (String schema : schemas) { - clearCache(datasource, schema); + if (refresh) { + clearCache(datasource); } - clearCache(datasource, null); return processDataInAnotherThread(databaseName, searchFilter, typesFilter); } @@ -132,7 +129,16 @@ public class TableViewList extends UIList { } } - private void clearCache(Connection datasource, String schema) { + private void clearCache(Connection datasource) { + String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); + schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; + for (String schema : schemas) { + doClearCache(datasource, schema); + } + doClearCache(datasource, null); + } + + private void doClearCache(Connection datasource, String schema) { DataCoreUtils.refreshTables(datasource, TableProcedure.TABLE, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema); diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png index 6459771dbc..a9cf86bdbc 100644 Binary files a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png and b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png differ diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png index 6e6c2146c4..538473be1c 100644 Binary files a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png and b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png differ diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png index 6459771dbc..649e1054fc 100644 Binary files a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png and b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png b/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png index 35afc77816..f1be7c1e6d 100644 Binary files a/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png b/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png index f6659740dd..30a32e34e6 100644 Binary files a/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png b/designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png old mode 100644 new mode 100755 index 6f28e1c254..9748b2e8d1 Binary files a/designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png and b/designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png b/designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png old mode 100644 new mode 100755 index ebdcf55670..1eb12abafc Binary files a/designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png b/designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png old mode 100644 new mode 100755 index 557b7966d4..640b6c80ea Binary files a/designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png b/designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png old mode 100644 new mode 100755 index 1734b8ac53..8fcbd071d8 Binary files a/designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png differ diff --git a/designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png b/designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png old mode 100644 new mode 100755 index 9c77308d26..b3f27a072f Binary files a/designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png and b/designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png differ diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java index 0a718ee60c..efa2729c2c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java @@ -31,6 +31,8 @@ public abstract class AbstractFRLayoutDefinePane extends for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) { destLayout.addListener(srcLayout.getListener(i)); } + srcLayout.clearListeners(); + srcLayout.clearMobileWidgetList(); } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index 4481307bff..e073b2b15c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -207,7 +207,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane