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. 35
      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. 1
      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}/report/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}/servlet-api.jar",dest:"./tmp")

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.FRContext;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
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.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
@ -35,8 +38,12 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray;
public AuthorityEditToolBarPane(List<ToolBarButton> buttonlists) {
public AuthorityEditToolBarPane(List<ToolBarButton> buttonList) {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.init(buttonList);
}
private void init(List<ToolBarButton> buttonList) {
this.setLayout(new BorderLayout());
this.setBorder(null);
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.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new AuthorityEditPane(buttonlists);
authorityEditPane = new AuthorityEditPane(buttonList);
this.add(authorityEditPane, BorderLayout.CENTER);
}
@ -92,27 +99,25 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
initSelectedPathArray();
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole ==
null || selectedPathArray == null) {
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole == null || selectedPathArray == null) {
return;
}
for (int t = 0; t < selectedPathArray.length; t++) {
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
buttonlists.get(i).changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
}
ToolBarButton selectedButton = null;
//是否可见的checkbox
UICheckBox checkbox = (UICheckBox) e.getSource();
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
selectedButton = buttonlists.get(i);
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
UICheckBox checkbox = (UICheckBox) e.getSource();
List<ToolBarButton> btns = AuthorityEditPane.this.buttonlists;
for (int j = 0; j < btns.size(); j++) {
if (btns.get(j).isSelected()) {
//由引擎实现保存进模板报表
authorityToolBarPane.setAuthorityWebAttr(btns.get(j).getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
}
if (selectedButton != null) {
for (int t = 0; t < selectedPathArray.length; t++) {
selectedButton.changeAuthorityState(selectedPathArray[t], buttonVisible.isSelected());
authorityToolBarPane.repaint();
authorityToolBarPane.setAuthorityWebAttr(selectedButton.getWidget(), checkbox.isSelected(), selectedPathArray[t]);
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();//模版更新
RolesAlreadyEditedPane.getInstance().refreshDockingView();//已配置角色视图刷新
}
}
};
@ -209,29 +214,29 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() {
if (name.getText() == "") {
type.setText("");
if (StringUtils.EMPTY.equals(name.getText())) {
type.setText(StringUtils.EMPTY);
} else {
type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"}));
}
}
public void populateName() {
String names = "";
StringBuilder names = new StringBuilder();
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
names += "," + buttonlists.get(i).getNameOption().optionName();
names.append(",").append(buttonlists.get(i).getNameOption().optionName());
}
}
if (names != "") {
names = names.substring(1);
if (names.length() > 0) {
names.deleteCharAt(0);
}
name.setText(names);
name.setText(names.toString());
}
public void populateCheckPane() {
checkPane.removeAll();
if (name.getText() == "") {
if (StringUtils.EMPTY.equals(name.getText())) {
return;
}
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();
ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
if (webAttr == null || rw == null || rw.getWebPage() == null) {
return;
}
//wbTpl.clear先清空
//再将所有的保存进去
//看是存在服务器还存在模板里面
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) {
//填报
if (rw == null || rw.getWebPage() == null) {
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
}
dealWithWebContent(webAttr.getWebWrite(), widget, isSelected, selectedRole);
} else {
//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) {
@ -246,14 +242,11 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
for (int i = 0; i < managers.length; i++) {
ToolBar tb = managers[i].getToolBar();
for (int j = 0; j < tb.getWidgetSize(); j++) {
if (widget instanceof Button && tb.getWidget(j) instanceof Button) {
if (ComparatorUtils.equals(((Button) widget).getIconName(),
((Button) tb.getWidget(j)).getIconName())) {
if (!isSelected) {
tb.getWidget(j).getWidgetPrivilegeControl().addInvisibleRole(selectedRole);
} else {
tb.getWidget(j).getWidgetPrivilegeControl().removeInvisibleRole(selectedRole);
}
if (widget instanceof Button && tb.getWidget(j) instanceof Button && ComparatorUtils.equals(((Button) widget).getIconName(), ((Button) tb.getWidget(j)).getIconName())) {
if (!isSelected) {
tb.getWidget(j).getWidgetPrivilegeControl().addInvisibleRole(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
protected List<FurtherBasicBeanPane<? extends Present>> initPaneList() {
if (keys == null) {
keys = new ArrayList<>();
keys = new ArrayList<String>();
}
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();
paneList.add(none);
keys.add("NOPRESENT");
@ -99,7 +99,7 @@ public class PresentPane extends UIComboBoxPane<Present> {
@Override
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

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

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

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

@ -31,7 +31,7 @@ public class ReportExportAttrPane extends BasicPane {
wordExportPane = new WordExportPane();
uiTabbedPane.addTab("Word", wordExportPane);
Set<ExportAttrTabProvider> providers = ExtraDesignClassManager.getInstance().getArray(ExportAttrTabProvider.XML_TAG);
paneList = new ArrayList<>();
paneList = new ArrayList<AbstractExportPane>();
for (ExportAttrTabProvider provider : providers) {
uiTabbedPane.addTab(provider.title(), provider.toSwingComponent());
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;
}
List<NameObject> nameObjectList = new ArrayList<>();
List<NameObject> nameObjectList = new ArrayList<NameObject>();
int submiterCount = reportWriteAttr.getSubmitVisitorCount();
for (int i = 0; i < submiterCount; i++) {
@ -169,8 +169,8 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
public CustomPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
customSubmitPanes = new HashMap<>();
comboItemsMap = new HashMap<>();
customSubmitPanes = new HashMap<String, BasicBeanPane>();
comboItemsMap = new HashMap<String, String>();
Set<SubmitProvider> providers = ExtraDesignClassManager.getInstance().getArray(SubmitProvider.MARK_STRING);
addSubmitPane(new DefaultSubmit());
@ -178,7 +178,7 @@ public class SubmitVisitorListPane extends ObjectJControlPane {
addSubmitPane(provider);
}
configTypes = new ArrayList<>();
configTypes = new ArrayList<String>();
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
String key = entry.getKey();
configTypes.add(comboItemsMap.get(key));

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

@ -1,6 +1,7 @@
package com.fr.start;
import com.fr.base.BaseUtils;
import com.fr.base.Env;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
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.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.web.ServletContext;
import com.fr.stable.xml.XMLTools;
import javax.swing.*;
@ -432,7 +432,8 @@ public class Designer extends BaseDesigner {
InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime();
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.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
/**
* 设计器管理操作数据集的类:
@ -54,11 +55,11 @@ public abstract class DesignTableDataManager {
* 其实globalDsCache没有绝对的必要只是为了操作方便如果没有它那么每次清空服务器数据集或者存储过程的时候还要去遍历找一下
* 这个操作可能比较复杂 从减少代码复杂度的角度看还是很有必要的
*/
private static java.util.Map<String, TableDataWrapper> globalDsCache = new java.util.HashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new HashMap<String, String>();
private static java.util.Map<String, TableDataWrapper> globalDsCache = new ConcurrentHashMap<String, TableDataWrapper>();
private static java.util.Map<String, String> dsNameChangedMap = new ConcurrentHashMap<String, String>();
// 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";

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

35
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.design.DesignerEnvManager;
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.plugin.Plugin;
import com.fr.plugin.PluginConfigManager;
import com.fr.plugin.PluginLoader;
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.PluginDependenceException;
import com.fr.plugin.dependence.PluginDependenceUnit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
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)) {
return false;
} else if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
@ -127,7 +134,7 @@ public class PluginHelper {
File[] pluginFiles = pluginFileDir.listFiles();
if (ArrayUtils.isNotEmpty(pluginFiles)) {
for (File f : pluginFiles) {
if (f.getName().equals("plugin.xml")) {
if (AssistUtils.equals(f.getName(), "plugin.xml")) {
plugin = new Plugin();
InputStream inputStream = plugin.readEncryptXml(new FileInputStream(f));
XMLTools.readInputStreamXML(plugin, inputStream);
@ -268,17 +275,27 @@ public class PluginHelper {
FRLogger.getLogger().error(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 oldfile = new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), ProjectConstants.PLUGINS_NAME, "plugin-" + plugin.getId()));
if (!PluginManagerHelper.checkLic(plugin, fileToCheck)) {
if (!PluginManagerHelper.checkLic(plugin, oldfile)) {//安装时,在安装目录下和压缩包里都没有才弹框
if (!PluginManagerHelper.checkLic(plugin, fileToCheck) && !PluginManagerHelper.checkLic(plugin, oldfile)) {
//安装时,在安装目录下和压缩包里都没有才弹框
String checkLicFail = Inter.getLocText("FR-Designer-PluginLicense_Check_Failed");
FRLogger.getLogger().error(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();
if (ArrayUtils.isNotEmpty(files)) {
for (File f : files) {
if (foundConfigFile(f)) {
if (hasFoundConfigFile(f)) {
return f;
}
}
@ -299,14 +316,14 @@ public class PluginHelper {
return null;
}
private static boolean foundConfigFile(File dir) {
private static boolean hasFoundConfigFile(File dir) {
if (!dir.isDirectory()) {
return false;
}
File[] files = dir.listFiles();
if (ArrayUtils.isNotEmpty(files)) {
for (File f : files) {
if ("plugin.xml".equals(f.getName())) {
if (AssistUtils.equals("plugin.xml",f.getName())) {
return true;
}
}

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

@ -29,6 +29,11 @@ public class UILabel extends JLabel {
super(text);
}
public UILabel(String text, boolean enable) {
super(text);
this.setEnabled(enable);
}
public UILabel(Icon image, int 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_Provide_Choose_All=Provide Select All
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_Provide_Choose_All=Provide Select All
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_Successfully=\u53CE\u96C6\u6210\u529F
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_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
@ -507,7 +507,7 @@ FR-Designer_Property_panel=\u5C5E\u6027
FR-Designer_Select_panel=\u9078\u629E
FR-Designer_LayoutTable_Column_Width=160
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_Row_Icon_File_Name=row.png
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_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
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u3059\u3079\u3066\u9078\u629E
FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u91CF:
FR-Designer_Sheet_Label_Page_Display_Position=Sheet\u30E9\u30D9\u30EB\u30DA\u30FC\u30B8\u306E\u8868\u793A\u4F4D\u7F6E
FR-Designer_Provide_Choose_All=\u5168\u9078\u629E\u53EF\u80FD
FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570:
FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9

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

@ -2008,3 +2008,4 @@ Default=\uAE30\uBCF8
FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD
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_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009
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_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078
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;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.ItemSelectable;
import java.awt.LayoutManager;
import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.general.Inter;
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 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 {
private static final long serialVersionUID = 1L;
@ -33,8 +25,6 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
private int SERVERNUM = 0;
private boolean isWithSerious;
private int i;
private Timer timer;
public LogHandlerBar() {
this(null);
@ -95,29 +85,7 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
}
public synchronized void timerPaint() {
isWithSerious = true;
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();
}
repaint();
}
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;
}
}
@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.general.*;
import com.fr.plugin.PluginCollector;
import com.fr.plugin.manage.PluginManager;
import com.fr.stable.*;
import javax.swing.*;
@ -83,6 +84,8 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
DesignUtils.initLookAndFeel();
DesignUtils.creatListeningServer(getStartPort(), startFileSuffix());
//初始化插件引擎
PluginManager.init();
// 初始化Log Handler
DesignerEnvManager.loadLogSetting();
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.design.ChartTypeInterfaceManager;
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.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.AttributeChangeListener;
@ -24,14 +22,12 @@ import com.fr.general.FRLogger;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
import java.util.Calendar;
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;
@ -69,7 +65,9 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
paneList.add(otherPane);
createTabsPane();
registerDSChangeListener();
//TableDataComboBox 中有注册DSChangeListener,这里没有必要再次注册。
//registerDSChangeListener();
}
//构建主面板
@ -119,7 +117,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} catch (CloneNotSupportedException e) {
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();
}
@ -130,10 +128,11 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/**
* 重新构造面板
*
* @param currentChart 图表
*/
public void reLayout(Chart currentChart){
if(currentChart != null){
public void reLayout(Chart currentChart) {
if (currentChart != null) {
int chartIndex = getSelectedChartIndex(currentChart);
this.removeAll();
this.setLayout(new BorderLayout());
@ -142,21 +141,21 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
boolean isDefault = true;
String plotID = "";
if(currentChart.getPlot() != null){
if (currentChart.getPlot() != null) {
plotID = currentChart.getPlot().getPlotID();
isDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
}
if(isDefault){
if (isDefault) {
paneList.add(dataPane4SupportCell);
paneList.add(stylePane);
paneList.add(otherPane);
this.isDefaultPane = true;
}else{
} else {
ChartDataPane chartDataPane = createChartDataPane(plotID);
paneList.add(chartDataPane);
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);
paneList.add(otherPaneList[i]);
}
@ -223,7 +222,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return;
}
if(checkNeedsReLayout(collection.getSelectedChart())){
if (checkNeedsReLayout(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;
if(typePane != null){
if (typePane != null) {
FurtherBasicBeanPane[] paneList = typePane.getPaneList();
for(; index < paneList.length; index++){
if(paneList[index].accept(chart)){
for (; index < paneList.length; index++) {
if (paneList[index].accept(chart)) {
return index;
}
}
@ -264,12 +263,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
//populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart){
if(chart != null){
private boolean checkNeedsReLayout(Chart chart) {
if (chart != null) {
int lastIndex = typePane.getSelectedIndex();
int currentIndex = getSelectedChartIndex(chart);
boolean currentPane = true;
if(chart.getPlot() != null){
if (chart.getPlot() != null) {
String plotID = chart.getPlot().getPlotID();
currentPane = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID);
}
@ -280,9 +279,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/**
* 当前界面是否是默认的界面
*
* @return 是否是默认的界面
*/
public boolean isDefaultPane(){
public boolean isDefaultPane() {
return this.isDefaultPane;
}
@ -314,15 +314,16 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
}
protected void dealWithStyleChange(){
protected void dealWithStyleChange() {
}
/**
*主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
* 主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
*
* @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);
}
/**
* 数据集改变的事件监听
*/
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
public void populate(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),acceptType())) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(), acceptType())) {
populate(collection, (T)collection.getSelectedChart());
}
}
@ -27,7 +27,7 @@ public abstract class ChartsConfigPane <T extends Charts> extends AbstractChartA
@Override
public void update(ChartCollection collection) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(),acceptType())) {
if (StableUtils.classInstanceOf(collection.getSelectedChart().getClass(), acceptType())) {
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);
if (pane.accept(ob)) {
GUICoreUtils.setEnabled(this, ob.isValidPlot());
GUICoreUtils.setEnabled(chartTypeComBox.getUIComboBox(), ob.isValidPlot());
pane.populateBean(ob);
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;
}
int tabLength = this.tagLayout.getComponentCount();
Map<Integer, Integer> cardWidth = new HashMap<>();
Map<Integer, Integer> cardHeight = new HashMap<>();
Map<Integer, Integer> cardWidth = new HashMap<Integer, Integer>();
Map<Integer, Integer> cardHeight = new HashMap<Integer, Integer>();
for (int i = 0; i < tabLength; i++) {
XCardSwitchButton temp = (XCardSwitchButton) this.tagLayout.getComponent(i);
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)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit"))
};
List<CRPropertyDescriptor> defaultList = new ArrayList<>();
List<CRPropertyDescriptor> defaultList = new ArrayList<CRPropertyDescriptor>();
for (CRPropertyDescriptor propertyDescriptor: propertyTableEditor) {
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());
}
if(ComparatorUtils.equals("visible", properties[row].getName())){
creator.resetVisible((boolean) value);
creator.resetVisible((Boolean) value);
}
properties[row].firePropertyChanged();
return true;

Loading…
Cancel
Save