Browse Source

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

feature/big-screen
Hugh.C 5 years ago
parent
commit
6f0ec0d1e1
  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. 13
      designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java
  7. 10
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  8. 5
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  9. 8
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SidebarMobileBookMarkStyleCustomDefinePane.java
  10. 9
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UniteStyleDefinePane.java
  11. 6
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java
  12. 41
      designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java
  13. 8
      designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java
  14. 9
      designer-base/src/main/java/com/fr/design/utils/DesignerPort.java
  15. 30
      designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java
  16. 4
      designer-chart/src/main/java/com/fr/design/chart/ChartDesignerActivator.java
  17. 7
      designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java
  18. 28
      designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java
  19. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java
  20. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  21. 12
      designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java
  22. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java
  23. 12
      designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java
  24. 34
      designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

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

@ -75,7 +75,7 @@ public class WebViewDlgHelper {
}
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)) {
updateShopScripts(SHOP_SCRIPTS);
showPluginDlg();
@ -297,7 +297,7 @@ public class WebViewDlgHelper {
protected Void doInBackground() throws Exception {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update");
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);
String isLatest = resultJSONObject.optString("result");
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.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
/**
* Created by vito on 16/5/16.
@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override
public void run(Process<String> process) {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) {
if (StringUtils.isNotEmpty(url)) {
HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText();
} else {

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

@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override
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);
if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins();
@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl);
url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope);
try {
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.
*/
public class SearchOnlineExecutor implements Executor {
private String result = StringUtils.EMPTY;
private String keyword;
private String result = JSONArray.create().toString();
private final String keyword;
public SearchOnlineExecutor(String keyword) {
this.keyword = keyword;
@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor {
result = PluginOperateUtils.getRecommendPlugins();
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();
String responseText = httpClient.getResponseText();
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" +
" * @return 数据集的列\n" +
" * Get the number of columns in a dataset\n" +
" * @return Dataset columns\n" +
" * @throws TableDataException\n" +
" */\n" +
" public int getColumnCount() throws TableDataException {\n" +
@ -229,9 +229,9 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集指定列的列名\n" +
" * @param columnIndex 指定列的索引\n" +
" * @return 指定列的列名\n" +
" * Get the column name of the specified column of the dataset\n" +
" * @param columnIndex The index of the specified column\n" +
" * @return The column name of the specified column\n" +
" * @throws TableDataException\n" +
" */\n" +
" public String getColumnName(int columnIndex) throws TableDataException {\n" +
@ -239,8 +239,8 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集的行数\n" +
" * @return 数据集数据行数\n" +
" * Get the number of rows in the dataset\n" +
" * @return Dataset rows\n" +
" * @throws TableDataException\n" +
" */\n" +
" public int getRowCount() throws TableDataException {\n" +
@ -248,10 +248,10 @@ public class JavaEditorPane extends BasicPane {
" }\n" +
"\n" +
" /**\n" +
" * 获取数据集指定位置上的值\n" +
" * @param rowIndex 指定的行索引\n" +
" * @param columnIndex 指定的列索引\n" +
" * @return 指定位置的值\n" +
" * Get the value at the specified position in the dataset\n" +
" * @param rowIndex The specified row index\n" +
" * @param columnIndex The specified column index\n" +
" * @return The value of the specified location\n" +
" */\n" +
" public Object getValueAt(int rowIndex, int columnIndex) {\n" +
" return null;\n" +
@ -263,12 +263,12 @@ public class JavaEditorPane extends BasicPane {
"import com.fr.script.AbstractFunction;\n" +
"\n" +
"/**\n" +
" * 自定义函数\n" +
" * Custom function\n" +
" */\n" +
"public class CustomFun extends AbstractFunction {\n" +
" /**\n" +
" * @param args 函数的参数,是经过了算子处理了其中特殊参数的\n" +
" * @return 经过函数处理的值,用于参与最终计算\n" +
" * @param args The parameters of the function are processed by calculator with special parameters\n" +
" * @return The value processed by the function is used to participate in the final calculation\n" +
" */\n" +
" public Object run(Object[] args) {\n" +
" return null;\n" +

13
designer-base/src/main/java/com/fr/design/gui/frpane/tree/layer/config/LayerDataConfigPane.java

@ -7,6 +7,7 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.present.dict.TableDataDictPane;
import com.fr.form.ui.tree.LayerConfig;
import com.fr.form.ui.tree.LayerDependence;
import com.fr.stable.StringUtils;
import java.awt.*;
import java.util.*;
@ -73,13 +74,19 @@ public class LayerDataConfigPane extends BasicBeanPane<LayerConfig> {
if (wrapper != null) {
columnNames = wrapper.calculateColumnNameList();
} else {
columnNames = new ArrayList<String>();
columnNames = new ArrayList<>();
}
String viewColStr = tableDataDictPane.updateBean().getValueColumnName();
String modelColStr = tableDataDictPane.updateBean().getKeyColumnName();
TableDataDictionary dictionary = tableDataDictPane.updateBean();
String viewColStr = dictionary.getValueColumnName();
String modelColStr = dictionary.getKeyColumnName();
int viewCol = columnNames.indexOf(viewColStr);
int modelCol = columnNames.indexOf(modelColStr);
if (StringUtils.EMPTY.equals(viewColStr)) {
viewCol = dictionary.getValueColumnIndex();
}
if (StringUtils.EMPTY.equals(modelColStr)) {
modelCol = dictionary.getKeyColumnIndex();
}
//将数据设置到当前正在修改的layerData中
this.layerConfig.setDictionary(dictionary);
this.layerConfig.setModelColumn(modelCol);

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

5
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java

@ -12,6 +12,9 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class LogMessageBar extends JPanel {
private static final String LOG_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log");
private UILabel messageLabel;
private int width = 600;
private static volatile LogMessageBar THIS;
@ -56,7 +59,7 @@ public class LogMessageBar extends JPanel {
if (message == null) {
return;
}
messageLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log") + " | " + message);
messageLabel.setText(LOG_MARK + " | " + message);
repaint();
}

8
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.setBorderRadius((int) buttonBorderRadiusSpinner.getValue());
if (normalBackgroundColorBox.getSelectObject() != null) {
style.setBackgroundColor(normalBackgroundColorBox.getSelectObject());
}
style.setBackgroundColor(normalBackgroundColorBox.getSelectObject());
style.setOpacity((int) normalOpacitySpinner.getValue());
style.setBorderLineStyle(normalBorderWidthComBox.getSelectedLineStyle());
style.setBorderColor(normalBorderColorBox.getSelectObject());
@ -374,9 +372,7 @@ public class SidebarMobileBookMarkStyleCustomDefinePane extends BasicBeanPane<Mo
style.setFontItalic(normalFontItalicButton.isSelected());
style.setFontBold(normalFontBoldButton.isSelected());
if (selectedBackgroundColorBox.getSelectObject() != null) {
style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject());
}
style.setSelectedBackgroundColor(selectedBackgroundColorBox.getSelectObject());
style.setSelectedOpacity((int) selectedOpacitySpinner.getValue());
style.setSelectedBorderLineStyle(selectedBorderWidthComBox.getSelectedLineStyle());
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.preview.MobileTemplatePreviewPane;
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.general.cardtag.mobile.MobileTemplateStyle;
import com.fr.general.cardtag.mobile.TabFontConfig;
@ -33,8 +34,8 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
private UnsignedIntUISpinner paddingLeftSpinner;
private UnsignedIntUISpinner paddingRightSpinner;
private ColorSelectBox initialBackgroundColorBox;
private ColorSelectBox selectedBackgroundColorBox;
private NewColorSelectBox initialBackgroundColorBox;
private NewColorSelectBox selectedBackgroundColorBox;
private LineComboBox borderWidthComboBox;
private ColorSelectBox borderColorBox;
@ -96,9 +97,9 @@ public class UniteStyleDefinePane extends MobileTemplateStyleDefinePane {
}
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.selectedBackgroundColorBox = new ColorSelectBox(LINE_COMPONENT_WIDTH);
this.selectedBackgroundColorBox = new NewColorSelectBox(LINE_COMPONENT_WIDTH);
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);

6
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -138,9 +138,13 @@ public class MenuDef extends ShortCut {
*/
public void addShortCut(ShortCut... shortcut) {
for (ShortCut i : shortcut) {
this.shortcutList.add(i);
addShortCut(i);
}
}
public void addShortCut(ShortCut shortCut) {
this.shortcutList.add(shortCut);
}
public void removeShortCut(ShortCut shortCut) {

41
designer-base/src/main/java/com/fr/design/menu/SnapChatMenuDef.java

@ -61,23 +61,20 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat {
}
@Override
public void addShortCut(ShortCut... shortCuts) {
public void addShortCut(ShortCut shortCut) {
if (shortCuts == null) {
return;
}
for (ShortCut shortCut : shortCuts) {
if (shortCut instanceof SnapChatUpdateAction) {
SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut;
if (!action.hasRead()) {
String calcKey = calcKey();
SnapChatConfig.getInstance().resetRead(calcKey);
}
}
}
super.addShortCut(shortCuts);
addSnapChatNotification(shortCut);
super.addShortCut(shortCut);
}
@Override
public void insertShortCut(int index, ShortCut shortCut) {
addSnapChatNotification(shortCut);
super.insertShortCut(index, shortCut);
}
@Override
public SnapChatKey key() {
@ -90,6 +87,22 @@ public class SnapChatMenuDef extends MenuDef implements SnapChat {
return new SnapChatMenuListener();
}
/**
* 添加提醒
*
* @param shortCut 快捷方式
*/
private void addSnapChatNotification(ShortCut shortCut) {
if (shortCut instanceof SnapChatUpdateAction) {
SnapChatUpdateAction action = (SnapChatUpdateAction) shortCut;
if (!action.hasRead()) {
String calcKey = calcKey();
SnapChatConfig.getInstance().resetRead(calcKey);
}
}
}
private String calcKey() {
return key().calc();

8
designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java

@ -97,6 +97,14 @@ public enum SupportOSImpl implements SupportOS {
public boolean support() {
return OperatingSystem.isMacos();
}
},
VM_OPTIONS_ADAPTER {
@Override
public boolean support() {
return OperatingSystem.isWindows();
}
}
}

9
designer-base/src/main/java/com/fr/design/utils/DesignerPort.java

@ -1,5 +1,6 @@
package com.fr.design.utils;
import com.fr.common.report.ReportState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.TipDialog;
@ -12,6 +13,9 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.exit.DesignerExiter;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.process.ProcessEventPipe;
import com.fr.process.engine.core.CarryMessageEvent;
import com.fr.process.engine.core.FineProcessContext;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLReadable;
@ -86,7 +90,10 @@ public class DesignerPort implements XMLReadable, XMLWriter {
}
public void resetPort() {
ProcessEventPipe eventPipe = FineProcessContext.getParentPipe();
if (eventPipe != null) {
eventPipe.fire(new CarryMessageEvent(ReportState.STOP.getValue()));
}
TipDialog dialog = new TipDialog(null,
StringUtils.EMPTY,
Toolkit.i18nText("Fine-Design_Port_Found_Port_Conflict"),

30
designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java

@ -73,4 +73,34 @@ public class SnapChatMenuDefTest {
menuDef.addShortCut(action);
Assert.assertFalse(menuDef.hasRead());
}
@Test
public void testInsertShortCut() throws Exception {
PowerMock.suppress(MemberMatcher.constructor(UpdateAction.class));
SnapChatConfig snapChatConfig = EasyMock.partialMockBuilder(SnapChatConfig.class)
.addMockedMethod("readXML")
.createMock();
Whitebox.setInternalState(snapChatConfig, "markReadMap", new HashMap());
snapChatConfig.readXML(EasyMock.anyObject(XMLableReader.class));
EasyMock.expectLastCall().anyTimes();
EasyMock.replay(snapChatConfig);
PowerMock.mockStatic(SnapChatConfig.class);
EasyMock.expect(SnapChatConfig.getInstance()).andReturn(snapChatConfig).anyTimes();
PowerMock.replayAll();
SnapChatMenuDef menuDef = new SnapChatMenuDef("test", SnapChatAllTypes.Menu.BBS);
ShortCut action = new SnapChatUpdateAction(SnapChatAllTypes.Menu.BBS) {
@Override
protected void actionPerformed0(ActionEvent e) {
}
};
Assert.assertTrue(menuDef.hasRead());
menuDef.insertShortCut(0, action);
Assert.assertFalse(menuDef.hasRead());
}
}

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

@ -15,8 +15,10 @@ import com.fr.locale.LocaleMarker;
import com.fr.locale.LocaleScope;
import com.fr.module.Activator;
import com.fr.module.extension.Prepare;
import com.fr.plugin.chart.vanchart.export.ImagePainter;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.van.chart.DownloadOnlineSourcesHelper;
import com.fr.van.chart.map.server.ChartMapEditorAction;
/**
@ -47,6 +49,8 @@ public class ChartDesignerActivator extends Activator implements Prepare {
DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption());
ImagePainter.registerDownloadSourcesEvent(new DownloadOnlineSourcesHelper());
ChartTypeInterfaceManager.addPluginChangedListener();
}

7
designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java

@ -22,6 +22,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -113,7 +114,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange, Prepare
selectedPane.update(collection);
if (!ComparatorUtils.equals(collection, lastCollection)) {
VanChart vanChart = collection.getSelectedChartProvider(VanChart.class);
if (vanChart != null) {
//此处画图
vanChart.attrChange();
}
try {
ChartInfoCollector.getInstance().checkTestChart(collection.getSelectedChartProvider(ChartProvider.class));
lastCollection = collection.clone();

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.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.CloudCenter;
import com.fr.general.IOUtils;
import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.util.ArrayList;
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.
@ -51,13 +57,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
//总共字节数
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;
public void addMapJSONSiteInfo() {
@ -219,7 +218,6 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
@Override
public void downloadSources() {
this.addMapJSONSiteInfo();
this.addPhantomSiteInfo();
this.installOnline();
}

1
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartLegendPane.java

@ -68,6 +68,7 @@ public class VanChartLegendPane extends AbstractVanChartScrollPane<VanChart> {
if (plot == null) {
return;
}
legendContent.setPlot(plot);
VanChartLegend legend = (VanChartLegend) plot.getLegend();
if (legendContent != null) {
legendContent.populateBean(legend);

11
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -2,14 +2,15 @@ package com.fr.van.chart.designer.style;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
@ -18,6 +19,7 @@ import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
@ -46,6 +48,8 @@ public class VanChartPlotLegendPane extends BasicPane {
private static final int HEIGHT = 100;
private static final int GAP = 20;
private Plot plot;
private UICheckBox isLegendVisible;
private JPanel legendPane;
@ -80,6 +84,10 @@ public class VanChartPlotLegendPane extends BasicPane {
initComponents();
}
public void setPlot(Plot plot) {
this.plot = plot;
}
public JPanel getHighlightPane() {
return highlightPane;
}
@ -421,6 +429,7 @@ public class VanChartPlotLegendPane extends BasicPane {
//limitPane.populateBean(legend.getLimitAttribute());
if(highlightButton != null){
highlightButton.setSelectedItem(legend.isHighlight());
highlightButton.setEnabled(!PlotFactory.largeDataModel(plot));
}
}

12
designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java

@ -13,8 +13,11 @@ import com.fr.design.designer.beans.adapters.layout.FRAbsoluteLayoutAdapter;
import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.models.SelectionModel;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI;
import com.fr.design.form.layout.FRAbsoluteLayout;
import com.fr.design.form.util.FormDesignerUtils;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EditingMouseListener;
@ -590,4 +593,13 @@ public class XWAbsoluteLayout extends XLayoutContainer {
public boolean isSupportShared() {
return true;
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
if (FormDesignerUtils.isAppRelayout(WidgetPropertyPane.getInstance().getEditingFormDesigner())) {
return new WidgetPropertyUIProvider[] {new MobileBooKMarkUsePropertyUI(this)};
} else {
return super.getWidgetPropertyUIProviders();
}
}
}

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/MobileAdvanceDefinePane.java

@ -20,6 +20,7 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.mobile.MobileBookMark;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.stable.StringUtils;
@ -33,6 +34,7 @@ import java.awt.event.FocusEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Iterator;
import java.util.List;
/**
* @author hades
@ -180,12 +182,16 @@ public class MobileAdvanceDefinePane extends MobileWidgetDefinePane {
Form form = WidgetPropertyPane.getInstance().getEditingFormDesigner().getTarget();
WLayout container = form.getContainer();
WSortLayout wSortLayout = (WSortLayout) container.getWidget(container.getWidgetCount() - 1);
Iterator<String> iterator = wSortLayout.getMobileWidgetIterator();
while (iterator.hasNext()) {
Widget widget = form.getWidgetByName(iterator.next());
List<String> list = wSortLayout.getOrderedMobileWidgetList();
for (String value : list) {
Widget widget = form.getWidgetByName(value);
if (widget != null && ComparatorUtils.equals(widget.getMobileBookMark().getBookMarkName(), name)) {
return true;
}
CRBoundsWidget boundsWidget = (CRBoundsWidget) wSortLayout.getWidget(value);
if (boundsWidget != null && ComparatorUtils.equals(boundsWidget.getWidget().getMobileBookMark().getBookMarkName(), name)) {
return true;
}
}
return false;
}

12
designer-realize/src/main/java/com/fr/design/mainframe/SheetAuthorityEditPane.java

@ -8,6 +8,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.general.ComparatorUtils;
import com.fr.main.impl.WorkBook;
@ -119,9 +120,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane {
if (StringUtils.isEmpty(name.getText())){
return;
}
checkPane.add(populateCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkVisibleCheckBoxes();
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
checkPane.add(populateCheckPane(), BorderLayout.CENTER);
checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0));
checkVisibleCheckBoxes();
}
});
}
/**

34
designer-realize/src/main/java/com/fr/start/DesignerJavaRuntime.java

@ -2,15 +2,25 @@ package com.fr.start;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.process.engine.core.AbstractJavaRuntime;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.os.OperatingSystem;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -32,11 +42,14 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
private static final String LOGO_PATH = StableUtils.pathJoin(BIN_HOME, "logo.png");
private static final String DOCK_OPTIONS = "-Xdock:icon=" + LOGO_PATH;
private static final String DOCK_NAME_OPTIONS = "-Xdock:name=" + FineDesigner.class.getSimpleName();
private static final String WIN_VM_OPTIONS_PATH = StableUtils.pathJoin(BIN_HOME, "designer.vmoptions");
private static final String[] DEBUG_OPTIONS = new String[]{"-Dfile.encoding=UTF-8", "-Xmx2048m"};
static {
try {
IOUtils.copy(DesignerJavaRuntime.class.getResourceAsStream("/com/fr/design/icon/logo.png"), "logo.png", new File(BIN_HOME));
if (SupportOSImpl.DOCK_ICON.support()) {
IOUtils.copy(DesignerJavaRuntime.class.getResourceAsStream("/com/fr/design/icon/logo.png"), "logo.png", new File(BIN_HOME));
}
} catch (IOException ignore) {
}
}
@ -82,7 +95,7 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
}
private boolean isInstallVersion() {
return !ComparatorUtils.equals(StableUtils.getInstallHome(), DOT);
return !ComparatorUtils.equals(GeneralUtils.readFullBuildNO(), InterProviderFactory.getProvider().getLocText("Fine-Core_Basic_About_No_Build"));
}
@ -96,9 +109,26 @@ public class DesignerJavaRuntime extends AbstractJavaRuntime {
public String[] getJvmOptions() {
if (isInstallVersion()) {
String[] options = super.getJvmOptions();
// win下环境变量 存在错误的设置会导致问题 直接读vmoptions
if (SupportOSImpl.VM_OPTIONS_ADAPTER.support()) {
List<String> optionList = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader(new File(WIN_VM_OPTIONS_PATH)))) {
String option = null;
while ((option = reader.readLine()) != null) {
optionList.add(option.trim());
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return DEBUG_OPTIONS;
}
if (!optionList.isEmpty()) {
return optionList.toArray(new String[0]);
}
}
if (SupportOSImpl.DOCK_ICON.support()) {
options = ArrayUtils.addAll(options, DOCK_OPTIONS, DOCK_NAME_OPTIONS);
}
FineLoggerFactory.getLogger().debug("Vm Options: " + Arrays.toString(options));
return options;
} else {
return DEBUG_OPTIONS;

Loading…
Cancel
Save