Browse Source

Merge pull request #3693 in DESIGN/design from feature/10.0 to feature/x

* commit '01ff783e9567684942968b7a11c31a8deff44436':
  热力地图
  CHART-18383 地图部分icon国际化优化
  CHART-17714 轮播gis点地图-卫星图层-预览控制台抛错
  REPORT-48318   改成给search传参,避免造成卡顿问题
  REPORT-42238 【10.0.13】JDK11设计器图标模糊问题优化 【问题原因】IOUtils.readResource()方法里会对实现了ResourcePathTransformer接口的某些插件资源进行文件路径的替换,而之前依靠IOUtils.readResource()判断文件是否存在时,没有考虑这一点,紧接着去读Icon的时候仍然使用了原始路径,造成了路径不一致的问题,可能导致bug 【改动思路】把IOUtils中的transformPath逻辑搬了一套过来,保证判断资源是否存在和读取资源的路径一致
  REPORT-48318   刷新时才去更新缓存
persist/11.0
superman 4 years ago
parent
commit
cb818ebb2f
  1. 38
      designer-base/src/main/java/com/fr/base/svg/IconUtils.java
  2. 37
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  3. 20
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  4. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png
  5. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png
  6. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png
  7. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png
  8. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png
  9. BIN
      designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png
  10. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png
  11. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png
  12. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png
  13. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png
  14. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java
  15. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

38
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<ResourcePathTransformer> set = getResourcePathTransformers();
for (ResourcePathTransformer transformer : set) {
if (transformer.accept(path)) {
return transformer.transform(path);
}
}
return path;
}
private static Set<ResourcePathTransformer> getResourcePathTransformers() {
Set<ResourcePathTransformer> set = new HashSet<ResourcePathTransformer>();
ExtraClassManagerProvider provider = StableFactory.getExtraClassManager();
if (provider != null) {
Set<ResourcePathTransformer> 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;
}
}

37
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) {

20
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);

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 810 B

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 750 B

After

Width:  |  Height:  |  Size: 905 B

BIN
designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 819 B

BIN
designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java

@ -31,6 +31,8 @@ public abstract class AbstractFRLayoutDefinePane<T extends WSortLayout> extends
for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) {
destLayout.addListener(srcLayout.getListener(i));
}
srcLayout.clearListeners();
srcLayout.clearMobileWidgetList();
}
}

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -207,7 +207,7 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
}
xwAbsoluteBodyLayout.add(component);
}
copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout);
copyLayoutAttr(wFitLayout, xwAbsoluteBodyLayout.toData());
xWFitLayout.setBackupParent(xwAbsoluteBodyLayout);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(

Loading…
Cancel
Save