Browse Source

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

feature/big-screen
Harrison 5 years ago
parent
commit
e23f0fbca8
  1. 4
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  2. 3
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java
  3. 4
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  4. 10
      designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java
  5. 28
      designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java
  6. 10
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  7. 4
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java
  8. 9
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java
  9. 4
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  10. 28
      designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

4
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -75,7 +75,7 @@ public class WebViewDlgHelper {
} }
return; return;
} }
String jar_version = PluginStoreConstants.getInstance().getProps(ENV_VERSION, StringUtils.EMPTY); String jar_version = PluginStoreConstants.getProps(ENV_VERSION, StringUtils.EMPTY);
if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) { if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) {
updateShopScripts(SHOP_SCRIPTS); updateShopScripts(SHOP_SCRIPTS);
showPluginDlg(); showPluginDlg();
@ -297,7 +297,7 @@ public class WebViewDlgHelper {
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update"); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update");
if (url != null) { if (url != null) {
String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getProps("VERSION"));
JSONObject resultJSONObject = new JSONObject(text); JSONObject resultJSONObject = new JSONObject(text);
String isLatest = resultJSONObject.optString("result"); String isLatest = resultJSONObject.optString("result");
if (!ComparatorUtils.equals(isLatest, LATEST)) { if (!ComparatorUtils.equals(isLatest, LATEST)) {

3
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java

@ -4,6 +4,7 @@ import com.fr.design.extra.PluginConstants;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
/** /**
* Created by vito on 16/5/16. * Created by vito on 16/5/16.
@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category"); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) { if (StringUtils.isNotEmpty(url)) {
HttpClient httpClient = new HttpClient(url); HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
} else { } else {

4
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?"; String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist");
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope); boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope);
if (getRecommend) { if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins(); result = PluginOperateUtils.getRecommendPlugins();
@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) { if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder(); StringBuilder url = new StringBuilder();
url.append(plistUrl); url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope); PluginOperateUtils.dealParams(url, category, seller, fee, scope);
try { try {
HttpClient httpClient = new HttpClient(url.toString()); HttpClient httpClient = new HttpClient(url.toString());

10
designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

@ -14,8 +14,8 @@ import com.fr.stable.StringUtils;
* Created by vito on 16/4/18. * Created by vito on 16/4/18.
*/ */
public class SearchOnlineExecutor implements Executor { public class SearchOnlineExecutor implements Executor {
private String result = StringUtils.EMPTY; private String result = JSONArray.create().toString();
private String keyword; private final String keyword;
public SearchOnlineExecutor(String keyword) { public SearchOnlineExecutor(String keyword) {
this.keyword = keyword; this.keyword = keyword;
@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor {
result = PluginOperateUtils.getRecommendPlugins(); result = PluginOperateUtils.getRecommendPlugins();
return; return;
} }
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store");
if (StringUtils.isEmpty(url)) {
return;
}
HttpClient httpClient = new HttpClient(url + "&keyword=" + keyword);
httpClient.asGet(); httpClient.asGet();
String responseText = httpClient.getResponseText(); String responseText = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(responseText); JSONObject jsonObject = new JSONObject(responseText);

28
designer-base/src/main/java/com/fr/design/formula/JavaEditorPane.java

@ -220,8 +220,8 @@ public class JavaEditorPane extends BasicPane {
" }\n" + " }\n" +
"\n" + "\n" +
" /**\n" + " /**\n" +
" * 获取数据集的列数\n" + " * Get the number of columns in a dataset\n" +
" * @return 数据集的列\n" + " * @return Dataset columns\n" +
" * @throws TableDataException\n" + " * @throws TableDataException\n" +
" */\n" + " */\n" +
" public int getColumnCount() throws TableDataException {\n" + " public int getColumnCount() throws TableDataException {\n" +
@ -229,9 +229,9 @@ public class JavaEditorPane extends BasicPane {
" }\n" + " }\n" +
"\n" + "\n" +
" /**\n" + " /**\n" +
" * 获取数据集指定列的列名\n" + " * Get the column name of the specified column of the dataset\n" +
" * @param columnIndex 指定列的索引\n" + " * @param columnIndex The index of the specified column\n" +
" * @return 指定列的列名\n" + " * @return The column name of the specified column\n" +
" * @throws TableDataException\n" + " * @throws TableDataException\n" +
" */\n" + " */\n" +
" public String getColumnName(int columnIndex) throws TableDataException {\n" + " public String getColumnName(int columnIndex) throws TableDataException {\n" +
@ -239,8 +239,8 @@ public class JavaEditorPane extends BasicPane {
" }\n" + " }\n" +
"\n" + "\n" +
" /**\n" + " /**\n" +
" * 获取数据集的行数\n" + " * Get the number of rows in the dataset\n" +
" * @return 数据集数据行数\n" + " * @return Dataset rows\n" +
" * @throws TableDataException\n" + " * @throws TableDataException\n" +
" */\n" + " */\n" +
" public int getRowCount() throws TableDataException {\n" + " public int getRowCount() throws TableDataException {\n" +
@ -248,10 +248,10 @@ public class JavaEditorPane extends BasicPane {
" }\n" + " }\n" +
"\n" + "\n" +
" /**\n" + " /**\n" +
" * 获取数据集指定位置上的值\n" + " * Get the value at the specified position in the dataset\n" +
" * @param rowIndex 指定的行索引\n" + " * @param rowIndex The specified row index\n" +
" * @param columnIndex 指定的列索引\n" + " * @param columnIndex The specified column index\n" +
" * @return 指定位置的值\n" + " * @return The value of the specified location\n" +
" */\n" + " */\n" +
" public Object getValueAt(int rowIndex, int columnIndex) {\n" + " public Object getValueAt(int rowIndex, int columnIndex) {\n" +
" return null;\n" + " return null;\n" +
@ -263,12 +263,12 @@ public class JavaEditorPane extends BasicPane {
"import com.fr.script.AbstractFunction;\n" + "import com.fr.script.AbstractFunction;\n" +
"\n" + "\n" +
"/**\n" + "/**\n" +
" * 自定义函数\n" + " * Custom function\n" +
" */\n" + " */\n" +
"public class CustomFun extends AbstractFunction {\n" + "public class CustomFun extends AbstractFunction {\n" +
" /**\n" + " /**\n" +
" * @param args 函数的参数,是经过了算子处理了其中特殊参数的\n" + " * @param args The parameters of the function are processed by calculator with special parameters\n" +
" * @return 经过函数处理的值,用于参与最终计算\n" + " * @return The value processed by the function is used to participate in the final calculation\n" +
" */\n" + " */\n" +
" public Object run(Object[] args) {\n" + " public Object run(Object[] args) {\n" +
" return null;\n" + " return null;\n" +

10
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -91,10 +91,10 @@ public class TableViewList extends UIList {
if (refreshList != null) { if (refreshList != null) {
refreshList.cancel(true); refreshList.cancel(true);
} }
refreshList = new SwingWorker<Void, Void>() { refreshList = new SwingWorker<DefaultListModel, Void>() {
@Override @Override
protected Void doInBackground() throws Exception { protected DefaultListModel doInBackground() throws Exception {
Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName); Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName);
boolean status = false; boolean status = false;
int count = 3; int count = 3;
@ -106,13 +106,13 @@ 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"));
} }
TableViewList.this.setModel(processDataInAnotherThread(databaseName, searchFilter, typesFilter)); return processDataInAnotherThread(databaseName, searchFilter, typesFilter);
return null;
} }
@Override
public void done() { public void done() {
try { try {
get(); TableViewList.this.setModel(get());
} catch (Exception e) { } catch (Exception e) {
if (!(e instanceof InterruptedException) && !(e instanceof CancellationException)) { if (!(e instanceof InterruptedException) && !(e instanceof CancellationException)) {
TableViewList.this.setModel(failed); TableViewList.this.setModel(failed);

4
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java

@ -358,9 +358,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane<Mo
style.setGap((int) buttonGapSpinner.getValue()); style.setGap((int) buttonGapSpinner.getValue());
style.setBorderRadius((int) buttonBorderRadiusSpinner.getValue()); style.setBorderRadius((int) buttonBorderRadiusSpinner.getValue());
if (normalBackgroundColorBox.getSelectObject() != null) {
style.setBackgroundColor(normalBackgroundColorBox.getSelectObject()); style.setBackgroundColor(normalBackgroundColorBox.getSelectObject());
}
style.setOpacity((int) normalOpacitySpinner.getValue()); style.setOpacity((int) normalOpacitySpinner.getValue());
style.setBorderLineStyle(normalBorderWidthComBox.getSelectedLineStyle()); style.setBorderLineStyle(normalBorderWidthComBox.getSelectedLineStyle());
style.setBorderColor(normalBorderColorBox.getSelectObject()); style.setBorderColor(normalBorderColorBox.getSelectObject());
@ -374,9 +372,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane<Mo
style.setFontItalic(normalFontItalicButton.isSelected()); style.setFontItalic(normalFontItalicButton.isSelected());
style.setFontBold(normalFontBoldButton.isSelected()); style.setFontBold(normalFontBoldButton.isSelected());
if (selectedBackgroundColorBox.getSelectObject() != null) {
style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject()); style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject());
}
style.setSelectedOpacity((int) selectedOpacitySpinner.getValue()); style.setSelectedOpacity((int) selectedOpacitySpinner.getValue());
style.setSelectedBorderLineStyle(selectedBorderWidthComBox.getSelectedLineStyle()); style.setSelectedBorderLineStyle(selectedBorderWidthComBox.getSelectedLineStyle());
style.setSelectedBorderColor(selectedBorderColorBox.getSelectObject()); style.setSelectedBorderColor(selectedBorderColorBox.getSelectObject());

9
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java

@ -12,6 +12,7 @@ import com.fr.design.mainframe.widget.MobileTabFontConfPane;
import com.fr.design.mainframe.widget.UITitleSplitLine; import com.fr.design.mainframe.widget.UITitleSplitLine;
import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane; import com.fr.design.mainframe.widget.preview.MobileTemplatePreviewPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.style.color.NewColorSelectBox;
import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout;
import com.fr.general.cardtag.mobile.MobileTemplateStyle; import com.fr.general.cardtag.mobile.MobileTemplateStyle;
import com.fr.general.cardtag.mobile.TabFontConfig; import com.fr.general.cardtag.mobile.TabFontConfig;
@ -33,8 +34,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
private UnsignedIntUISpinner paddingLeftSpinner; private UnsignedIntUISpinner paddingLeftSpinner;
private UnsignedIntUISpinner paddingRightSpinner; private UnsignedIntUISpinner paddingRightSpinner;
private ColorSelectBox initialBackgroundColorBox; private NewColorSelectBox initialBackgroundColorBox;
private ColorSelectBox selectedBackgroundColorBox; private NewColorSelectBox selectedBackgroundColorBox;
private LineComboBox borderWidthComboBox; private LineComboBox borderWidthComboBox;
private ColorSelectBox borderColorBox; private ColorSelectBox borderColorBox;
@ -96,9 +97,9 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
} }
private JPanel createBackgroundColorConfPanel() { private JPanel createBackgroundColorConfPanel() {
this.initialBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); this.initialBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH);
this.initialBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); this.initialBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT));
this.selectedBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH); this.selectedBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH);
this.selectedBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT)); this.selectedBackgroundColorBox.setPreferredSize(new Dimension(LINE_COMPONENT_WIDTH, LINE_COMPONENT_HEIGHT));
UILabel initialBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill") + ":", SwingConstants.RIGHT); UILabel initialBackgroundColorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Init_Fill") + ":", SwingConstants.RIGHT);

4
designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java

@ -1,6 +1,7 @@
package com.fr.design.chart; package com.fr.design.chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartComponent;
@ -17,6 +18,7 @@ import com.fr.module.Activator;
import com.fr.module.extension.Prepare; import com.fr.module.extension.Prepare;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.map.server.ChartMapEditorAction; import com.fr.van.chart.map.server.ChartMapEditorAction;
/** /**
@ -47,6 +49,8 @@ public class ChartDesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
GEOJSONHelper.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
ChartTypeInterfaceManager.addPluginChangedListener(); ChartTypeInterfaceManager.addPluginChangedListener();
} }

28
designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -6,26 +6,32 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.extra.PluginConstants; import com.fr.design.extra.PluginConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.IOUtils;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent; import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.*; import javax.swing.ImageIcon;
import java.awt.*; import javax.swing.JDialog;
import java.awt.event.WindowAdapter; import javax.swing.JFrame;
import java.awt.event.WindowEvent; import javax.swing.JOptionPane;
import java.awt.image.BufferedImage; import javax.swing.JPanel;
import javax.swing.JProgressBar;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
/** /**
* Created by shine on 2017/8/21. * Created by shine on 2017/8/21.
@ -51,13 +57,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
//总共字节数 //总共字节数
private double totalBytes = 0; private double totalBytes = 0;
private static final double PHANTOM_MB = 96.1 * 1024 * 1024;
public void addPhantomSiteInfo() {
this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB);
}
private static final double MAP_JSON_MB = 4.5 * 1024 * 1024; private static final double MAP_JSON_MB = 4.5 * 1024 * 1024;
public void addMapJSONSiteInfo() { public void addMapJSONSiteInfo() {
@ -219,7 +218,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
@Override @Override
public void downloadSources() { public void downloadSources() {
this.addMapJSONSiteInfo(); this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline(); this.installOnline();
} }

Loading…
Cancel
Save