Browse Source

Merge branch 'release/8.0' of http://www.finedevelop.com:2015/scm/~plough/design into release/8.0

master
plough 7 years ago
parent
commit
82fe67b25c
  1. 1
      build.performance.gradle
  2. 59
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  3. 29
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java
  4. 8
      designer/src/com/fr/design/present/PresentPane.java
  5. 2
      designer/src/com/fr/design/report/ReportBackgroundPane.java
  6. 2
      designer/src/com/fr/design/report/ReportExportAttrPane.java
  7. 101
      designer/src/com/fr/design/report/VerifierListPane.java
  8. 8
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  9. 5
      designer/src/com/fr/start/Designer.java
  10. 7
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  11. 5
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  12. 39
      designer_base/src/com/fr/design/extra/PluginHelper.java
  13. 5
      designer_base/src/com/fr/design/gui/ilable/UILabel.java
  14. 1
      designer_base/src/com/fr/design/locale/designer.properties
  15. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  16. 11
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  17. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  18. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  19. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  20. 46
      designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java
  21. 5
      designer_base/src/com/fr/env/RemoteEnv.java
  22. 3
      designer_base/src/com/fr/start/BaseDesigner.java
  23. 62
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  24. 4
      designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java
  25. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  26. 42
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java
  27. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  28. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  29. 2
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

1
build.performance.gradle

@ -15,7 +15,6 @@ task appletJar<<{
fileset(dir:"${basicDir}/chart/build/classes/main") fileset(dir:"${basicDir}/chart/build/classes/main")
fileset(dir:"${basicDir}/report/build/classes/main") fileset(dir:"${basicDir}/report/build/classes/main")
fileset(dir:"${basicDir}/platform/build/classes/main") fileset(dir:"${basicDir}/platform/build/classes/main")
fileset(dir:"${basicDir}/performance/build/classes/main")
} }
unjar(src:"${libDir}/3rd.jar",dest:"./tmp") unjar(src:"${libDir}/3rd.jar",dest:"./tmp")
unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp") unjar(src:"${libDir}/servlet-api.jar",dest:"./tmp")

59
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -14,12 +15,14 @@ import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.webattr.ToolBarButton; import com.fr.design.webattr.ToolBarButton;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -35,8 +38,12 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private AuthorityToolBarPane authorityToolBarPane; private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray; private String[] selectedPathArray;
public AuthorityEditToolBarPane(List<ToolBarButton> buttonlists) { public AuthorityEditToolBarPane(List<ToolBarButton> buttonList) {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.init(buttonList);
}
private void init(List<ToolBarButton> buttonList) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(null); this.setBorder(null);
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Permissions", UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Permissions",
@ -52,7 +59,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
northPane.add(authorityTitle, BorderLayout.CENTER); northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new AuthorityEditPane(buttonlists); authorityEditPane = new AuthorityEditPane(buttonList);
this.add(authorityEditPane, BorderLayout.CENTER); this.add(authorityEditPane, BorderLayout.CENTER);
} }
@ -92,27 +99,25 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
initSelectedPathArray(); initSelectedPathArray();
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole == if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole == null || selectedPathArray == null) {
null || selectedPathArray == null) {
return; return;
} }
for (int t = 0; t < selectedPathArray.length; t++) { ToolBarButton selectedButton = null;
for (int i = 0; i < buttonlists.size(); i++) { //是否可见的checkbox
if (buttonlists.get(i).isSelected()) { UICheckBox checkbox = (UICheckBox) e.getSource();
buttonlists.get(i).changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected()); for (int i = 0; i < buttonlists.size(); i++) {
authorityToolBarPane.repaint(); if (buttonlists.get(i).isSelected()) {
} selectedButton = buttonlists.get(i);
} }
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified(); }
RolesAlreadyEditedPane.getInstance().refreshDockingView(); if (selectedButton != null) {
UICheckBox checkbox = (UICheckBox) e.getSource(); for (int t = 0; t < selectedPathArray.length; t++) {
List<ToolBarButton> btns = AuthorityEditPane.this.buttonlists; selectedButton.changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
for (int j = 0; j < btns.size(); j++) { authorityToolBarPane.repaint();
if (btns.get(j).isSelected()) { authorityToolBarPane.setAuthorityWebAttr(selectedButton.getWidget(), checkbox.isSelected(), selectedPathArray[t]);
//由引擎实现保存进模板报表
authorityToolBarPane.setAuthorityWebAttr(btns.get(j).getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
} }
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();//模版更新
RolesAlreadyEditedPane.getInstance().refreshDockingView();//已配置角色视图刷新
} }
} }
}; };
@ -209,29 +214,29 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() { public void populateType() {
if (name.getText() == "") { if (StringUtils.EMPTY.equals(name.getText())) {
type.setText(""); type.setText(StringUtils.EMPTY);
} else { } else {
type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"}));
} }
} }
public void populateName() { public void populateName() {
String names = ""; StringBuilder names = new StringBuilder();
for (int i = 0; i < buttonlists.size(); i++) { for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) { if (buttonlists.get(i).isSelected()) {
names += "," + buttonlists.get(i).getNameOption().optionName(); names.append(",").append(buttonlists.get(i).getNameOption().optionName());
} }
} }
if (names != "") { if (names.length() > 0) {
names = names.substring(1); names.deleteCharAt(0);
} }
name.setText(names); name.setText(names.toString());
} }
public void populateCheckPane() { public void populateCheckPane() {
checkPane.removeAll(); checkPane.removeAll();
if (name.getText() == "") { if (StringUtils.EMPTY.equals(name.getText())) {
return; return;
} }
double f = TableLayout.FILL; double f = TableLayout.FILL;

29
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -215,27 +215,23 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
ReportWebAttr rw = wbTpl.getReportWebAttr(); ReportWebAttr rw = wbTpl.getReportWebAttr();
ConfigManagerProvider cm = ConfigManager.getProviderInstance(); ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class)); ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
if (webAttr == null || rw == null || rw.getWebPage() == null) {
return;
}
//wbTpl.clear先清空 //wbTpl.clear先清空
//再将所有的保存进去 //再将所有的保存进去
//看是存在服务器还存在模板里面 //看是存在服务器还存在模板里面
if (choseComboBox.getSelectedIndex() == 0) { if (choseComboBox.getSelectedIndex() == 0) {
//分页 //分页
if (rw == null || rw.getWebPage() == null) { dealWithWebContent(webAttr.getWebPage(), widget, isSelected, selectedRole);
dealWithWebContent(webAttr.getWebPage(), widget, isSelected, selectedRole);
}
} else if (choseComboBox.getSelectedIndex() == 1) { } else if (choseComboBox.getSelectedIndex() == 1) {
//填报 //填报
if (rw == null || rw.getWebPage() == null) { dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
}
} else { } else {
//view //view
if (rw == null || rw.getWebPage() == null) { dealWithWebContent(webAttr.getWebView(), widget, isSelected, selectedRole);
dealWithWebContent(webAttr.getWebView(), widget, isSelected, selectedRole);
}
} }
} }
private void dealWithWebContent(WebContent wc, Widget widget, boolean isSelected, String selectedRole) { private void dealWithWebContent(WebContent wc, Widget widget, boolean isSelected, String selectedRole) {
@ -246,14 +242,11 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
for (int i = 0; i < managers.length; i++) { for (int i = 0; i < managers.length; i++) {
ToolBar tb = managers[i].getToolBar(); ToolBar tb = managers[i].getToolBar();
for (int j = 0; j < tb.getWidgetSize(); j++) { for (int j = 0; j < tb.getWidgetSize(); j++) {
if (widget instanceof Button && tb.getWidget(j) instanceof Button) { if (widget instanceof Button && tb.getWidget(j) instanceof Button && ComparatorUtils.equals(((Button) widget).getIconName(), ((Button) tb.getWidget(j)).getIconName())) {
if (ComparatorUtils.equals(((Button) widget).getIconName(), if (!isSelected) {
((Button) tb.getWidget(j)).getIconName())) { tb.getWidget(j).getWidgetPrivilegeControl().addInvisibleRole(selectedRole);
if (!isSelected) { } else {
tb.getWidget(j).getWidgetPrivilegeControl().addInvisibleRole(selectedRole); tb.getWidget(j).getWidgetPrivilegeControl().removeInvisibleRole(selectedRole);
} else {
tb.getWidget(j).getWidgetPrivilegeControl().removeInvisibleRole(selectedRole);
}
} }
} }
} }

8
designer/src/com/fr/design/present/PresentPane.java

@ -57,12 +57,12 @@ public class PresentPane extends UIComboBoxPane<Present> {
@Override @Override
protected List<FurtherBasicBeanPane<? extends Present>> initPaneList() { protected List<FurtherBasicBeanPane<? extends Present>> initPaneList() {
if (keys == null) { if (keys == null) {
keys = new ArrayList<>(); keys = new ArrayList<String>();
} }
if (displays == null) { if (displays == null) {
displays = new ArrayList<>(); displays = new ArrayList<String>();
} }
List<FurtherBasicBeanPane<? extends Present>> paneList = new ArrayList<>(); List<FurtherBasicBeanPane<? extends Present>> paneList = new ArrayList<FurtherBasicBeanPane<? extends Present>>();
FurtherBasicBeanPane<Present> none = new NonePresentPane(); FurtherBasicBeanPane<Present> none = new NonePresentPane();
paneList.add(none); paneList.add(none);
keys.add("NOPRESENT"); keys.add("NOPRESENT");
@ -99,7 +99,7 @@ public class PresentPane extends UIComboBoxPane<Present> {
@Override @Override
protected UIComboBox createComboBox() { protected UIComboBox createComboBox() {
return new DictionaryComboBox<>(keys.toArray(new String[keys.size()]), displays.toArray(new String[displays.size()])); return new DictionaryComboBox<String>(keys.toArray(new String[keys.size()]), displays.toArray(new String[displays.size()]));
} }
@Override @Override

2
designer/src/com/fr/design/report/ReportBackgroundPane.java

@ -28,8 +28,6 @@ public class ReportBackgroundPane extends BasicPane {
sourth.add(isExportBackgroundCheckBox); sourth.add(isExportBackgroundCheckBox);
sourth.add(isPrintBackgroundCheckBox); sourth.add(isPrintBackgroundCheckBox);
this.add(sourth, BorderLayout.SOUTH); this.add(sourth, BorderLayout.SOUTH);
this.add(isPrintBackgroundCheckBox, BorderLayout.SOUTH);
} }
@Override @Override

2
designer/src/com/fr/design/report/ReportExportAttrPane.java

@ -31,7 +31,7 @@ public class ReportExportAttrPane extends BasicPane {
wordExportPane = new WordExportPane(); wordExportPane = new WordExportPane();
uiTabbedPane.addTab("Word", wordExportPane); uiTabbedPane.addTab("Word", wordExportPane);
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG); Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>(); paneList = new ArrayList<AbstractExportPane>();
for (ExportAttrTabProvider provider : providers) { for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent()); uiTabbedPane.addTab(provider.title(), provider.toSwingComponent());
paneList.add(provider.toExportPane()); paneList.add(provider.toExportPane());

101
designer/src/com/fr/design/report/VerifierListPane.java

@ -1 +1,100 @@
package com.fr.design.report; import com.fr.data.Verifier; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.VerifyDefineProvider; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ObjectJControlPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.general.Inter; import com.fr.general.NameObject; import com.fr.report.write.ReportWriteAttr; import com.fr.report.write.ValueVerifier; import com.fr.report.write.WClassVerifier; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import java.util.ArrayList; import java.util.Set; /** * 校验列表 */ public class VerifierListPane extends ObjectJControlPane { public VerifierListPane(ElementCasePane ePane) { super(ePane); } /** * 创建选项 * * @return 选项 */ public NameableCreator[] createNameableCreators() { NameableCreator[] creators = new NameableCreator[]{ new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}), "/com/fr/web/images/reportlet.png", ValueVerifier.class, BuildInVerifierPane.class) }; Set<VerifyDefineProvider> set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING); for (VerifyDefineProvider provider : set) { creators = ArrayUtils.add(creators, new NameObjectCreator( provider.nameForVerifier(), provider.iconPath(), provider.classForVerifier(), provider.appearanceForVerifier() ) { }); } creators = ArrayUtils.add(creators, new NameObjectCreator( Inter.getLocText(new String[]{"Custom", "Verify"}), "/com/fr/web/images/reportlet.png", WClassVerifier.class, CustomVerifierPane.class)); return creators; } @Override protected String title4PopupWindow() { return "Verify Collections"; } public void populate(ReportWriteAttr reportWriteAttr) { if (reportWriteAttr == null) { return; } java.util.List<NameObject> nameObjectList = new ArrayList<>(); int verifierCount = reportWriteAttr.getVerifierCount(); for (int i = 0; i < verifierCount; i++) { Verifier verifier = reportWriteAttr.getVerifier(i); nameObjectList.add(new NameObject(verifier.getName(), verifier)); } this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()])); } public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); NameObject[] res_array = new NameObject[res.length]; java.util.Arrays.asList(res).toArray(res_array); reportWriteAttr.clearVerifiers(); for (int i = 0; i < res_array.length; i++) { NameObject nameObject = res_array[i]; if (nameObject.getObject() instanceof Verifier) { Verifier verifier = (Verifier) nameObject.getObject(); verifier.setName(nameObject.getName()); reportWriteAttr.addVerifier(verifier); } } } } package com.fr.design.report;
import com.fr.data.Verifier;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.ValueVerifier;
import com.fr.report.write.WClassVerifier;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.Set;
/**
* 校验列表
*/
public class VerifierListPane extends ObjectJControlPane {
public VerifierListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
NameableCreator[] creators = new NameableCreator[]{
new NameObjectCreator(Inter.getLocText(new String[]{"BuildIn", "Verify"}),
"/com/fr/web/images/reportlet.png",
ValueVerifier.class,
BuildInVerifierPane.class)
};
Set<VerifyDefineProvider> set = ExtraDesignClassManager.getInstance().getArray(VerifyDefineProvider.MARK_STRING);
for (VerifyDefineProvider provider : set) {
creators = ArrayUtils.add(creators, new NameObjectCreator(
provider.nameForVerifier(),
provider.iconPath(),
provider.classForVerifier(),
provider.appearanceForVerifier()
) {
});
}
creators = ArrayUtils.add(creators, new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "Verify"}),
"/com/fr/web/images/reportlet.png",
WClassVerifier.class,
CustomVerifierPane.class));
return creators;
}
@Override
protected String title4PopupWindow() {
return "Verify Collections";
}
public void populate(ReportWriteAttr reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
java.util.List<NameObject> nameObjectList = new ArrayList<NameObject>();
int verifierCount = reportWriteAttr.getVerifierCount();
for (int i = 0; i < verifierCount; i++) {
Verifier verifier = reportWriteAttr.getVerifier(i);
nameObjectList.add(new NameObject(verifier.getName(), verifier));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearVerifiers();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof Verifier) {
Verifier verifier = (Verifier) nameObject.getObject();
verifier.setName(nameObject.getName());
reportWriteAttr.addVerifier(verifier);
}
}
}
}

8
designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java

@ -68,7 +68,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
return; return;
} }
List<NameObject> nameObjectList = new ArrayList<>(); List<NameObject> nameObjectList = new ArrayList<NameObject>();
int submiterCount = reportWriteAttr.getSubmitVisitorCount(); int submiterCount = reportWriteAttr.getSubmitVisitorCount();
for (int i = 0; i < submiterCount; i++) { for (int i = 0; i < submiterCount; i++) {
@ -169,8 +169,8 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
public CustomPane() { public CustomPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
customSubmitPanes = new HashMap<>(); customSubmitPanes = new HashMap<String, BasicBeanPane>();
comboItemsMap = new HashMap<>(); comboItemsMap = new HashMap<String, String>();
Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING); Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING);
addSubmitPane(new DefaultSubmit()); addSubmitPane(new DefaultSubmit());
@ -178,7 +178,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
addSubmitPane(provider); addSubmitPane(provider);
} }
configTypes = new ArrayList<>(); configTypes = new ArrayList<String>();
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) { for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();
configTypes.add(comboItemsMap.get(key)); configTypes.add(comboItemsMap.get(key));

5
designer/src/com/fr/start/Designer.java

@ -1,6 +1,7 @@
package com.fr.start; package com.fr.start;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
@ -35,7 +36,6 @@ import com.fr.general.Inter;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.web.ServletContext;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
import javax.swing.*; import javax.swing.*;
@ -432,7 +432,8 @@ public class Designer extends BaseDesigner {
InformationCollector collector = InformationCollector.getInstance(); InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime(); collector.collectStopTime();
collector.saveXMLFile(); collector.saveXMLFile();
ServletContext.fireServletStopListener(); Env currentEnv = FRContext.getCurrentEnv();
currentEnv.doWhenServerShutDown();
} }
} }

7
designer_base/src/com/fr/design/data/DesignTableDataManager.java

@ -36,6 +36,7 @@ import java.io.ByteArrayOutputStream;
import java.text.Collator; import java.text.Collator;
import java.util.*; import java.util.*;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
/** /**
* 设计器管理操作数据集的类: * 设计器管理操作数据集的类:
@ -54,11 +55,11 @@ public abstract class DesignTableDataManager {
* 其实globalDsCache没有绝对的必要只是为了操作方便如果没有它那么每次清空服务器数据集或者存储过程的时候还要去遍历找一下 * 其实globalDsCache没有绝对的必要只是为了操作方便如果没有它那么每次清空服务器数据集或者存储过程的时候还要去遍历找一下
* 这个操作可能比较复杂 从减少代码复杂度的角度看还是很有必要的 * 这个操作可能比较复杂 从减少代码复杂度的角度看还是很有必要的
*/ */
private static java.util.Map<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>(); private static java.util.Map<String, TableDataWrapper> globalDsCache = new ConcurrentHashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new HashMap<String, String>(); private static java.util.Map<String, String> dsNameChangedMap = new ConcurrentHashMap<String, String>();
// private static List<ChangeListener> dsListeners = new ArrayList<ChangeListener>(); // private static List<ChangeListener> dsListeners = new ArrayList<ChangeListener>();
private static Map<String, List<ChangeListener>> dsListenersMap = new HashMap<String, List<ChangeListener>>(); private static Map<String, List<ChangeListener>> dsListenersMap = new ConcurrentHashMap<String, List<ChangeListener>>();;
public static String NO_PARAMETER = "no_paramater_pane"; public static String NO_PARAMETER = "no_paramater_pane";

5
designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -18,6 +18,7 @@ import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.*; import javax.swing.*;
@ -160,6 +161,10 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
@Override @Override
public void populateBean(ClassTableData ob) { public void populateBean(ClassTableData ob) {
if(StringUtils.isEmpty(ob.getClassName())) {
return;
}
this.editorPane.populate(ob.getParameters(Calculator.createCalculator())); this.editorPane.populate(ob.getParameters(Calculator.createCalculator()));
this.classNameTextField.setText(ob.getClassName()); this.classNameTextField.setText(ob.getClassName());
} }

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

@ -4,16 +4,23 @@ import com.fr.base.Env;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.extra.plugindependence.DownLoadDependenceUI; import com.fr.design.extra.plugindependence.DownLoadDependenceUI;
import com.fr.general.*; import com.fr.general.FRLogger;
import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.plugin.Plugin; import com.fr.plugin.Plugin;
import com.fr.plugin.PluginConfigManager; import com.fr.plugin.PluginConfigManager;
import com.fr.plugin.PluginLoader; import com.fr.plugin.PluginLoader;
import com.fr.plugin.PluginManagerHelper; import com.fr.plugin.PluginManagerHelper;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.dependence.PluginDependence; import com.fr.plugin.dependence.PluginDependence;
import com.fr.plugin.dependence.PluginDependenceException; import com.fr.plugin.dependence.PluginDependenceException;
import com.fr.plugin.dependence.PluginDependenceUnit; import com.fr.plugin.dependence.PluginDependenceUnit;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -79,7 +86,7 @@ public class PluginHelper {
} }
} }
private static boolean invalidUser(String id, String username, String password) { private static boolean isInvalidUser(String id, String username, String password) {
if (StringUtils.isEmpty(id)) { if (StringUtils.isEmpty(id)) {
return false; return false;
} else if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){ } else if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
@ -116,7 +123,7 @@ public class PluginHelper {
public static Plugin readPlugin(File chosenFile) throws Exception { public static Plugin readPlugin(File chosenFile) throws Exception {
// 需要先删除临时目录保证加压出来的文件不会和安装失败的文件混合到一起 // 需要先删除临时目录保证加压出来的文件不会和安装失败的文件混合到一起
StableUtils.deleteFile(new File(TEMP_PATH)); StableUtils.deleteFile(new File(TEMP_PATH));
IOUtils.unzip(chosenFile, TEMP_PATH); IOUtils.unzip(chosenFile, TEMP_PATH);
File pluginFileDir = getTempPluginFileDirectory(); File pluginFileDir = getTempPluginFileDirectory();
if (pluginFileDir == null) { if (pluginFileDir == null) {
@ -127,7 +134,7 @@ public class PluginHelper {
File[] pluginFiles = pluginFileDir.listFiles(); File[] pluginFiles = pluginFileDir.listFiles();
if (ArrayUtils.isNotEmpty(pluginFiles)) { if (ArrayUtils.isNotEmpty(pluginFiles)) {
for (File f : pluginFiles) { for (File f : pluginFiles) {
if (f.getName().equals("plugin.xml")) { if (AssistUtils.equals(f.getName(), "plugin.xml")) {
plugin = new Plugin(); plugin = new Plugin();
InputStream inputStream = plugin.readEncryptXml(new FileInputStream(f)); InputStream inputStream = plugin.readEncryptXml(new FileInputStream(f));
XMLTools.readInputStreamXML(plugin, inputStream); XMLTools.readInputStreamXML(plugin, inputStream);
@ -268,17 +275,27 @@ public class PluginHelper {
FRLogger.getLogger().error(jarExpiredInfo); FRLogger.getLogger().error(jarExpiredInfo);
throw new com.fr.plugin.PluginVerifyException(jarExpiredInfo); throw new com.fr.plugin.PluginVerifyException(jarExpiredInfo);
} }
if (!isSupportCurrentEnv(plugin.getEnvVersion())) {
String envVersionNotSupport = Inter.getLocText(new String[]{"FR-Designer-Plugin_Env_Expired", ",", "FR-Designer-Plugin_Install_Failed"});
FRLogger.getLogger().error(envVersionNotSupport);
throw new com.fr.plugin.PluginVerifyException(envVersionNotSupport);
}
File fileToCheck = getTempPluginFileDirectory(); File fileToCheck = getTempPluginFileDirectory();
File oldfile = new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), ProjectConstants.PLUGINS_NAME, "plugin-" + plugin.getId())); File oldfile = new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), ProjectConstants.PLUGINS_NAME, "plugin-" + plugin.getId()));
if (!PluginManagerHelper.checkLic(plugin, fileToCheck)) { if (!PluginManagerHelper.checkLic(plugin, fileToCheck) && !PluginManagerHelper.checkLic(plugin, oldfile)) {
if (!PluginManagerHelper.checkLic(plugin, oldfile)) {//安装时,在安装目录下和压缩包里都没有才弹框 //安装时,在安装目录下和压缩包里都没有才弹框
String checkLicFail = Inter.getLocText("FR-Designer-PluginLicense_Check_Failed"); String checkLicFail = Inter.getLocText("FR-Designer-PluginLicense_Check_Failed");
FRLogger.getLogger().error(checkLicFail); FRLogger.getLogger().error(checkLicFail);
throw new com.fr.plugin.PluginVerifyException(checkLicFail); throw new com.fr.plugin.PluginVerifyException(checkLicFail);
}
} }
} }
private static boolean isSupportCurrentEnv(String envVersion) {
//包含8.0
return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion());
}
/** /**
* 获取插件解压的临时文件夹 * 获取插件解压的临时文件夹
* *
@ -290,7 +307,7 @@ public class PluginHelper {
File[] files = file.listFiles(); File[] files = file.listFiles();
if (ArrayUtils.isNotEmpty(files)) { if (ArrayUtils.isNotEmpty(files)) {
for (File f : files) { for (File f : files) {
if (foundConfigFile(f)) { if (hasFoundConfigFile(f)) {
return f; return f;
} }
} }
@ -299,14 +316,14 @@ public class PluginHelper {
return null; return null;
} }
private static boolean foundConfigFile(File dir) { private static boolean hasFoundConfigFile(File dir) {
if (!dir.isDirectory()) { if (!dir.isDirectory()) {
return false; return false;
} }
File[] files = dir.listFiles(); File[] files = dir.listFiles();
if (ArrayUtils.isNotEmpty(files)) { if (ArrayUtils.isNotEmpty(files)) {
for (File f : files) { for (File f : files) {
if ("plugin.xml".equals(f.getName())) { if (AssistUtils.equals("plugin.xml",f.getName())) {
return true; return true;
} }
} }

5
designer_base/src/com/fr/design/gui/ilable/UILabel.java

@ -29,6 +29,11 @@ public class UILabel extends JLabel {
super(text); super(text);
} }
public UILabel(String text, boolean enable) {
super(text);
this.setEnabled(enable);
}
public UILabel(Icon image, int horizontalAlignment) { public UILabel(Icon image, int horizontalAlignment) {
super(image, horizontalAlignment); super(image, horizontalAlignment);
} }

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2008,3 +2008,4 @@ Default=Default
FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places: FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load resource file

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2009,3 +2009,4 @@ Default=Default
FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location: FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places: FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load Configuration File

11
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -228,7 +228,7 @@ FR-Designer-Collect_Information_free=\u7121\u6599
FR-Designer-Collect_Information_Description=\u8AAC\u660E FR-Designer-Collect_Information_Description=\u8AAC\u660E
FR-Designer-Collect_Information_Successfully=\u53CE\u96C6\u6210\u529F FR-Designer-Collect_Information_Successfully=\u53CE\u96C6\u6210\u529F
FR-Designer_Event_Set=\u30A4\u30D9\u30F3\u30C8\u8A2D\u5B9A FR-Designer_Event_Set=\u30A4\u30D9\u30F3\u30C8\u8A2D\u5B9A
FR-Designer_Blow_set=\u4EE5\u4E0B\u8A2D\u5B9A FR-Designer_Blow_set=\u6B21\u306E\u8A2D\u5B9A
FR-Designer_I_Want_To_Set_Single=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u500B\u5225\u8A2D\u5B9A FR-Designer_I_Want_To_Set_Single=\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u500B\u5225\u8A2D\u5B9A
FR-Designer_Using_Server_Report_View_Settings=\u30B5\u30FC\u30D0\u8A2D\u5B9A FR-Designer_Using_Server_Report_View_Settings=\u30B5\u30FC\u30D0\u8A2D\u5B9A
FR-Designer_ErrorHandlerTemplate=\u30A8\u30E9\u30FC\u60C5\u5831\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5B9A\u7FA9 FR-Designer_ErrorHandlerTemplate=\u30A8\u30E9\u30FC\u60C5\u5831\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u5B9A\u7FA9
@ -507,7 +507,7 @@ FR-Designer_Property_panel=\u5C5E\u6027
FR-Designer_Select_panel=\u9078\u629E FR-Designer_Select_panel=\u9078\u629E
FR-Designer_LayoutTable_Column_Width=160 FR-Designer_LayoutTable_Column_Width=160
FR-Designer_Set_BG_Of_Current_Row=\u7DE8\u96C6\u884C\u80CC\u666F\u8A2D\u5B9A FR-Designer_Set_BG_Of_Current_Row=\u7DE8\u96C6\u884C\u80CC\u666F\u8A2D\u5B9A
FR-Designer_Unload_Check=\u672A\u66F8\u304D\u8FBC\u307F\u6642\u6CE8\u610F FR-Designer_Unload_Check=\u672A\u30B3\u30DF\u30C3\u30C8\u30D2\u30F3\u30C8
FR-Designer_ReportColumns_Columns_Optional=\u6BB5\u7D44\u307F FR-Designer_ReportColumns_Columns_Optional=\u6BB5\u7D44\u307F
FR-Designer_Row_Icon_File_Name=row.png FR-Designer_Row_Icon_File_Name=row.png
FR-Designer_Center_Display=\u4E2D\u592E\u63C3\u3048 FR-Designer_Center_Display=\u4E2D\u592E\u63C3\u3048
@ -2005,6 +2005,7 @@ FR-Product_Demo=\u88FD\u54C1\u30C7\u30E2
FR-Designer_Data_Filter=\u30C7\u30FC\u30BF\u30D5\u30A3\u30EB\u30BF FR-Designer_Data_Filter=\u30C7\u30FC\u30BF\u30D5\u30A3\u30EB\u30BF
FR-Designer_Can_not_use_FormatBursh=\u9023\u7D9A\u3057\u306A\u3044\u8907\u6570\u9818\u57DF\u3067\u306F\u66F8\u5F0F\u30B3\u30D4\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 FR-Designer_Can_not_use_FormatBursh=\u9023\u7D9A\u3057\u306A\u3044\u8907\u6570\u9818\u57DF\u3067\u306F\u66F8\u5F0F\u30B3\u30D4\u30FC\u3092\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093
Default=\u65E2\u5B9A Default=\u65E2\u5B9A
FR-Designer_Sheet_Label_Page_Display_Position= FR-Designer_Sheet_Label_Page_Display_Position=Sheet\u30E9\u30D9\u30EB\u30DA\u30FC\u30B8\u306E\u8868\u793A\u4F4D\u7F6E
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u3059\u3079\u3066\u9078\u629E FR-Designer_Provide_Choose_All=\u5168\u9078\u629E\u53EF\u80FD
FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u91CF: FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570:
FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -2007,4 +2007,5 @@ FR-Designer_Data_Filter=\uB370\uC774\uD130\uC120\uBCC4
Default=\uAE30\uBCF8 Default=\uAE30\uBCF8
FR-Designer_Sheet_Label_Page_Display_Position= FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD
FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9: FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9:
FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2008,3 +2008,4 @@ Default=\u9ED8\u8BA4
FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793A\u4F4D\u7F6E\uFF1A FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793A\u4F4D\u7F6E\uFF1A
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009
FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A
FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2009,3 +2009,4 @@ Default=\u9810\u8A2D
FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793A\u4F4D\u7F6E\uFF1A FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793A\u4F4D\u7F6E\uFF1A
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078 FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078
FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A
FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848

46
designer_base/src/com/fr/design/mainframe/loghandler/LogHandlerBar.java

@ -1,24 +1,16 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import java.awt.Component; import com.fr.base.BaseUtils;
import java.awt.Container; import com.fr.design.gui.ibutton.UIButton;
import java.awt.Dimension; import com.fr.general.Inter;
import java.awt.Insets;
import java.awt.ItemSelectable; import javax.swing.*;
import java.awt.LayoutManager; 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.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.Timer;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.general.Inter;
public class LogHandlerBar extends JPanel implements ItemSelectable { public class LogHandlerBar extends JPanel implements ItemSelectable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -33,8 +25,6 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
private int SERVERNUM = 0; private int SERVERNUM = 0;
private boolean isWithSerious; private boolean isWithSerious;
private int i;
private Timer timer;
public LogHandlerBar() { public LogHandlerBar() {
this(null); this(null);
@ -95,29 +85,7 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
} }
public synchronized void timerPaint() { public synchronized void timerPaint() {
isWithSerious = true; repaint();
timer = new Timer(500, null);
ActionListener taskAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (i < 5) {
isWithSerious = i % 2 == 0 ? true : false;
repaint();
} else if (i == 5) {
if (timer == null)
return;
timer.stop();
timer = null;
i = 0;
isWithSerious = true;
return;
}
i++;
}
};
if (timer != null) {
timer.addActionListener(taskAction);
timer.start();
}
} }
public int getInfo() { public int getInfo() {

5
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -2282,4 +2282,9 @@ public class RemoteEnv extends AbstractEnv {
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
} }
@Override
public void doWhenServerShutDown() {
}
} }

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

@ -24,6 +24,7 @@ import com.fr.file.FILEFactory;
import com.fr.file.FileFILE; import com.fr.file.FileFILE;
import com.fr.general.*; import com.fr.general.*;
import com.fr.plugin.PluginCollector; import com.fr.plugin.PluginCollector;
import com.fr.plugin.manage.PluginManager;
import com.fr.stable.*; import com.fr.stable.*;
import javax.swing.*; import javax.swing.*;
@ -83,6 +84,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
DesignUtils.initLookAndFeel(); DesignUtils.initLookAndFeel();
DesignUtils.creatListeningServer(getStartPort(), startFileSuffix()); DesignUtils.creatListeningServer(getStartPort(), startFileSuffix());
//初始化插件引擎
PluginManager.init();
// 初始化Log Handler // 初始化Log Handler
DesignerEnvManager.loadLogSetting(); DesignerEnvManager.loadLogSetting();
DesignerFrame df = createDesignerFrame(); DesignerFrame df = createDesignerFrame();

62
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

@ -6,8 +6,6 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.chart.ChartEditPaneProvider; import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
@ -24,14 +22,12 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.List; import java.util.List;
public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4DataSourceChange, ChartEditPaneProvider { public class ChartEditPane extends BasicPane implements AttributeChange, ChartEditPaneProvider {
private final static int CHANGE_MIN_TIME = 80; private final static int CHANGE_MIN_TIME = 80;
@ -69,7 +65,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
paneList.add(otherPane); paneList.add(otherPane);
createTabsPane(); createTabsPane();
registerDSChangeListener();
//TableDataComboBox 中有注册DSChangeListener,这里没有必要再次注册。
//registerDSChangeListener();
} }
//构建主面板 //构建主面板
@ -119,7 +117,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("error in clone ChartEditPane"); FRLogger.getLogger().error("error in clone ChartEditPane");
} }
if(ComparatorUtils.equals(selectedPane.title4PopupWindow(),PaneTitleConstants.CHART_STYLE_TITLE)){ if (ComparatorUtils.equals(selectedPane.title4PopupWindow(), PaneTitleConstants.CHART_STYLE_TITLE)) {
dealWithStyleChange(); dealWithStyleChange();
} }
@ -130,10 +128,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/** /**
* 重新构造面板 * 重新构造面板
*
* @param currentChart 图表 * @param currentChart 图表
*/ */
public void reLayout(Chart currentChart){ public void reLayout(Chart currentChart) {
if(currentChart != null){ if (currentChart != null) {
int chartIndex = getSelectedChartIndex(currentChart); int chartIndex = getSelectedChartIndex(currentChart);
this.removeAll(); this.removeAll();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -142,21 +141,21 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
boolean isDefault = true; boolean isDefault = true;
String plotID = ""; String plotID = "";
if(currentChart.getPlot() != null){ if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID(); plotID = currentChart.getPlot().getPlotID();
isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
} }
if(isDefault){ if (isDefault) {
paneList.add(dataPane4SupportCell); paneList.add(dataPane4SupportCell);
paneList.add(stylePane); paneList.add(stylePane);
paneList.add(otherPane); paneList.add(otherPane);
this.isDefaultPane = true; this.isDefaultPane = true;
}else{ } else {
ChartDataPane chartDataPane = createChartDataPane(plotID); ChartDataPane chartDataPane = createChartDataPane(plotID);
paneList.add(chartDataPane); paneList.add(chartDataPane);
AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener); AbstractChartAttrPane[] otherPaneList = ChartTypeInterfaceManager.getInstance().getAttrPaneArray(plotID, listener);
for(int i = 0; i < otherPaneList.length; i++){ for (int i = 0; i < otherPaneList.length; i++) {
otherPaneList[i].addAttributeChangeListener(listener); otherPaneList[i].addAttributeChangeListener(listener);
paneList.add(otherPaneList[i]); paneList.add(otherPaneList[i]);
} }
@ -223,7 +222,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return; return;
} }
if(checkNeedsReLayout(collection.getSelectedChart())){ if (checkNeedsReLayout(collection.getSelectedChart())) {
reLayout(collection.getSelectedChart()); reLayout(collection.getSelectedChart());
} }
@ -250,12 +249,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
} }
public int getSelectedChartIndex(Chart chart){ public int getSelectedChartIndex(Chart chart) {
int index = 0; int index = 0;
if(typePane != null){ if (typePane != null) {
FurtherBasicBeanPane[] paneList = typePane.getPaneList(); FurtherBasicBeanPane[] paneList = typePane.getPaneList();
for(; index < paneList.length; index++){ for (; index < paneList.length; index++) {
if(paneList[index].accept(chart)){ if (paneList[index].accept(chart)) {
return index; return index;
} }
} }
@ -264,12 +263,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
//populate的时候看看要不要重构面板 //populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart){ private boolean checkNeedsReLayout(Chart chart) {
if(chart != null){ if (chart != null) {
int lastIndex = typePane.getSelectedIndex(); int lastIndex = typePane.getSelectedIndex();
int currentIndex = getSelectedChartIndex(chart); int currentIndex = getSelectedChartIndex(chart);
boolean currentPane = true; boolean currentPane = true;
if(chart.getPlot() != null){ if (chart.getPlot() != null) {
String plotID = chart.getPlot().getPlotID(); String plotID = chart.getPlot().getPlotID();
currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
} }
@ -280,9 +279,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/** /**
* 当前界面是否是默认的界面 * 当前界面是否是默认的界面
*
* @return 是否是默认的界面 * @return 是否是默认的界面
*/ */
public boolean isDefaultPane(){ public boolean isDefaultPane() {
return this.isDefaultPane; return this.isDefaultPane;
} }
@ -314,15 +314,16 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
} }
protected void dealWithStyleChange(){ protected void dealWithStyleChange() {
} }
/** /**
*主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮 * 主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
*
* @param isFromToolBar 是否来自工具栏 * @param isFromToolBar 是否来自工具栏
*/ */
public void styleChange(boolean isFromToolBar){ public void styleChange(boolean isFromToolBar) {
} }
@ -335,15 +336,4 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
paneList.get(index).addAttributeChangeListener(listener); paneList.get(index).addAttributeChangeListener(listener);
} }
/**
* 数据集改变的事件监听
*/
public void registerDSChangeListener() {
DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex());
attrPane.refreshChartDataPane(collection);
}
});
}
} }

4
designer_chart/src/com/fr/design/mainframe/chart/ChartsConfigPane.java

@ -18,7 +18,7 @@ public abstract class ChartsConfigPane <T extends Charts> extends AbstractChartA
@Override @Override
public void populate(ChartCollection collection) { public void populate(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),acceptType())) { if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(), acceptType())) {
populate(collection, (T)collection.getSelectedChart()); populate(collection, (T)collection.getSelectedChart());
} }
} }
@ -27,7 +27,7 @@ public abstract class ChartsConfigPane <T extends Charts> extends AbstractChartA
@Override @Override
public void update(ChartCollection collection) { public void update(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),acceptType())) { if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(), acceptType())) {
update(collection, (T)collection.getSelectedChart()); update(collection, (T)collection.getSelectedChart());
} }
} }

2
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -240,7 +240,7 @@ public class ChartTypePane extends AbstractChartAttrPane{
FurtherBasicBeanPane pane = cards.get(i); FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) { if (pane.accept(ob)) {
GUICoreUtils.setEnabled(this, ob.isValidPlot()); GUICoreUtils.setEnabled(chartTypeComBox.getUIComboBox(), ob.isValidPlot());
pane.populateBean(ob); pane.populateBean(ob);
Object item = pane.title4PopupWindow(); Object item = pane.title4PopupWindow();

42
designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java

@ -0,0 +1,42 @@
package com.fr.design.mainframe.chart.gui.type;
import com.fr.chart.chartattr.Chart;
/**
* Created by mengao on 2017/8/30.
* 不能删掉这个类echarts插件中用到
*/
public abstract class UserDefinedChartTypePane extends AbstractChartTypePane {
protected String[] getTypeLayoutPath() {
return new String[0];
}
protected String[] getTypeLayoutTipName(){
return new String[0];
}
protected String[] getTypeIconPath(){
return new String[]{"/com/fr/design/images/chart/default.png"};
}
protected String[] getTypeTipName() {
return new String[]{title4PopupWindow()};
}
public void updateBean(Chart chart) {
}
public void populateBean(Chart chart){
typeDemo.get(0).isPressing = true;
checkDemosBackground();
}
/**
* 弹出界面的标题
* @return 标题
*/
public String title4PopupWindow(){
return "";
}
}

4
designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -389,8 +389,8 @@ public class XCardSwitchButton extends XButton {
return; return;
} }
int tabLength = this.tagLayout.getComponentCount(); int tabLength = this.tagLayout.getComponentCount();
Map<Integer, Integer> cardWidth = new HashMap<>(); Map<Integer, Integer> cardWidth = new HashMap<Integer, Integer>();
Map<Integer, Integer> cardHeight = new HashMap<>(); Map<Integer, Integer> cardHeight = new HashMap<Integer, Integer>();
for (int i = 0; i < tabLength; i++) { for (int i = 0; i < tabLength; i++) {
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i); XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
CardSwitchButton tempCard = (CardSwitchButton) temp.toData(); CardSwitchButton tempCard = (CardSwitchButton) temp.toData();

2
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java

@ -60,7 +60,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
.setRendererClass(BooleanRender.class) .setRendererClass(BooleanRender.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit"))
}; };
List<CRPropertyDescriptor> defaultList = new ArrayList<>(); List<CRPropertyDescriptor> defaultList = new ArrayList<CRPropertyDescriptor>();
for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) { for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) {
defaultList.add(propertyDescriptor); defaultList.add(propertyDescriptor);

2
designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

@ -54,7 +54,7 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
creator.resetCreatorName(value.toString()); creator.resetCreatorName(value.toString());
} }
if(ComparatorUtils.equals("visible", properties[row].getName())){ if(ComparatorUtils.equals("visible", properties[row].getName())){
creator.resetVisible((boolean) value); creator.resetVisible((Boolean) value);
} }
properties[row].firePropertyChanged(); properties[row].firePropertyChanged();
return true; return true;

Loading…
Cancel
Save