Browse Source

Merge pull request #447 in BA/design from ~EASON/design:dev to dev

* commit '6319309bcfdcf1621ce4f5a93c9754d4fbe38461': (125 commits)
  回退主干上的下拉树极速构建
  无JIRA任务 防止有npe
  无JIRA任务  视图树是否去重设置无效
  无JIRA任务 修复表单调整页面大小后tabpane中就不能拖入图表的问题
  REPORT-419 dev里面这块代码好像没合
  REPORT-419 dev里面这块代码好像没合
  REPORT-625 表单参数面板高度自己变 参数面板高度不要算上分辨率的比例缩放
  REPORT-650 1.7jdk启动报错
  1
  1
  ct
  ct
  ct
  ct
  REPORT-533 表单初始化布局新功能 bugfix;master中屏蔽掉,只开放release
  update
  REPORT-533 表单初始化布局新功能 bugfix:修复scalelayout类的控件在布局间切换出现问题的情况
  change:先屏蔽一下菜单中组件商店
  REPORT-533 表单初始化布局新功能
  update
  ...
master
superman 8 years ago
parent
commit
e48f438f83
  1. 1
      build.dev.gradle
  2. 20
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  3. 4
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  4. 2
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  5. 12
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  6. 16
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  7. 2
      designer_base/build.master.gradle
  8. 5
      designer_base/src/com/fr/design/DesignerEnvManager.java
  9. 13
      designer_base/src/com/fr/design/extra/PluginHelper.java
  10. 88
      designer_base/src/com/fr/design/extra/PluginsReaderFromStore.java
  11. 11
      designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java
  12. 37
      designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  13. 6
      designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java
  14. 183
      designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
  15. 59
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  16. 63
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  17. 2
      designer_base/src/com/fr/start/BaseDesigner.java
  18. 2
      designer_chart/build.master.gradle
  19. 16
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  20. 86
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapCustomPane.java
  21. 54
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java
  22. 89
      designer_form/build.dev.gradle
  23. 2
      designer_form/src/com/fr/design/designer/beans/models/AddingModel.java
  24. 3
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
  25. 4
      designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java
  26. 2
      designer_form/src/com/fr/design/gui/core/FormWidgetOption.java
  27. 2
      designer_form/src/com/fr/design/mainframe/FormArea.java
  28. 15
      designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java
  29. 2
      sonar-project.properties

1
build.dev.gradle

@ -2,6 +2,7 @@ apply plugin: "java"
tasks.withType(JavaCompile){ tasks.withType(JavaCompile){
options.encoding = "UTF-8" options.encoding = "UTF-8"
} }
def basicDir="../../" def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable" def libDir="${basicDir}/finereport-lib-stable"
// //

20
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -274,6 +274,16 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
rightButton.setEnabled(buttonEnabled); rightButton.setEnabled(buttonEnabled);
} }
/**
* 抽出来方便OEM
* @return
*/
public Icon getAddWorkSheet(){
return ADD_WORK_SHEET;
}
public Icon getWorkSheetIcon(){
return WORK_SHEET_ICON;
}
@Override @Override
/** /**
* 画Tab * 画Tab
@ -290,7 +300,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
double textHeight = this.getSize().getHeight() - 1; double textHeight = this.getSize().getHeight() - 1;
widthArray = calculateWidthArray(); widthArray = calculateWidthArray();
int operationWidth = GRAP + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度
paintBackgroundAndLine(g2d, textHeight, maxWidth, charWidth, textAscent); paintBackgroundAndLine(g2d, textHeight, maxWidth, charWidth, textAscent);
checkButton(showCount < widthArray.length); checkButton(showCount < widthArray.length);
@ -321,7 +331,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
isNeedPaintedAuthority = templateReport.getWorkSheetPrivilegeControl().checkInvisible(selectedRoles); isNeedPaintedAuthority = templateReport.getWorkSheetPrivilegeControl().checkInvisible(selectedRoles);
} }
sheeticon = templateReport instanceof WorkSheet ? WORK_SHEET_ICON : POLY_SHEET_ICON; sheeticon = templateReport instanceof WorkSheet ? getWorkSheetIcon() : POLY_SHEET_ICON;
String sheetName = workBook.getReportName(i); String sheetName = workBook.getReportName(i);
if (i == selectedIndex) { if (i == selectedIndex) {
paintSelectedTab(g2d, sheeticon, textHeight, textX, sheetName, charWidth, textAscent, isNeedPaintedAuthority); paintSelectedTab(g2d, sheeticon, textHeight, textX, sheetName, charWidth, textAscent, isNeedPaintedAuthority);
@ -352,8 +362,8 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
} }
protected void paintAddButton(Graphics2D g2d){ protected void paintAddButton(Graphics2D g2d){
ADD_WORK_SHEET.paintIcon(this, g2d, iconLocation, 3); getAddWorkSheet().paintIcon(this, g2d, iconLocation, 3);
ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE, 3); ADD_POLY_SHEET.paintIcon(this, g2d, iconLocation + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE, 3);
} }
/** /**
@ -757,7 +767,7 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
widthArray = calculateWidthArray(); widthArray = calculateWidthArray();
int width = widthArray[i]; int width = widthArray[i];
textX += width + 1; textX += width + 1;
int operationWidth = GRAP + ADD_WORK_SHEET.getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth(); int operationWidth = GRAP + getAddWorkSheet().getIconWidth() + ICON_SEP_DISTANCE + ADD_POLY_SHEET.getIconWidth();
double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度 double maxWidth = getWidth() - operationWidth - buttonPane.getWidth();// 最大宽度
if (i < widthArray.length - 1 && textX + widthArray[i + 1] + 1 > maxWidth) { if (i < widthArray.length - 1 && textX + widthArray[i + 1] + 1 > maxWidth) {
isOvertakeWidth = true; isOvertakeWidth = true;

4
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -36,7 +36,6 @@ public class BBSLoginDialog extends UIDialog {
private static final int DIALOG_WIDTH = 400; private static final int DIALOG_WIDTH = 400;
private static final int DIALOG_HEIGHT = 200; private static final int DIALOG_HEIGHT = 200;
private static final String LOGIN_SUCCESS_FLAG = "http://bbs.finereport.com";
private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14); private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14);
private static final int TIME_OUT = 10000; private static final int TIME_OUT = 10000;
@ -284,12 +283,13 @@ public class BBSLoginDialog extends UIDialog {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());
} }
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password; String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password;
String loginSuccessFlag = SiteCenter.getInstance().acquireUrlByKind("bbs");
HttpClient client = new HttpClient(url); HttpClient client = new HttpClient(url);
client.setTimeout(TIME_OUT); client.setTimeout(TIME_OUT);
if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) { if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) {
try { try {
String res = client.getResponseText(EncodeConstants.ENCODING_GBK); String res = client.getResponseText(EncodeConstants.ENCODING_GBK);
if (res.contains(LOGIN_SUCCESS_FLAG)) { if (res.contains(loginSuccessFlag)) {
return true; return true;
} }
} catch (Exception e) { } catch (Exception e) {

2
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -99,7 +99,7 @@ public class UserInfoLabel extends UILabel{
} }
}); });
PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); //PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this); QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this);
UserLoginContext.addLoginContextListener(new LoginContextListener() { UserLoginContext.addLoginContextListener(new LoginContextListener() {

12
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -2,6 +2,7 @@ package com.fr.design.webattr;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager; import com.fr.base.ConfigManager;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
@ -22,10 +23,12 @@ import com.fr.stable.Constants;
import com.fr.web.attr.ReportWebAttr; import com.fr.web.attr.ReportWebAttr;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
public class WriteToolBarPane extends AbstractEditToolBarPane { public class WriteToolBarPane extends AbstractEditToolBarPane {
@ -108,7 +111,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final DragToolBarPane dragToolbarPane = new DragToolBarPane(); final DragToolBarPane dragToolbarPane = new DragToolBarPane();
dragToolbarPane.setDefaultToolBar(ToolBarManager.createDefaultWriteToolBar(), ReportWebWidgetConstants.getWriteToolBarInstance()); dragToolbarPane.setDefaultToolBar(ToolBarManager.createDefaultWriteToolBar(), getToolBarInstance());
dragToolbarPane.populateBean(WriteToolBarPane.this.toolBarManagers); dragToolbarPane.populateBean(WriteToolBarPane.this.toolBarManagers);
BasicDialog toobarDialog = dragToolbarPane.showWindow(SwingUtilities.getWindowAncestor(WriteToolBarPane.this)); BasicDialog toobarDialog = dragToolbarPane.showWindow(SwingUtilities.getWindowAncestor(WriteToolBarPane.this));
toobarDialog.addDialogActionListener(new DialogActionAdapter() { toobarDialog.addDialogActionListener(new DialogActionAdapter() {
@ -130,7 +133,12 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
@Override @Override
protected WidgetOption[] getToolBarInstance() { protected WidgetOption[] getToolBarInstance() {
return ReportWebWidgetConstants.getWriteToolBarInstance(); List<WidgetOption> defaultOptions = Arrays.asList(ReportWebWidgetConstants.getWriteToolBarInstance());
List<WidgetOption> extraOptions = Arrays.asList(ExtraDesignClassManager.getInstance().getWebWidgetOptions());
List<WidgetOption> options = new ArrayList<WidgetOption>();
options.addAll(defaultOptions);
options.addAll(extraOptions);
return options.toArray(new WidgetOption[options.size()]);
} }
@Override @Override

16
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -1,18 +1,16 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/* /*
* richer:tree editor * richer:tree editor
@ -31,12 +29,18 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected void populateSubFieldEditorBean(TreeEditor e) { protected void populateSubFieldEditorBean(TreeEditor e) {
this.treeSettingPane.populate(e); this.treeSettingPane.populate(e);
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
}
} }
@Override @Override
protected TreeEditor updateSubFieldEditorBean() { protected TreeEditor updateSubFieldEditorBean() {
TreeEditor editor = treeSettingPane.updateTreeEditor(); TreeEditor editor = treeSettingPane.updateTreeEditor();
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
}
return editor; return editor;
} }

2
designer_base/build.dev.gradle → designer_base/build.master.gradle

@ -4,7 +4,7 @@ tasks.withType(JavaCompile){
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
//jdk版本 //jdk版本
sourceCompatibility=1.8 sourceCompatibility=1.7
//jar包版本 //jar包版本
version='8.0' version='8.0'
//jar包重命名 //jar包重命名

5
designer_base/src/com/fr/design/DesignerEnvManager.java

@ -20,6 +20,7 @@ import com.fr.stable.xml.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.SwingWorker.StateValue; import javax.swing.SwingWorker.StateValue;
import java.awt.*; import java.awt.*;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
@ -28,6 +29,7 @@ import java.util.Map.Entry;
import java.util.logging.FileHandler; import java.util.logging.FileHandler;
import java.util.logging.Handler; import java.util.logging.Handler;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.SimpleFormatter; import java.util.logging.SimpleFormatter;
/** /**
@ -226,7 +228,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
StableUtils.makesureFileExist(new java.io.File(fileName)); StableUtils.makesureFileExist(new java.io.File(fileName));
} }
Handler handler = new FileHandler(fileName, true); Handler handler = new FileHandler(fileName, true);
handler.setFormatter(new SimpleFormatter());
handler.setFormatter(new FRLogFormatter());
FRContext.getLogger().addLogHandler(handler); FRContext.getLogger().addLogHandler(handler);
} catch (SecurityException e) { } catch (SecurityException e) {
FRContext.getLogger().error(e.getMessage(), e); FRContext.getLogger().error(e.getMessage(), e);

13
designer_base/src/com/fr/design/extra/PluginHelper.java

@ -38,6 +38,7 @@ public class PluginHelper {
//插件依赖的下载位置 //插件依赖的下载位置
public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence"; public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence";
public static final String TEMP_FILE = "temp.zip"; public static final String TEMP_FILE = "temp.zip";
public static final String CONNECTION_404 = "404";
/** /**
* 下载插件 * 下载插件
@ -130,7 +131,7 @@ public class PluginHelper {
//将所有未配置好的资源文件依赖准备好 //将所有未配置好的资源文件依赖准备好
private static void checkDependenceEnv(Plugin plugin) throws PluginDependenceException { private static void checkDependenceEnv(Plugin plugin) throws PluginDependenceException {
PluginDependence dependence = plugin.getDependence(); PluginDependence dependence = plugin.getDependence();
if (dependence == null){ if (dependence == null) {
return; return;
} }
@ -138,14 +139,14 @@ public class PluginHelper {
String currentID = dependence.getCurrentPluginID(); String currentID = dependence.getCurrentPluginID();
List<PluginDependenceUnit> list = dependence.getDependPlugins(); List<PluginDependenceUnit> list = dependence.getDependPlugins();
for (int i = 0;list != null && i < list.size(); i++){ for (int i = 0; list != null && i < list.size(); i++) {
PluginDependenceUnit dependenceUnit = list.get(i); PluginDependenceUnit dependenceUnit = list.get(i);
if (!dependenceUnit.checkFileEnv()){ if (!dependenceUnit.checkFileEnv()) {
needInstallDependence.add(dependenceUnit); needInstallDependence.add(dependenceUnit);
} }
} }
if (needInstallDependence.isEmpty()){ if (needInstallDependence.isEmpty()) {
return; return;
} }
@ -155,14 +156,16 @@ public class PluginHelper {
/** /**
* 构造一个下载UI * 构造一个下载UI
*
* @param currentID * @param currentID
* @param list * @param list
* @throws PluginDependenceException * @throws PluginDependenceException
*/ */
private static void installDependenceOnline(String currentID, List<PluginDependenceUnit> list) throws PluginDependenceException{ private static void installDependenceOnline(String currentID, List<PluginDependenceUnit> list) throws PluginDependenceException {
DownLoadDependenceUI ui = new DownLoadDependenceUI(currentID, list); DownLoadDependenceUI ui = new DownLoadDependenceUI(currentID, list);
ui.installOnline(); ui.installOnline();
} }
/** /**
* 从选中的压缩文件中安装插件 * 从选中的压缩文件中安装插件
* *

88
designer_base/src/com/fr/design/extra/PluginsReaderFromStore.java

@ -31,30 +31,30 @@ public class PluginsReaderFromStore {
* @return 插件信息 * @return 插件信息
*/ */
public static Plugin[] readPlugins() throws Exception { public static Plugin[] readPlugins() throws Exception {
String resText; String resText;
try {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.store"));
resText = httpClient.getResponseText();
String charSet = EncodeConstants.ENCODING_UTF_8;
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);
} catch (Exception e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_PluginMarket_Coding"));
}
if (StringUtils.isNotEmpty(resText)) {
try { try {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.store")); plugins.clear();//先清空set
resText = httpClient.getResponseText(); JSONArray jsonArray = new JSONArray(resText);
String charSet = EncodeConstants.ENCODING_UTF_8; for (int i = 0, size = jsonArray.length(); i < size; i++) {
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet); Plugin plugin = new Plugin();
} catch (Exception e) { plugin.parseJSON(jsonArray.optJSONObject(i));
throw new Exception(Inter.getLocText("FR-Designer-Plugin_PluginMarket_Coding")); if (plugin.isValidate()) {
} plugins.add(plugin);
if (StringUtils.isNotEmpty(resText)) {
try {
plugins.clear();//先清空set
JSONArray jsonArray = new JSONArray(resText);
for (int i = 0, size = jsonArray.length(); i < size; i++) {
Plugin plugin = new Plugin();
plugin.parseJSON(jsonArray.optJSONObject(i));
if (plugin.isValidate()) {
plugins.add(plugin);
}
} }
} catch (JSONException e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_Read_Plugin_List_Error"));
} }
} catch (JSONException e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_Read_Plugin_List_Error"));
} }
}
return plugins.toArray(new Plugin[plugins.size()]); return plugins.toArray(new Plugin[plugins.size()]);
} }
@ -65,35 +65,33 @@ public class PluginsReaderFromStore {
* @return 插件信息 * @return 插件信息
*/ */
public static Plugin[] readPluginsForUpdate() throws Exception { public static Plugin[] readPluginsForUpdate() throws Exception {
String resText; String resText = null;
String url = SiteCenter.getInstance().acquireUrlByKind("plugin.update");
if (StringUtils.isNotEmpty(url)) {
HashMap<String, String> para = new HashMap<String, String>();
para.put("plugins", PluginLoader.getLoader().pluginsToString());
//只有当前设计器的jar高于插件新版本需要的jarTime时, 才提示更新该插件.
para.put("jarTime", GeneralUtils.readBuildNO());
HttpClient httpClient = new HttpClient(url, para);
resText = httpClient.getResponseText();
String charSet = EncodeConstants.ENCODING_UTF_8;
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);
}
if (StringUtils.isNotEmpty(resText)) {
try { try {
HashMap<String, String> para = new HashMap<String, String>(); pluginsToUpdate.clear();
para.put("plugins", PluginLoader.getLoader().pluginsToString()); JSONArray jsonArray = new JSONArray(resText);
//只有当前设计器的jar高于插件新版本需要的jarTime时, 才提示更新该插件. for (int i = 0, size = jsonArray.length(); i < size; i++) {
para.put("jarTime", GeneralUtils.readBuildNO()); Plugin plugin = new Plugin();
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.update"), para); plugin.parseJSON(jsonArray.optJSONObject(i));
resText = httpClient.getResponseText(); if (plugin.isValidate()) {
String charSet = EncodeConstants.ENCODING_UTF_8; pluginsToUpdate.add(plugin);
resText = URLDecoder.decode(URLDecoder.decode(resText, charSet), charSet);
} catch (Exception e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_PluginMarket_Coding"));
}
if (StringUtils.isNotEmpty(resText)) {
try {
pluginsToUpdate.clear();
JSONArray jsonArray = new JSONArray(resText);
for (int i = 0, size = jsonArray.length(); i < size; i++) {
Plugin plugin = new Plugin();
plugin.parseJSON(jsonArray.optJSONObject(i));
if (plugin.isValidate()) {
pluginsToUpdate.add(plugin);
}
} }
} catch (JSONException e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_Read_Plugin_List_Error"));
} }
} catch (JSONException e) {
throw new Exception(Inter.getLocText("FR-Designer-Plugin_Read_Plugin_List_Error"));
} }
}
return pluginsToUpdate.toArray(new Plugin[pluginsToUpdate.size()]); return pluginsToUpdate.toArray(new Plugin[pluginsToUpdate.size()]);
} }

11
designer_base/src/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe; package com.fr.design.extra.exe;
import com.fr.design.extra.PluginHelper;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
@ -26,8 +27,14 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.category")); String url = SiteCenter.getInstance().acquireUrlByKind("plugin.category");
result = httpClient.getResponseText(); if (url != null) {
HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText();
} else {
result = PluginHelper.CONNECTION_404;
}
} }
} }
}; };

37
designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -1,5 +1,6 @@
package com.fr.design.extra.exe; package com.fr.design.extra.exe;
import com.fr.design.extra.PluginHelper;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
@ -38,21 +39,27 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
StringBuilder url = new StringBuilder(SiteCenter.getInstance().acquireUrlByKind("plugin.plist")); String plistUrl = SiteCenter.getInstance().acquireUrlByKind("plugin.plist");
if (StringUtils.isNotBlank(category)) { if (StringUtils.isNotBlank(plistUrl)) {
url.append("&cid=").append(category.split("-")[1]); StringBuilder url = new StringBuilder();
} url.append(plistUrl);
if (StringUtils.isNotBlank(seller)) { if (StringUtils.isNotBlank(category)) {
url.append("&seller=").append(seller.split("-")[1]); url.append("&cid=").append(category.split("-")[1]);
} }
if (StringUtils.isNotBlank(fee)) { if (StringUtils.isNotBlank(seller)) {
url.append("&fee=").append(fee.split("-")[1]); url.append("&seller=").append(seller.split("-")[1]);
} }
try { if (StringUtils.isNotBlank(fee)) {
HttpClient httpClient = new HttpClient(url.toString()); url.append("&fee=").append(fee.split("-")[1]);
result = httpClient.getResponseText(); }
} catch (Exception e) { try {
FRLogger.getLogger().error(e.getMessage()); HttpClient httpClient = new HttpClient(url.toString());
result = httpClient.getResponseText();
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
} else {
result = PluginHelper.CONNECTION_404;
} }
} }
} }

6
designer_base/src/com/fr/design/extra/plugindependence/DownLoadDependenceUI.java

@ -265,7 +265,9 @@ public class DownLoadDependenceUI implements ActionListener {
} }
} }
private String showFileLength() { private String showFileLength(){
return totalSize == -1 ? "NAN" : totalSize / Math.pow(10, 6) + ""; double len = totalSize / Math.pow(10, 6);
String lenStr = String.format("%.2f", len);
return totalSize == -1 ? "NAN" : lenStr;
} }
} }

183
designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java

@ -1,52 +1,44 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.general.NameObject;
import com.fr.data.impl.TableDataDictionary; import com.fr.data.impl.TableDataDictionary;
import com.fr.data.impl.TreeAttr; import com.fr.data.impl.TreeAttr;
import com.fr.data.impl.TreeNodeAttr; import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.tree.layer.config.LayerDataControlPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeDataCardPane; import com.fr.design.gui.itree.refreshabletree.TreeDataCardPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import com.fr.form.ui.tree.LayerConfig;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class TreeSettingPane extends BasicPane implements DataCreatorUI { public class TreeSettingPane extends BasicPane implements DataCreatorUI {
private JTreeControlPane controlPane; private JTreeControlPane controlPane;
private JTreeAutoBuildPane autoBuildPane; private JTreeAutoBuildPane autoBuildPane;
/**
* 新的分层构建方式
*/
private LayerDataControlPane layerDataControlPane;
private UIComboBox buildBox; private UIComboBox buildBox;
/** /**
* *
*/ */
private static final long serialVersionUID = 1762889323082827111L; private static final long serialVersionUID = 1762889323082827111L;
private String[] buildWay = new String[]{Inter.getLocText("FR-Designer_DataTable-Build"), private String[] buildWay = new String[] { Inter.getLocText("FR-Designer_Layer-Build"),
Inter.getLocText("FR-Designer_Auto-Build"), Inter.getLocText("FR-Designer_Layer-Build")}; Inter.getLocText("FR-Designer_Auto-Build") };
public TreeSettingPane(boolean isEditor) { public TreeSettingPane(boolean isEditor) {
this.initComponents(isEditor); this.initComponents(isEditor);
} }
private void initComponents(boolean isEditor) { private void initComponents(boolean isEditor) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
@ -64,51 +56,35 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
buildWayPanel.add(buildBox); buildWayPanel.add(buildBox);
controlPane = new JTreeControlPane(new NameableCreator[] { treeNode }, controlPane = new JTreeControlPane(new NameableCreator[] { treeNode },
new TreeDataCardPane(), isEditor); new TreeDataCardPane(), isEditor);
autoBuildPane = new JTreeAutoBuildPane(); autoBuildPane = new JTreeAutoBuildPane();
layerDataControlPane = new LayerDataControlPane(); this.add(buildWayPanel, BorderLayout.NORTH);
this.add(buildWayPanel, BorderLayout.NORTH); cardChanged(0);
cardChanged(0); }
}
private void cardChanged(int index) { private void cardChanged(int index) {
this.remove(controlPane); this.remove(controlPane);
this.remove(autoBuildPane); this.remove(autoBuildPane);
this.remove(layerDataControlPane); this.add(index == 0 ? controlPane : autoBuildPane, BorderLayout.CENTER);
switch (index) { validate();
case 0: repaint();
this.add(layerDataControlPane); revalidate();
break; }
case 1:
this.add(autoBuildPane);
break;
case 2:
this.add(controlPane);
break;
default:
break;
}
validate();
repaint();
revalidate();
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Create_Tree"); return Inter.getLocText("FR-Designer_Create_Tree");
} }
@Override @Override
public JComponent toSwingComponent() { public JComponent toSwingComponent() {
return this; return this;
} }
NameableCreator treeNode = new NameObjectCreator( NameableCreator treeNode = new NameObjectCreator(
Inter.getLocText("FR-Designer_Gradation"), Inter.getLocText("FR-Designer_Gradation"),
"/com/fr/design/images/data/source/jdbcTableData.png", "/com/fr/design/images/data/source/jdbcTableData.png",
TreeNodeAttr.class); TreeNodeAttr.class);
/** /**
* *
@ -125,19 +101,10 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
buildBox.setSelectedIndex(1); buildBox.setSelectedIndex(1);
TableDataDictionary dictionary = treeEditor.getDictionary(); TableDataDictionary dictionary = treeEditor.getDictionary();
autoBuildPane.populate(dictionary); autoBuildPane.populate(dictionary);
} else if (treeEditor.isLayerBuild()) { } else {
buildBox.setSelectedIndex(0); buildBox.setSelectedIndex(0);
java.util.List<LayerConfig> layerConfigList = treeEditor.getLayerConfigs(); }
LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()]; }
int i = 0;
for (LayerConfig layerConfig : layerConfigList) {
layerConfigs[i++] = layerConfig;
}
this.layerDataControlPane.populate(new NameObject("tree", layerConfigs));
} else {
buildBox.setSelectedIndex(2);
}
}
/** /**
* 视图树的update * 视图树的update
@ -156,46 +123,43 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
te.setAutoBuild(true); te.setAutoBuild(true);
te.setDictionary(dictionary); te.setDictionary(dictionary);
te.setNodeOrDict(dictionary); te.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else {
te.setAutoBuild(false); te.setAutoBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject(); TreeEditor editor = (TreeEditor) no.getObject();
te.setAllowBlank(editor.isAllowBlank()); te.setAllowBlank(editor.isAllowBlank());
te.setEnabled(editor.isEnabled()); te.setEnabled(editor.isEnabled());
te.setDirectEdit(editor.isDirectEdit()); te.setDirectEdit(editor.isDirectEdit());
te.setErrorMessage(editor.getErrorMessage()); te.setErrorMessage(editor.getErrorMessage());
te.setWidgetName(editor.getWidgetName()); te.setWidgetName(editor.getWidgetName());
te.setVisible(editor.isVisible()); te.setVisible(editor.isVisible());
te.setWaterMark(editor.getWaterMark()); te.setWaterMark(editor.getWaterMark());
te.setRemoveRepeat(editor.isRemoveRepeat()); te.setRemoveRepeat(editor.isRemoveRepeat());
te.setTreeAttr(editor.getTreeAttr()); te.setTreeAttr(editor.getTreeAttr());
te.setTreeNodeAttr(editor.getTreeNodeAttr()); te.setTreeNodeAttr(editor.getTreeNodeAttr());
te.setNodeOrDict(editor.getTreeNodeAttr()); te.setNodeOrDict(editor.getTreeNodeAttr());
te.setPerformanceFirst(editor.isPerformanceFirst()); te.setPerformanceFirst(editor.isPerformanceFirst());
} }
} }
return te; return te;
} }
/** /**
* 树节点属性的update * 树节点属性的update
* @return * @return
*/ */
public Object updateTreeNodeAttrs() { public Object updateTreeNodeAttrs() {
if(buildBox.getSelectedIndex() == 0) {
if (buildBox.getSelectedIndex() == 2) { NameObject no = controlPane.update();
NameObject no = controlPane.update(); if (no != null) {
if (no != null) { return no.getObject();
return no.getObject();
} }
} else if (buildBox.getSelectedIndex() == 0) { } else {
return layerDataControlPane.update(); return autoBuildPane.update();
} else { }
return autoBuildPane.update(); return null;
} }
return null;
}
/** /**
* 下拉树的update * 下拉树的update
@ -208,7 +172,7 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
tcb.setAutoBuild(true); tcb.setAutoBuild(true);
tcb.setDictionary(dictionary); tcb.setDictionary(dictionary);
tcb.setNodeOrDict(dictionary); tcb.setNodeOrDict(dictionary);
} else if (buildBox.getSelectedIndex() == 2) { } else {
tcb.setAutoBuild(false); tcb.setAutoBuild(false);
NameObject no = this.controlPane.update(); NameObject no = this.controlPane.update();
if (no != null) { if (no != null) {
@ -240,15 +204,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
*/ */
public void populate(Object nodeOrDict) { public void populate(Object nodeOrDict) {
if(nodeOrDict instanceof TreeNodeAttr[] || nodeOrDict instanceof TreeNodeWrapper) { if(nodeOrDict instanceof TreeNodeAttr[] || nodeOrDict instanceof TreeNodeWrapper) {
buildBox.setSelectedIndex(2); buildBox.setSelectedIndex(0);
NameObject no = new NameObject("name", nodeOrDict); NameObject no = new NameObject("name", nodeOrDict);
controlPane.populate(no); controlPane.populate(no);
} else if(nodeOrDict instanceof TableDataDictionary) { } else if(nodeOrDict instanceof TableDataDictionary) {
buildBox.setSelectedIndex(1); buildBox.setSelectedIndex(1);
autoBuildPane.populate((TableDataDictionary)nodeOrDict); autoBuildPane.populate((TableDataDictionary)nodeOrDict);
} else if (nodeOrDict instanceof NameObject) { }
buildBox.setSelectedIndex(0); }
layerDataControlPane.populate((NameObject) nodeOrDict);
}
}
} }

59
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -168,24 +168,48 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
/** /**
* Constructor. * 初始menuPane的方法 方便OEM时修改该组件
* @param ad
*/ */
protected void initMenuPane(){
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
basePane.add(menuPane, BorderLayout.NORTH);
this.resetToolkitByPlus(null);
}
/**
* @param ad
* @return
*/
protected JPanel initNorthEastPane(final ToolBarMenuDock ad){
//hugh: private修改为protected方便oem的时候修改右上的组件构成
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
}
});
return northEastPane;
}
public DesignerFrame(ToolBarMenuDock ad) { public DesignerFrame(ToolBarMenuDock ad) {
setName(DESIGNER_FRAME_NAME); setName(DESIGNER_FRAME_NAME);
this.ad = ad; this.ad = ad;
this.initTitleIcon(); this.initTitleIcon();
this.setTitle();// james:因为有默认的了 this.setTitle();// james:因为有默认的了
// set this to context. // set this to context.
DesignerContext.setDesignerFrame(this); DesignerContext.setDesignerFrame(this);
// the content pane // the content pane
basePane.setLayout(new BorderLayout()); basePane.setLayout(new BorderLayout());
menuPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
menuPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
menuPane.add(initNorthEastPane(ad), BorderLayout.EAST);
toolbarPane = new JPanel() { toolbarPane = new JPanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
@ -211,7 +235,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER); centerPane.add(centerTemplateCardPane = new DesktopCardPane(), BorderLayout.CENTER);
centerPane.add(toolbarPane, BorderLayout.NORTH); centerPane.add(toolbarPane, BorderLayout.NORTH);
basePane.add(menuPane, BorderLayout.NORTH);
basePane.add(centerPane, BorderLayout.CENTER); basePane.add(centerPane, BorderLayout.CENTER);
laoyoutWestPane(); laoyoutWestPane();
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST); basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST);
@ -222,7 +246,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
// 调整Window大小 // 调整Window大小
modWindowBounds(); modWindowBounds();
this.resetToolkitByPlus(null);
// p:检查所有按钮的可见性和是否可以编辑性. // p:检查所有按钮的可见性和是否可以编辑性.
checkToolbarMenuEnable(); checkToolbarMenuEnable();
@ -243,6 +267,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.setExtendedState(JFrame.MAXIMIZED_BOTH); this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true)); this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true));
closeMode = UIConstants.CLOSE_OF_AUTHORITY; closeMode = UIConstants.CLOSE_OF_AUTHORITY;
initMenuPane();
} }
public void initTitleIcon() { public void initTitleIcon() {
@ -257,22 +282,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} }
} }
private JPanel initNorthEastPane(final ToolBarMenuDock ad){
//顶部日志+登陆按钮
final JPanel northEastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
TitlePlaceProcessor processor = ExtraDesignClassManager.getInstance().getSingle(TitlePlaceProcessor.MARK_STRING);
if (processor == null) {
processor = new DefaultTitlePlace();
}
processor.hold(northEastPane, LogMessageBar.getInstance(), ad.createBBSLoginPane());
}
});
return northEastPane;
}
private void addWindowListeners(ArrayList<WindowListener> listeners){ private void addWindowListeners(ArrayList<WindowListener> listeners){
for(WindowListener listener : listeners){ for(WindowListener listener : listeners){
this.addWindowListener(listener); this.addWindowListener(listener);

63
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -121,7 +121,7 @@ public abstract class ToolBarMenuDock {
///////////////////////////////menu below///////////////////////////////////////////////// ///////////////////////////////menu below/////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
private MenuDef[] menus(final ToolBarMenuDockPlus plus) { public MenuDef[] menus(final ToolBarMenuDockPlus plus) {
java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>(); java.util.List<MenuDef> menuList = new java.util.ArrayList<MenuDef>();
// 添加文件菜单 // 添加文件菜单
menuList.add(createFileMenuDef(plus)); menuList.add(createFileMenuDef(plus));
@ -143,17 +143,17 @@ public abstract class ToolBarMenuDock {
return menuList.toArray(new MenuDef[menuList.size()]); return menuList.toArray(new MenuDef[menuList.size()]);
} }
private void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) { public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) {
// 给菜单加插件入口 // 给菜单加插件入口
for (MenuDef m : menuDefs) { for (MenuDef m : menuDefs) {
switch (m.getAnchor()) { switch (m.getAnchor()) {
case MenuHandler.TEMPLATE: case MenuHandler.TEMPLATE :
insertMenu(m, MenuHandler.TEMPLATE, new TemplateTargetAction(plus)); insertMenu(m, MenuHandler.TEMPLATE, new TemplateTargetAction(plus));
break; break;
case MenuHandler.INSERT: case MenuHandler.INSERT :
insertMenu(m, MenuHandler.INSERT); insertMenu(m, MenuHandler.INSERT);
break; break;
case MenuHandler.CELL: case MenuHandler.CELL :
insertMenu(m, MenuHandler.CELL); insertMenu(m, MenuHandler.CELL);
break; break;
default: default:
@ -172,7 +172,7 @@ public abstract class ToolBarMenuDock {
return plus.menus4Target(); return plus.menus4Target();
} }
private MenuDef createFileMenuDef(ToolBarMenuDockPlus plus) { public MenuDef createFileMenuDef(ToolBarMenuDockPlus plus) {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_File"), 'F'); MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_File"), 'F');
ShortCut[] scs = new ShortCut[0]; ShortCut[] scs = new ShortCut[0];
@ -200,7 +200,7 @@ public abstract class ToolBarMenuDock {
addSwitchExistEnvAction(menuDef); addSwitchExistEnvAction(menuDef);
menuDef.addShortCut(new ExitDesignerAction()); menuDef.addShortCut( new ExitDesignerAction());
insertMenu(menuDef, MenuHandler.FILE); insertMenu(menuDef, MenuHandler.FILE);
return menuDef; return menuDef;
@ -222,7 +222,7 @@ public abstract class ToolBarMenuDock {
menuDef.addShortCut(new SwitchExistEnv()); menuDef.addShortCut(new SwitchExistEnv());
} }
protected ShortCut openTemplateAction() { protected ShortCut openTemplateAction(){
return new OpenTemplateAction(); return new OpenTemplateAction();
} }
@ -237,8 +237,9 @@ public abstract class ToolBarMenuDock {
* 创建论坛登录面板, chart那边不需要 * 创建论坛登录面板, chart那边不需要
* *
* @return 面板组件 * @return 面板组件
*
*/ */
public Component createBBSLoginPane() { public Component createBBSLoginPane(){
return new UILabel(); return new UILabel();
} }
@ -264,10 +265,9 @@ public abstract class ToolBarMenuDock {
); );
if (!BaseUtils.isAuthorityEditing()) { if (!BaseUtils.isAuthorityEditing()) {
if (shouldShowPlugin() && !(FRContext.getCurrentEnv() instanceof RemoteEnv)) { if (shouldShowPlugin()) {
menuDef.addShortCut( menuDef.addShortCut(
new PluginManagerAction(), new PluginManagerAction()
new ReuseManagerAction()
); );
} }
menuDef.addShortCut( menuDef.addShortCut(
@ -286,12 +286,11 @@ public abstract class ToolBarMenuDock {
} }
protected boolean shouldShowPlugin() { protected boolean shouldShowPlugin() {
return FRContext.isChineseEnv() || ComparatorUtils.equals(GeneralContext.getLocale(), Locale.TAIWAN); return !(FRContext.getCurrentEnv() instanceof RemoteEnv) && FRContext.isChineseEnv();
} }
/** /**
* 创建帮助子菜单 * 创建帮助子菜单
*
* @return 帮组菜单的子菜单 * @return 帮组菜单的子菜单
*/ */
public ShortCut[] createHelpShortCuts() { public ShortCut[] createHelpShortCuts() {
@ -300,7 +299,7 @@ public abstract class ToolBarMenuDock {
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
//shortCuts.add(new TutorialAction()); //shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (ComparatorUtils.equals(ProductConstants.APP_NAME, FINEREPORT)) { if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) {
shortCuts.add(new FeedBackAction()); shortCuts.add(new FeedBackAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
@ -314,7 +313,6 @@ public abstract class ToolBarMenuDock {
/** /**
* 创建社区子菜单 * 创建社区子菜单
*
* @return 社区菜单的子菜单 * @return 社区菜单的子菜单
*/ */
public ShortCut[] createCommunityShortCuts() { public ShortCut[] createCommunityShortCuts() {
@ -329,7 +327,6 @@ public abstract class ToolBarMenuDock {
shortCuts.add(new SignAction()); shortCuts.add(new SignAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }
public MenuDef createHelpMenuDef() { public MenuDef createHelpMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H'); MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H');
ShortCut[] otherHelpShortCuts = createHelpShortCuts(); ShortCut[] otherHelpShortCuts = createHelpShortCuts();
@ -339,7 +336,6 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.HELP); insertMenu(menuDef, MenuHandler.HELP);
return menuDef; return menuDef;
} }
public MenuDef createCommunityMenuDef() { public MenuDef createCommunityMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_COMMUNITY"), 'C'); MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_COMMUNITY"), 'C');
ShortCut[] otherCommunityShortCuts = createCommunityShortCuts(); ShortCut[] otherCommunityShortCuts = createCommunityShortCuts();
@ -349,7 +345,6 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.BBS); insertMenu(menuDef, MenuHandler.BBS);
return menuDef; return menuDef;
} }
/** /**
* 生成工具栏 * 生成工具栏
* *
@ -474,8 +469,7 @@ public abstract class ToolBarMenuDock {
public int getMenuState() { public int getMenuState() {
return DesignState.WORK_SHEET; return DesignState.WORK_SHEET;
} }
public int getToolBarHeight(){
public int getToolBarHeight() {
return PANLE_HEIGNT; return PANLE_HEIGNT;
} }
@ -484,13 +478,13 @@ public abstract class ToolBarMenuDock {
* *
* @return 子菜单 * @return 子菜单
*/ */
public ShortCut[] shortcut4ExportMenu() { public ShortCut[] shortcut4ExportMenu(){
return new ShortCut[0]; return new ShortCut[0];
} }
}; };
public NewTemplatePane getNewTemplatePane() { public NewTemplatePane getNewTemplatePane(){
return new NewTemplatePane() { return new NewTemplatePane() {
@Override @Override
public Icon getNew() { public Icon getNew() {
@ -525,11 +519,11 @@ public abstract class ToolBarMenuDock {
for (MenuHandler handler : target) { for (MenuHandler handler : target) {
int insertPosition = handler.insertPosition(menuDef.getShortCutCount()); int insertPosition = handler.insertPosition(menuDef.getShortCutCount());
if (insertPosition == MenuHandler.HIDE) { if (insertPosition == MenuHandler.HIDE) {
return; return;
} }
ShortCut shortCut = action.methodAction(handler); ShortCut shortCut = action.methodAction(handler);
if (shortCut == null) { if (shortCut == null){
continue; continue;
} }
@ -542,10 +536,10 @@ public abstract class ToolBarMenuDock {
menuDef.insertShortCut(insertPosition, shortCut); menuDef.insertShortCut(insertPosition, shortCut);
if (handler.insertSeparatorBefore()) { if (handler.insertSeparatorBefore()) {
menuDef.insertShortCut(insertPosition, SeparatorDef.DEFAULT); menuDef.insertShortCut(insertPosition, SeparatorDef.DEFAULT);
insertPosition++; insertPosition ++;
} }
if (handler.insertSeparatorAfter()) { if (handler.insertSeparatorAfter()) {
insertPosition++; insertPosition ++;
menuDef.insertShortCut(insertPosition, SeparatorDef.DEFAULT); menuDef.insertShortCut(insertPosition, SeparatorDef.DEFAULT);
} }
} }
@ -554,35 +548,36 @@ public abstract class ToolBarMenuDock {
/** /**
* 设计器退出时, 做的一些操作. * 设计器退出时, 做的一些操作.
*
*/ */
public void shutDown() { public void shutDown(){
} }
private interface ShortCutMethodAction { private interface ShortCutMethodAction{
public ShortCut methodAction(MenuHandler handler); public ShortCut methodAction(MenuHandler handler);
} }
private abstract class AbstractShortCutMethodAction implements ShortCutMethodAction { private abstract class AbstractShortCutMethodAction implements ShortCutMethodAction{
public ShortCut methodAction(MenuHandler handler) { public ShortCut methodAction(MenuHandler handler){
return handler.shortcut(); return handler.shortcut();
} }
} }
//不需要编辑对象的菜单, 比如文件, 服务器, 关于 //不需要编辑对象的菜单, 比如文件, 服务器, 关于
private class NoTargetAction extends AbstractShortCutMethodAction { private class NoTargetAction extends AbstractShortCutMethodAction{
} }
//模板为对象的菜单, 比如模板, 后续如果单元格也要, 直接加个CellTargetAction即可. //模板为对象的菜单, 比如模板, 后续如果单元格也要, 直接加个CellTargetAction即可.
//在methodAction中做handler.shortcut(cell), 不需要修改handler中原有接口, 加个shortcut(cell). //在methodAction中做handler.shortcut(cell), 不需要修改handler中原有接口, 加个shortcut(cell).
private class TemplateTargetAction extends AbstractShortCutMethodAction { private class TemplateTargetAction extends AbstractShortCutMethodAction{
private ToolBarMenuDockPlus plus; private ToolBarMenuDockPlus plus;
public TemplateTargetAction(ToolBarMenuDockPlus plus) { public TemplateTargetAction(ToolBarMenuDockPlus plus){
this.plus = plus; this.plus = plus;
} }

2
designer_base/src/com/fr/start/BaseDesigner.java

@ -149,7 +149,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
} }
protected DesignerFrame createDesignerFrame() { protected DesignerFrame createDesignerFrame() {
return new DesignerFrame(this); return new DesignerFrame(this);
} }
protected int getStartPort() { protected int getStartPort() {

2
designer_chart/build.dev.gradle → designer_chart/build.master.gradle

@ -4,7 +4,7 @@ tasks.withType(JavaCompile){
options.encoding = 'UTF-8' options.encoding = 'UTF-8'
} }
//jdk版本 //jdk版本
sourceCompatibility=1.8 sourceCompatibility=1.7
//jar包的版本 //jar包的版本
version='8.0' version='8.0'

16
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java

@ -5,6 +5,7 @@ import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChart; import com.fr.base.chart.BaseChart;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartGlyph; import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
@ -31,7 +32,7 @@ import java.util.List;
* 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件 * 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件
右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件 右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件
*/ */
public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener { public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener, CallbackEvent{
private static final long serialVersionUID = 744164838619052097L; private static final long serialVersionUID = 744164838619052097L;
private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>(); private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
private ChartCollection chartCollection4Design; private ChartCollection chartCollection4Design;
@ -181,6 +182,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
// 反锯齿 // 反锯齿
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
//画图
drawChartGlyph(g2d); drawChartGlyph(g2d);
ActiveGlyph ag = this.getActiveGlyph(); ActiveGlyph ag = this.getActiveGlyph();
@ -222,9 +224,9 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
/** /**
* 鼠标点击 * 鼠标点击
* @param event 鼠标事件 * @param event 鼠标事件
* 不设置鼠标点击跳转事件
*/ */
public void mouseClicked(MouseEvent event) { public void mouseClicked(MouseEvent event) {
} }
/** /**
@ -302,7 +304,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
return chartGlyph == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height; return chartGlyph == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
} }
private void drawChartGlyph(Graphics2D g2d) { public void drawChartGlyph(Graphics2D g2d) {
if (chartGlyph != null) { if (chartGlyph != null) {
if (chartGlyph.isRoundBorder()) { if (chartGlyph.isRoundBorder()) {
chartGlyph.setBounds(new RoundRectangle2D.Double(0, 0, chartWidth, chartHeight, 10, 10)); chartGlyph.setBounds(new RoundRectangle2D.Double(0, 0, chartWidth, chartHeight, 10, 10));
@ -312,8 +314,14 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
//不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单 //不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单
//其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边 //其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution()); //处理画图事件
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this);
g2d.drawImage(chartImage, 0, 0, null); g2d.drawImage(chartImage, 0, 0, null);
} }
} }
@Override
public void callback() {
this.repaint();
}
} }

86
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapCustomPane.java

@ -1,37 +1,36 @@
package com.fr.design.chart.series.PlotSeries; package com.fr.design.chart.series.PlotSeries;
import java.awt.BorderLayout; import com.fr.base.FRContext;
import java.awt.Dimension; import com.fr.base.TableData;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.MapSvgAttr; import com.fr.chart.base.MapSvgAttr;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.data.core.DataCoreUtils;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.FilterComboBox; import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.data.DataModel;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import org.apache.batik.swing.svg.SVGFileFilter; import org.apache.batik.swing.svg.SVGFileFilter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/** /**
* 自定义地图界面. * 自定义地图界面.
* *
@ -131,22 +130,51 @@ refreshAreaNameBox();
String colName = Utils.objectToString(areaString.getSelectedItem()); String colName = Utils.objectToString(areaString.getSelectedItem());
TableDataWrapper tableDataWrappe = tableDataNameBox.getTableDataWrapper(); TableDataWrapper tableDataWrappe = tableDataNameBox.getTableDataWrapper();
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
if (tableDataWrappe == null || source == null) {
return;
}
String[] values = DataCoreUtils.getColValuesInData(source, tableDataWrappe.getTableDataName(), colName); imageShowPane.refreshFromDataList(getColValuesInData(tableDataWrappe, colName));
ArrayList list = new ArrayList();
for(int i = 0; i < values.length; i++) {
list.add(values[i]);
}
imageShowPane.refreshFromDataList(list);
} }
} }
}; };
public static List<String> getColValuesInData(TableDataWrapper tableDataWrappe, String colName) {
List<String> colValues = new ArrayList<>();
EmbeddedTableData embeddedTableData = null;
try {
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tableDataWrappe.getTableData(), TableData.RESULT_ALL, false);
} catch (Exception ee) {
FRContext.getLogger().error(ee.getMessage(), ee);
}
if(embeddedTableData == null){
return colValues;
}
int columnIndex = getColumnIndex(embeddedTableData, colName);
if(columnIndex == DataModel.COLUMN_NAME_NOT_FOUND){
return colValues;
}
for (int rowIndex = 0, rowCount = embeddedTableData.getRowCount(); rowIndex < rowCount; rowIndex++) {
String colValueName = GeneralUtils.objectToString(embeddedTableData.getValueAt(rowIndex, columnIndex));
if (!colValues.contains(colValueName)) {
colValues.add(colValueName);
}
}
return colValues;
}
private static int getColumnIndex(EmbeddedTableData tableData, String colName) {
for (int columnIndex = 0, columnCount = tableData.getColumnCount(); columnIndex < columnCount; columnIndex++) {
if (ComparatorUtils.tableDataColumnNameEquals(tableData.getColumnName(columnIndex), colName)) {
return columnIndex;
}
}
return DataModel.COLUMN_NAME_NOT_FOUND;
}
/** /**
* 选中方式: 区域或者点 * 选中方式: 区域或者点
*/ */

54
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java

@ -1,42 +1,32 @@
package com.fr.design.chart.series.PlotSeries; package com.fr.design.chart.series.PlotSeries;
import java.awt.BorderLayout; import com.fr.base.Utils;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import com.fr.chart.base.MapSvgAttr; import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper; import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.base.Utils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.data.core.DataCoreUtils;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.design.gui.icombobox.FilterComboBox; import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel; import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditorPane; import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.xcombox.ComboBoxUseEditor; import com.fr.design.gui.xcombox.ComboBoxUseEditor;
import com.fr.design.editor.editor.Editor; import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.design.editor.editor.TextEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/** /**
* 地图, 定义区域名. * 地图, 定义区域名.
* *
@ -89,7 +79,7 @@ public class MapDefiAreaNamePane extends BasicBeanPane<String> implements Abstrc
tableDataBox.setPreferredSize(new Dimension(200, 20)); tableDataBox.setPreferredSize(new Dimension(200, 20));
northPane.add(tableDataBox); northPane.add(tableDataBox);
columnBox = new FilterComboBox(); columnBox = new FilterComboBox<>();
columnBox.setPreferredSize(new Dimension(40, 20)); columnBox.setPreferredSize(new Dimension(40, 20));
columnBox.addItemListener(columnChange); columnBox.addItemListener(columnChange);
@ -113,12 +103,10 @@ public class MapDefiAreaNamePane extends BasicBeanPane<String> implements Abstrc
String columnName = Utils.objectToString(columnBox.getSelectedItem()); String columnName = Utils.objectToString(columnBox.getSelectedItem());
TableDataWrapper tableDataWrappe = tableDataBox.getTableDataWrapper(); TableDataWrapper tableDataWrappe = tableDataBox.getTableDataWrapper();
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
if (tableDataWrappe == null || source == null) {
return;
}
initNames = DataCoreUtils.getColValuesInData(source, tableDataWrappe.getTableDataName(), columnName); List<String> list = MapCustomPane.getColValuesInData(tableDataWrappe, columnName);
initNames = list.toArray(initNames);
if (tableEditorModel != null) { if (tableEditorModel != null) {
tableEditorModel.stopCellEditing();// 只是用来刷新列表的combox tableEditorModel.stopCellEditing();// 只是用来刷新列表的combox

89
designer_form/build.dev.gradle

@ -1,89 +0,0 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.8
//jar包版本
version='8.0'
def srcDir="."
//jar包的名字
jar{
baseName='fr-designer-report'
}
//
sourceSets{
main{
java{
srcDirs=["${srcDir}/src",
"${srcDir}/../designer/src"]
}
}
}
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//jar包
FileTree f=fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
f.each{File file->
println "----${file.path}"
}
//
dependencies{
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
}
}
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
into ('build/classes/main')
}
}
//js文件
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
}
}
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
}
}
jar.dependsOn compressJS

2
designer_form/src/com/fr/design/designer/beans/models/AddingModel.java

@ -124,7 +124,7 @@ public class AddingModel {
Rectangle rect = ComponentUtils.getRelativeBounds(container); Rectangle rect = ComponentUtils.getRelativeBounds(container);
if(!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())){ if(!ComparatorUtils.equals(container.getOuterLayout(), container.getBackupParent())){
return added = container.getLayoutAdapter().addBean(creator,x,y); return added = container.getLayoutAdapter().addBean(creator, x + designer.getArea().getHorizontalValue(), y + designer.getArea().getVerticalValue());
} }
return added = container.getLayoutAdapter().addBean(creator, return added = container.getLayoutAdapter().addBean(creator,
x + designer.getArea().getHorizontalValue() - rect.x, x + designer.getArea().getHorizontalValue() - rect.x,

3
designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

@ -116,6 +116,9 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
moveComponents2FitLayout(xfl); moveComponents2FitLayout(xfl);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreator(xfl); formDesigner.getSelectionModel().setSelectedCreator(xfl);
xfl.convert();
LayoutUtils.layoutContainer(xfl);
xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0);
for (int i = 0; i < components.length; i++) { for (int i = 0; i < components.length; i++) {
Component comp = xfl.getComponent(i); Component comp = xfl.getComponent(i);

4
designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java

@ -7,8 +7,8 @@ import com.fr.form.ui.container.WBodyLayoutType;
*/ */
public class FRLayoutTypeItems implements ItemProvider{ public class FRLayoutTypeItems implements ItemProvider{
public static final Item[] ITEMS = new Item[] { public static final Item[] ITEMS = new Item[] {
new Item(WBodyLayoutType.FIT.description(), WBodyLayoutType.FIT.getTypeValue()), new Item(WBodyLayoutType.FIT.description(), WBodyLayoutType.FIT.getTypeValue())/*,
new Item(WBodyLayoutType.ABSOLUTE.description(), WBodyLayoutType.ABSOLUTE.getTypeValue())}; new Item(WBodyLayoutType.ABSOLUTE.description(), WBodyLayoutType.ABSOLUTE.getTypeValue())*/};
public Item[] getItems() { public Item[] getItems() {
return ITEMS; return ITEMS;

2
designer_form/src/com/fr/design/gui/core/FormWidgetOption.java

@ -1 +1 @@
package com.fr.design.gui.core; import javax.swing.Icon; import com.fr.base.BaseUtils; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WHorizontalBoxLayout; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WVerticalBoxLayout; import com.fr.general.Inter; /** * Author : Shockway * Date: 13-6-17 * Time: 上午10:40 */ public class FormWidgetOption extends WidgetOption { /** * 返回名字 * @return 名字 */ @Override public String optionName() { return null; } /** * 返回图标 * @return 图标 */ @Override public Icon optionIcon() { return null; } /** * 组件类 * @return 类 */ @Override public Class<? extends Widget> widgetClass() { return null; } /** * 返回组件 * @return 控件 */ @Override public Widget createWidget() { return null; } /* * 表单容器 */ public static WidgetOption[] getFormContainerInstance() { return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER, CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER }; } /** * 表单工具栏上的布局 * @return 控件 */ public static WidgetOption[] getFormLayoutInstance() { return new WidgetOption[] {CARDLAYOUTCONTAINER, ABSOLUTELAYOUTCONTAINER}; } public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout_Block_Absolute"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute_new.png"), WAbsoluteLayout.class); public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"), WBorderLayout.class); public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout_Block_Tab"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"), WCardLayout.class); public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"), WHorizontalBoxLayout.class); public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WVerticalBoxLayout.class); public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WFitLayout.class); public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"), WParameterLayout.class); public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"), ElementCaseEditor.class); } package com.fr.design.gui.core; import javax.swing.Icon; import com.fr.base.BaseUtils; import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WCardLayout; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WHorizontalBoxLayout; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WVerticalBoxLayout; import com.fr.general.Inter; /** * Author : Shockway * Date: 13-6-17 * Time: 上午10:40 */ public class FormWidgetOption extends WidgetOption { /** * 返回名字 * @return 名字 */ @Override public String optionName() { return null; } /** * 返回图标 * @return 图标 */ @Override public Icon optionIcon() { return null; } /** * 组件类 * @return 类 */ @Override public Class<? extends Widget> widgetClass() { return null; } /** * 返回组件 * @return 控件 */ @Override public Widget createWidget() { return null; } /* * 表单容器 */ public static WidgetOption[] getFormContainerInstance() { return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER, CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER }; } /** * 表单工具栏上的布局 * @return 控件 */ public static WidgetOption[] getFormLayoutInstance() { return new WidgetOption[] {CARDLAYOUTCONTAINER/*, ABSOLUTELAYOUTCONTAINER*/}; } public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout_Block_Absolute"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute_new.png"), WAbsoluteLayout.class); public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"), WBorderLayout.class); public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout_Block_Tab"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"), WCardLayout.class); public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"), WHorizontalBoxLayout.class); public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WVerticalBoxLayout.class); public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"), WFitLayout.class); public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"), WParameterLayout.class); public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter .getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"), ElementCaseEditor.class); }

2
designer_form/src/com/fr/design/mainframe/FormArea.java

@ -341,8 +341,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
if (layout.getParent() != null) { if (layout.getParent() != null) {
int paraHeight = designer.getParaHeight(); int paraHeight = designer.getParaHeight();
if (needCalculateParaHeight && paraHeight > 0) { if (needCalculateParaHeight && paraHeight > 0) {
// 调整参数界面的大小
paraHeight += (int) (paraHeight*percent) ;
designer.setParaHeight(paraHeight); designer.setParaHeight(paraHeight);
XWBorderLayout parent = (XWBorderLayout) layout.getParent(); XWBorderLayout parent = (XWBorderLayout) layout.getParent();
parent.toData().setNorthSize(paraHeight); parent.toData().setNorthSize(paraHeight);

15
designer_form/src/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -1,40 +1,27 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout; import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.widget.UITreeComboBox; import com.fr.design.mainframe.widget.UITreeComboBox;
import com.fr.design.parameter.HierarchyTreePane; import com.fr.design.parameter.HierarchyTreePane;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIScrollPane;
import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import com.fr.design.gui.itextfield.UITextField;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.tree.TreePath;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;

2
sonar-project.properties

@ -3,7 +3,7 @@ sonar.projectKey=finereport.design
# this is the name displayed in the SonarQube UI # this is the name displayed in the SonarQube UI
sonar.projectName=finereport.design sonar.projectName=finereport.design
sonar.projectVersion=1.0 sonar.projectVersion=1.0
sonar.branch=master sonar.branch=dev
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set. # Since SonarQube 4.2, this property is optional if sonar.modules is set.

Loading…
Cancel
Save