Browse Source

Merge branch 'release/10.0' of https://code.fineres.com/scm/~hades/design into release/10.0

feature/big-screen
hades 4 years ago
parent
commit
26e3d8f9ac
  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. 3
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  5. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartCommonMarkerConditionPane.java
  6. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/drillmap.png
  7. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/heatmap.png
  8. BIN
      designer-chart/src/main/resources/com/fr/design/images/form/toolbar/map.png
  9. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/area-map.png
  10. BIN
      designer-chart/src/main/resources/com/fr/van/chart/drillmap/images/point-map.png
  11. BIN
      designer-chart/src/main/resources/com/fr/van/chart/heatmap/images/heatmap.png
  12. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/area-map.png
  13. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/custom-map.png
  14. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/line-map.png
  15. BIN
      designer-chart/src/main/resources/com/fr/van/chart/map/images/point-map.png
  16. 8
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  17. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/AbstractFRLayoutDefinePane.java
  18. 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.general.IOUtils;
import com.fr.log.FineLoggerFactory; 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.Icon;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
/** /**
* 主要是用来读取svgIcon的工具类 * 主要是用来读取svgIcon的工具类
@ -36,7 +42,7 @@ public class IconUtils {
// 判断是否以.svg结尾 // 判断是否以.svg结尾
if (resource.endsWith(ICON_SUFFIX_SVG)) { if (resource.endsWith(ICON_SUFFIX_SVG)) {
if (IOUtils.readResource(resource) != null) { if (IOUtils.readResource(resource) != null) {
return SVGIcon.readSVGIcon(resource); return SVGIcon.readSVGIcon(transformPath(resource));
} }
// 适配插件 // 适配插件
return adjustPluginsPng(resource); return adjustPluginsPng(resource);
@ -68,15 +74,15 @@ public class IconUtils {
private static Icon readNoSuffixResource(String resource, String svgIconType) { private static Icon readNoSuffixResource(String resource, String svgIconType) {
String svgPath = resource + svgIconType; String svgPath = resource + svgIconType;
if (IOUtils.readResource(svgPath) != null) { if (IOUtils.readResource(svgPath) != null) {
return SVGIcon.readSVGIcon(svgPath); return SVGIcon.readSVGIcon(transformPath(svgPath));
} }
String pngPath = resource + ICON_SUFFIX_PNG; String pngPath = resource + ICON_SUFFIX_PNG;
if (IOUtils.readResource(pngPath) != null) { if (IOUtils.readResource(pngPath) != null) {
return IOUtils.readIcon(pngPath); return IOUtils.readIcon(transformPath(pngPath));
} }
String gifPath = resource + ICON_SUFFIX_GIF; String gifPath = resource + ICON_SUFFIX_GIF;
if (IOUtils.readResource(gifPath) != null) { if (IOUtils.readResource(gifPath) != null) {
return IOUtils.readIcon(gifPath); return IOUtils.readIcon(transformPath(gifPath));
} }
FineLoggerFactory.getLogger().error("File not exists:{}", resource); FineLoggerFactory.getLogger().error("File not exists:{}", resource);
return new ImageIcon(); return new ImageIcon();
@ -113,8 +119,30 @@ public class IconUtils {
private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) { private static Icon readSpecifiedTypeIcon(String resource, String oldSuffix, String newSuffix) {
String iconPath = resource.replace(oldSuffix, newSuffix); String iconPath = resource.replace(oldSuffix, newSuffix);
if (IOUtils.readResource(iconPath) != null) { if (IOUtils.readResource(iconPath) != null) {
return SVGIcon.readSVGIcon(iconPath); return SVGIcon.readSVGIcon(transformPath(iconPath));
} }
return readIcon(resource); 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; package com.fr.design.data.datapane.connect;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.AbstractDatabaseConnection;
import com.fr.data.impl.Connection; 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.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.icheckbox.UICheckBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; 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.ilist.TableViewList;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.stable.ArrayUtils; 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.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.event.*; 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; import java.util.List;
/** /**
@ -48,10 +53,11 @@ public class ConnectionTableProcedurePane extends BasicPane {
filter(connection, conName, nameList); filter(connection, conName, nameList);
} }
@Override
protected void refreshItems() { protected void refreshItems() {
super.refreshItems(); super.refreshItems();
if (tableViewList != null) { if (tableViewList != null) {
search(); search(true);
} }
} }
}; };
@ -148,17 +154,17 @@ public class ConnectionTableProcedurePane extends BasicPane {
@Override @Override
public void removeUpdate(DocumentEvent e) { public void removeUpdate(DocumentEvent e) {
search(); search(false);
} }
@Override @Override
public void insertUpdate(DocumentEvent e) { public void insertUpdate(DocumentEvent e) {
search(); search(false);
} }
@Override @Override
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
search(); search(false);
} }
}; };
@ -166,14 +172,14 @@ public class ConnectionTableProcedurePane extends BasicPane {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
search(); search(false);
} }
}; };
/** /**
* 选项改变需要重新刷新下拉列表里面的项 * 选项改变需要重新刷新下拉列表里面的项
*/ */
protected void search() { protected void search(boolean refresh) {
String selectedObj = connectionComboBox.getSelectedItem(); String selectedObj = connectionComboBox.getSelectedItem();
String[] types = ArrayUtils.EMPTY_STRING_ARRAY; String[] types = ArrayUtils.EMPTY_STRING_ARRAY;
@ -187,7 +193,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
} else { } else {
types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE); types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE);
} }
tableViewList.populate(selectedObj, searchField.getText().trim(), types); tableViewList.populate(selectedObj, searchField.getText().trim(), refresh, types);
} }
@Override @Override
@ -196,7 +202,6 @@ public class ConnectionTableProcedurePane extends BasicPane {
} }
/** /**
*
* @param l * @param l
*/ */
public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener 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 searchFilter
* @param typesFilter * @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 defaultListModel = new DefaultListModel();
defaultListModel.addElement(UIConstants.PENDING); defaultListModel.addElement(UIConstants.PENDING);
final DefaultListModel failed = new DefaultListModel(); final DefaultListModel failed = new DefaultListModel();
@ -106,12 +106,9 @@ public class TableViewList extends UIList {
if (!status) { if (!status) {
throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); throw new Exception(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
} }
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); if (refresh) {
schemas = (schemas == null || schemas.length == 0) ? new String[]{null} : schemas; clearCache(datasource);
for (String schema : schemas) {
clearCache(datasource, schema);
} }
clearCache(datasource, null);
return processDataInAnotherThread(databaseName, searchFilter, typesFilter); 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.TABLE, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.VIEW, schema);
DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema); DataCoreUtils.refreshTables(datasource, TableProcedure.PROCEDURE, schema);

3
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -59,7 +59,8 @@ public class Assistant {
if (path.endsWith(".svg")) { if (path.endsWith(".svg")) {
return "image/svg+xml"; return "image/svg+xml";
} }
if (path.endsWith(".png")) { // upm 文件夹中的图片如果返回 Content-type 为 image/png 时会显示异常
if (path.endsWith(".png") && !path.contains("/upm")) {
return "image/png"; return "image/png";
} }
if (path.endsWith(".woff")) { if (path.endsWith(".woff")) {

5
designer-chart/src/main/java/com/fr/van/chart/map/designer/other/condition/item/VanChartCommonMarkerConditionPane.java

@ -2,7 +2,6 @@ package com.fr.van.chart.map.designer.other.condition.item;
import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.van.chart.designer.other.condition.item.AbstractNormalMultiLineConditionPane; import com.fr.van.chart.designer.other.condition.item.AbstractNormalMultiLineConditionPane;
import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane; import com.fr.van.chart.map.designer.style.series.VanChartMapScatterMarkerPane;
@ -30,6 +29,10 @@ public class VanChartCommonMarkerConditionPane extends AbstractNormalMultiLineCo
return commonMarkerPane; return commonMarkerPane;
} }
public void setDefault() {
this.populate(new VanChartAttrMarker());
}
/** /**
* 条目名称 * 条目名称
* *

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

8
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -474,7 +474,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
*/ */
@Override @Override
public void updateUI() { public void updateUI() {
setUI(new FormDesignerUI(){ setUI(new FormDesignerUI() {
@Override @Override
protected Rectangle getFitPaintBounds(Component component, Component parent) { protected Rectangle getFitPaintBounds(Component component, Component parent) {
return new Rectangle(0, 0, parent.getSize().width, parent.getSize().height); return new Rectangle(0, 0, parent.getSize().width, parent.getSize().height);
@ -694,8 +694,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query")); formSubmitButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Query"));
XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton); XCreator xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION if (this.autoAddComponent(xCreator, H_COMPONENT_GAP * 3 + H_GAP, FIRST_V_LOCATION
+ V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE))) {
currentIndex = ((int) Math.ceil((currentIndex + 1) / (double) NUM_IN_A_LINE)) * NUM_IN_A_LINE; currentIndex = ((int) Math.ceil((currentIndex + 1) / (double) NUM_IN_A_LINE)) * NUM_IN_A_LINE;
} }
} }
@ -741,7 +741,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
@Override @Override
public boolean checkIfBeyondValidArea(MouseEvent e){ public boolean checkIfBeyondValidArea(MouseEvent e) {
return false; return false;
} }

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++) { for (int i = 0, len = srcLayout.getListenerSize(); i < len; i++) {
destLayout.addListener(srcLayout.getListener(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); xwAbsoluteBodyLayout.add(component);
} }
copyLayoutAttr(wFitLayout, wAbsoluteBodyLayout); copyLayoutAttr(wFitLayout, xwAbsoluteBodyLayout.toData());
xWFitLayout.setBackupParent(xwAbsoluteBodyLayout); xWFitLayout.setBackupParent(xwAbsoluteBodyLayout);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(

Loading…
Cancel
Save