Browse Source

Merge pull request #1175 in BA/design from ~NEIL/design:release/8.0 to release/9.0

* commit '70d83b52aaf24c1c2dd6c734d0461f988d414d1b': (96 commits)
  1
  1
  1
  1
  修改代码检查错误
  修改代码检查错误
  修改一直触发查询bug
  修改一直触发查询bug
  修改一直触发查询bug,整理chartEditPane加载代码。
  REPORT-4345 设置了过滤的单元格下拉复制后,在右侧面板给其中一个单元格更改过滤设置,则所有单元格的过滤都会更改
  REPORT-4296 frm控件栏无法正常显示图标
  去掉ChartEditPane对Prepare4DataSourceChange接口的实现。 解决  设计器切换模板时一直触发查询   客户bug
  添加echarts使用的类,解决echart插件不能使用问题
  DEC-8 设计器远程误删服务器缓存
  无JIRA任务, 国际化冲突修正.
  DEC-8 设计器远程干涉服务器缓存问题
  1
  1
  1
  DEC-8 设计器远程干涉服务器缓存问题
  ...
master
superman 7 years ago
parent
commit
682ddcb0c1
  1. 2
      build.performance.gradle
  2. 100
      designer/src/com/fr/design/report/ReportBackgroundPane.java
  3. 2
      designer/src/com/fr/design/report/ReportExportAttrPane.java
  4. 101
      designer/src/com/fr/design/report/VerifierListPane.java
  5. 2
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  6. 8
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  7. 7
      designer/src/com/fr/grid/IntelliElements.java
  8. 5
      designer/src/com/fr/start/Designer.java
  9. 7
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  10. 5
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  11. 12
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  12. 27
      designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java
  13. 17
      designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java
  14. 3
      designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  15. 5
      designer_base/src/com/fr/design/gui/ilable/UILabel.java
  16. 6
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java
  17. 3
      designer_base/src/com/fr/design/mainframe/loghandler/LogDetailPane.java
  18. 45
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java
  19. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  20. 2
      designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java
  21. 61
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  22. 56
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  23. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  24. 47
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  25. 347
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  26. 13
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  27. 42
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java
  28. 2
      designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java
  29. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  30. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  31. 2
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java
  32. 9
      designer_form/src/com/fr/design/mainframe/JForm.java

2
build.performance.gradle

@ -14,7 +14,7 @@ task appletJar<<{
fileset(dir:"${basicDir}/core/build/classes/main") fileset(dir:"${basicDir}/core/build/classes/main")
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")
} }
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")

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

@ -1,47 +1,55 @@
package com.fr.design.report; package com.fr.design.report;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import com.fr.page.ReportSettingsProvider; import javax.swing.JPanel;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.page.ReportSettingsProvider;
import com.fr.design.dialog.BasicPane; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.general.Inter; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundPane; import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
public class ReportBackgroundPane extends BasicPane { import com.fr.design.style.background.BackgroundPane;
private UICheckBox isPrintBackgroundCheckBox;
private BackgroundPane backgroundPane; public class ReportBackgroundPane extends BasicPane {
private UICheckBox isPrintBackgroundCheckBox;
public ReportBackgroundPane() { private UICheckBox isExportBackgroundCheckBox;
this.setLayout(FRGUIPaneFactory.createBorderLayout()); private BackgroundPane backgroundPane;
backgroundPane = new BackgroundPane(); public ReportBackgroundPane() {
this.add(backgroundPane, BorderLayout.CENTER); this.setLayout(FRGUIPaneFactory.createBorderLayout());
isPrintBackgroundCheckBox = new UICheckBox( backgroundPane = new BackgroundPane();
Inter.getLocText("ReportGUI-Print_Background")); this.add(backgroundPane, BorderLayout.CENTER);
this.add(isPrintBackgroundCheckBox, BorderLayout.SOUTH);
} isPrintBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Print_Background"));
isExportBackgroundCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Export_Background"));
@Override JPanel sourth = new JPanel();
protected String title4PopupWindow() { sourth.add(isExportBackgroundCheckBox);
return Inter.getLocText(new String[]{"paper", "Background"}); sourth.add(isPrintBackgroundCheckBox);
} this.add(sourth, BorderLayout.SOUTH);
}
/**
* Populate @Override
*/ protected String title4PopupWindow() {
public void populate(ReportSettingsProvider reportSettings) { return Inter.getLocText(new String[]{"paper", "Background"});
this.backgroundPane.populate(reportSettings.getBackground()); }
this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
} /**
* Populate
/** */
* update public void populate(ReportSettingsProvider reportSettings) {
*/ this.backgroundPane.populate(reportSettings.getBackground());
public void update(ReportSettingsProvider reportSettings) { this.isPrintBackgroundCheckBox.setSelected(reportSettings.isPrintBackground());
reportSettings.setBackground(this.backgroundPane.update()); this.isExportBackgroundCheckBox.setSelected(reportSettings.isExportBackground());
reportSettings.setPrintBackground(this.isPrintBackgroundCheckBox.isSelected()); }
}
/**
* update
*/
public void update(ReportSettingsProvider reportSettings) {
reportSettings.setBackground(this.backgroundPane.update());
reportSettings.setPrintBackground(this.isPrintBackgroundCheckBox.isSelected());
reportSettings.setExportBackground(this.isExportBackgroundCheckBox.isSelected());
}
} }

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);
}
}
}
}

2
designer/src/com/fr/design/webattr/WriteWebSettingPane.java

@ -56,7 +56,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//sheet标签页显示位置 //sheet标签页显示位置
topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top")); topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom")); bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":", UILabel.LEFT); sheetShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Sheet_Label_Page_Display_Position"), UILabel.LEFT);
ButtonGroup buttonGroup = new ButtonGroup(); ButtonGroup buttonGroup = new ButtonGroup();
bottomRadioButton.setSelected(true); bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton); buttonGroup.add(topRadioButton);

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));

7
designer/src/com/fr/grid/IntelliElements.java

@ -194,7 +194,12 @@ public class IntelliElements {
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex); TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex);
applyStyle(newCellElement, sourceCellElement);//style applyStyle(newCellElement, sourceCellElement);//style
if (sourceCellElement.getValue() instanceof DSColumn) { if (sourceCellElement.getValue() instanceof DSColumn) {
DSColumn dsColumn = (DSColumn) sourceCellElement.getValue(); DSColumn dsColumn = null;
try {
dsColumn = (DSColumn) ((DSColumn) sourceCellElement.getValue()).clone();
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
newCellElement.setValue(dsColumn); newCellElement.setValue(dsColumn);
newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr()); newCellElement.setCellExpandAttr(sourceCellElement.getCellExpandAttr());
} else if (sourceCellElement.getValue() instanceof Number) { } else if (sourceCellElement.getValue() instanceof Number) {

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;
@ -36,7 +37,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.*;
@ -450,7 +450,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());
} }

12
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -36,8 +36,12 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()]; columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems(); columnNameComboBox.removeAllItems();
@ -64,7 +68,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
dsColumn.setDsName(tableDataWrappe.getTableDataName()); dsColumn.setDsName(tableDataWrappe.getTableDataName());
TableDataColumn column; TableDataColumn column;
String columnExp = (String) this.columnNameComboBox.getSelectedItem(); String columnExp = (String) this.columnNameComboBox.getSelectedItem();
if (StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#")) { if (StringUtils.isNotBlank(columnExp) && checkColumnExp(columnExp)) {
String number = columnExp.substring(1); String number = columnExp.substring(1);
Pattern pattern = Pattern.compile("[^\\d]"); Pattern pattern = Pattern.compile("[^\\d]");
if (pattern.matcher(number).find()) { if (pattern.matcher(number).find()) {
@ -80,6 +84,10 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
return dsColumn; return dsColumn;
} }
private boolean checkColumnExp (String columnExp) {
return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");
}
public String getIconName() { public String getIconName() {
return "ds_column"; return "ds_column";
} }

27
designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.js.JavaScript;
import javax.swing.*; import javax.swing.*;
@ -14,7 +15,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
protected Class clazzOfObject; protected Class clazzOfObject;
protected Class clazzOfInitCase; protected Class clazzOfInitCase;
protected Class<? extends BasicBeanPane> clazzOfEditor; protected Class<? extends BasicBeanPane> clazzOfEditor;
public AbstractNameableCreator(String menuName, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) { public AbstractNameableCreator(String menuName, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName; this.menuName = menuName;
this.clazzOfObject = clazz; this.clazzOfObject = clazz;
@ -28,7 +29,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfObject = clazz; this.clazzOfObject = clazz;
this.clazzOfInitCase = clazz; this.clazzOfInitCase = clazz;
} }
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) { public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName; this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath); this.menuIcon = BaseUtils.readIcon(iconPath);
@ -36,7 +37,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfEditor = clazzOfEditor; this.clazzOfEditor = clazzOfEditor;
this.clazzOfInitCase = clazz; this.clazzOfInitCase = clazz;
} }
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class clazz4Init, Class<? extends BasicBeanPane> clazzOfEditor) { public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class clazz4Init, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName; this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath); this.menuIcon = BaseUtils.readIcon(iconPath);
@ -50,7 +51,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
* get menuName * get menuName
* @return * @return
*/ */
public String menuName() { public String menuName() {
return this.menuName; return this.menuName;
} }
@ -70,6 +71,14 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return this.clazzOfEditor; return this.clazzOfEditor;
} }
/**
* get clazzOfObject
* @return clazzOfObject
*/
public Class <? extends JavaScript> getHyperlink() {
return this.clazzOfObject;
}
/** /**
* *
* @param ob * @param ob
@ -83,12 +92,12 @@ public abstract class AbstractNameableCreator implements NameableCreator {
doSthChanged4Icon(ob); doSthChanged4Icon(ob);
return ob; return ob;
} }
return null; return null;
} }
protected void doSthChanged4Icon(Object ob){ protected void doSthChanged4Icon(Object ob){
} }
/** /**
@ -99,9 +108,9 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return null; return null;
} }
public boolean isNeedParameterWhenPopulateJControlPane(){ public boolean isNeedParameterWhenPopulateJControlPane(){
return false; return false;
} }
public boolean equals(Object obj) { public boolean equals(Object obj) {
return obj instanceof AbstractNameableCreator return obj instanceof AbstractNameableCreator

17
designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java

@ -2,24 +2,27 @@ package com.fr.design.gui.controlpane;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.ListModelElement;
import com.fr.js.JavaScript;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.*; import javax.swing.*;
public interface NameableCreator { public interface NameableCreator {
public String menuName(); public String menuName();
public Icon menuIcon(); public Icon menuIcon();
public String createTooltip(); public String createTooltip();
public Nameable createNameable(UnrepeatedNameHelper helper); public Nameable createNameable(UnrepeatedNameHelper helper);
public Class<? extends BasicBeanPane> getUpdatePane(); public Class<? extends BasicBeanPane> getUpdatePane();
public Class <? extends JavaScript> getHyperlink();
public Object acceptObject2Populate(Object ob); public Object acceptObject2Populate(Object ob);
public void saveUpdatedBean(ListModelElement wrapper, Object bean); public void saveUpdatedBean(ListModelElement wrapper, Object bean);
public boolean isNeedParameterWhenPopulateJControlPane(); public boolean isNeedParameterWhenPopulateJControlPane();
} }

3
designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -237,7 +237,8 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dimension = new Dimension(); Dimension dimension = new Dimension();
dimension.height = super.getPreferredSize().height; dimension.height = super.getPreferredSize().height;
dimension.width = addButton.getWidth() - 2; // 不能写死,否则出现国际化显示不全的问题
dimension.width = Math.max(addButton.getWidth() - 2, super.getPreferredSize().width);
return dimension; return dimension;
} }
}; };

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);
} }

6
designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import com.fr.stable.fun.impl.AbstractLogProvider; import com.fr.stable.fun.impl.AbstractLogProvider;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.LogRecordTimeProvider; import com.fr.stable.xml.LogRecordTimeProvider;
import java.util.ArrayList; import java.util.ArrayList;
@ -43,4 +44,9 @@ public class DesignerLogImpl extends AbstractLogProvider{
public void record(LogRecordTimeProvider logRecordTime) { public void record(LogRecordTimeProvider logRecordTime) {
records.add(logRecordTime); records.add(logRecordTime);
} }
@Override
public void record(LogRecordTimeProvider logRecordTime, SessionProvider sessionProvider) {
}
} }

3
designer_base/src/com/fr/design/mainframe/loghandler/LogDetailPane.java

@ -7,6 +7,7 @@ import javax.swing.JPanel;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
public class LogDetailPane extends JPanel{ public class LogDetailPane extends JPanel{
public LogDetailPane() { public LogDetailPane() {
@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{
fr.setSize(600, 400); fr.setSize(600, 400);
GUICoreUtils.centerWindow(fr); GUICoreUtils.centerWindow(fr);
fr.setResizable(false); fr.setResizable(false);
fr.setTitle("日志"); fr.setTitle(Inter.getLocText("FR-Designer_Log"));
fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png")); fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png"));
fr.getContentPane().setLayout(new BorderLayout()); fr.getContentPane().setLayout(new BorderLayout());
fr.getContentPane().add(this, BorderLayout.CENTER); fr.getContentPane().add(this, BorderLayout.CENTER);

45
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java

@ -1,34 +1,13 @@
package com.fr.design.chart.series.PlotSeries; package com.fr.design.chart.series.PlotSeries;
import java.awt.AlphaComposite; import com.fr.base.BaseUtils;
import java.awt.BasicStroke; import com.fr.base.Utils;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.util.*;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.base.*;
import com.fr.chart.base.MapSvgAttr; import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper; import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.chart.chartglyph.MapShapeValue; import com.fr.chart.chartglyph.MapShapeValue;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.event.ChangeEvent; import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener; import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -37,13 +16,23 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UISelectTable; import com.fr.design.gui.itable.UISelectTable;
import com.fr.design.gui.itable.UITableNoOptionUI; import com.fr.design.gui.itable.UITableNoOptionUI;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.dialog.UIDialog;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.CoreGraphHelper; import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
/** /**
* 地图 图片编辑界面 选中图片 编辑. 支持鼠标选中等事件 * 地图 图片编辑界面 选中图片 编辑. 支持鼠标选中等事件

29
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java

@ -96,7 +96,7 @@ public class DataLabelPane extends TooltipContentsPane {
} }
delimiterBox.setPreferredSize(new Dimension(70, 20)); delimiterBox.setPreferredSize(new Dimension(70, 20));
JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); JPanel boxPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
boxPane.add(new UILabel(Inter.getLocText("Form-Delimiter") + ":")); boxPane.add(new UILabel(Inter.getLocText("FR-Designer_Dismenber") + ":"));
boxPane.add(delimiterBox); boxPane.add(delimiterBox);
return boxPane; return boxPane;
} }
@ -111,34 +111,9 @@ public class DataLabelPane extends TooltipContentsPane {
} }
protected JPanel createJPanel4Position() { protected JPanel createJPanel4Position() {
// 标签位置:上下左右中. return null;
bottomButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Bottom"));
leftButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Left"));
rigtButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Right"));
topButton = new UIRadioButton(Inter.getLocText("StyleAlignment-Top"));
centerButton = new UIRadioButton(Inter.getLocText("Center"));
ButtonGroup bg = new ButtonGroup();
bg.add(bottomButton);
bg.add(leftButton);
bg.add(rigtButton);
bg.add(topButton);
bg.add(centerButton);
topButton.setSelected(true);
JPanel buttonPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
buttonPane.add(new UILabel(Inter.getLocText(new String[]{"Label", "Layout"}) + ":"));
buttonPane.add(bottomButton);
buttonPane.add(leftButton);
buttonPane.add(rigtButton);
buttonPane.add(topButton);
buttonPane.add(centerButton);
return buttonPane;
} }
public void populate(AttrContents seriesAttrContents) { public void populate(AttrContents seriesAttrContents) {
super.populate(seriesAttrContents); super.populate(seriesAttrContents);
String dataLabel = seriesAttrContents.getSeriesLabel(); String dataLabel = seriesAttrContents.getSeriesLabel();

2
designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java

@ -30,7 +30,7 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{
return new Dimension(super.getPreferredSize().width, 18); return new Dimension(super.getPreferredSize().width, 18);
} }
}; };
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0)); nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
nameLabel.setHorizontalAlignment(SwingConstants.CENTER); nameLabel.setHorizontalAlignment(SwingConstants.CENTER);
} }

61
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane; import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -30,11 +31,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
public MiddleChartPropertyPane() { public MiddleChartPropertyPane() {
initComponenet(); initComponenet();
} }
protected void initComponenet() { protected void initComponenet() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(null); this.setBorder(null);
createNameLabel(); createNameLabel();
this.add(createNorthComponent(), BorderLayout.NORTH); this.add(createNorthComponent(), BorderLayout.NORTH);
chartEditPane = StableUtils.construct(ChartEditPane.class); chartEditPane = StableUtils.construct(ChartEditPane.class);
@ -47,11 +48,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
this.createMainPane(); this.createMainPane();
setSureProperty(); setSureProperty();
} }
protected abstract void createNameLabel(); protected abstract void createNameLabel();
protected abstract JComponent createNorthComponent(); protected abstract JComponent createNorthComponent();
protected abstract void createMainPane(); protected abstract void createMainPane();
@ -64,10 +65,10 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.setContainer(container); chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener); chartEditPane.addTitleChangeListener(titleListener);
String tabname = chartEditPane.getSelectedTabName(); String tabname = chartEditPane.getSelectedTabName();
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : "")); nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : StringUtils.EMPTY));
resetChartEditPane(); resetChartEditPane();
} }
protected void resetChartEditPane() { protected void resetChartEditPane() {
remove(chartEditPane); remove(chartEditPane);
add(chartEditPane, BorderLayout.CENTER); add(chartEditPane, BorderLayout.CENTER);
@ -75,20 +76,20 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
repaint(); repaint();
revalidate(); revalidate();
} }
protected TitleChangeListener titleListener = new TitleChangeListener() { protected TitleChangeListener titleListener = new TitleChangeListener() {
@Override @Override
public void fireTitleChange(String addName) { public void fireTitleChange(String addName) {
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName); nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName);
} }
}; };
/** /**
* 感觉ChartCollection加载图表属性界面. * 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表 * @param collection 收集图表
* @param ePane 面板 * @param ePane 面板
*/ */
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) { public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) {
addChartEditPane(collection.getSelectedChart().getPlot().getPlotID()); addChartEditPane(collection.getSelectedChart().getPlot().getPlotID());
setSupportCellData(true); setSupportCellData(true);
@ -96,11 +97,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.populate(collection); chartEditPane.populate(collection);
} }
/** /**
* 感觉ChartCollection加载图表属性界面. * 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表 * @param collection 收集图表
* @param ePane 面板 * @param ePane 面板
*/ */
public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> ePane) { public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> ePane) {
if (collection instanceof ChartCollection) { if (collection instanceof ChartCollection) {
populateChartPropertyPane((ChartCollection)collection, ePane); populateChartPropertyPane((ChartCollection)collection, ePane);
@ -127,18 +128,18 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
return BaseUtils.readIcon("/com/fr/design/images/m_report/qb.png"); return BaseUtils.readIcon("/com/fr/design/images/m_report/qb.png");
} }
/** /**
* 预定义定位 * 预定义定位
* @return 定位 * @return 定位
*/ */
public Location preferredLocation() { public Location preferredLocation() {
return Location.WEST_BELOW; return Location.WEST_BELOW;
} }
/** /**
* 创建标题Panel * 创建标题Panel
* @return 标题panel * @return 标题panel
*/ */
public UITitlePanel createTitlePanel() { public UITitlePanel createTitlePanel() {
return new UITitlePanel(this); return new UITitlePanel(this);
} }
@ -148,14 +149,14 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
*/ */
public void refreshDockingView() { public void refreshDockingView() {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
/** /**
* 设置是否支持单元格数据. * 设置是否支持单元格数据.
*/ */
public void setSupportCellData(boolean supportCellData) { public void setSupportCellData(boolean supportCellData) {
if(chartEditPane != null) { if (chartEditPane != null) {
chartEditPane.setSupportCellData(supportCellData); chartEditPane.setSupportCellData(supportCellData);
} }
} }

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

@ -21,6 +21,7 @@ import com.fr.design.mainframe.chart.gui.ChartTypePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -30,7 +31,7 @@ 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, Prepare4DataSourceChange, ChartEditPaneProvider {
private final static int CHANGE_MIN_TIME = 80; private final static int CHANGE_MIN_TIME = 80;
@ -118,7 +119,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();
} }
@ -129,10 +130,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());
@ -140,22 +142,22 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
addTypePane(); addTypePane();
boolean isDefault = true; boolean isDefault = true;
String plotID = ""; String plotID = StringUtils.EMPTY;
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]);
} }
@ -177,6 +179,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
protected void setSelectedTab() { protected void setSelectedTab() {
//doNothing
} }
/** /**
@ -222,7 +225,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return; return;
} }
if(checkNeedsReLayout(collection.getSelectedChart())){ if (isNeedsReLayout(collection.getSelectedChart())) {
reLayout(collection.getSelectedChart()); reLayout(collection.getSelectedChart());
} }
@ -249,12 +252,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;
} }
} }
@ -263,12 +266,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
//populate的时候看看要不要重构面板 //populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart){ private boolean isNeedsReLayout(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);
} }
@ -279,9 +282,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/** /**
* 当前界面是否是默认的界面 * 当前界面是否是默认的界面
*
* @return 是否是默认的界面 * @return 是否是默认的界面
*/ */
public boolean isDefaultPane(){ public boolean isDefaultPane() {
return this.isDefaultPane; return this.isDefaultPane;
} }
@ -313,16 +317,17 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
} }
} }
protected void dealWithStyleChange(){ protected void dealWithStyleChange() {
//doNothing
} }
/** /**
*主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮 * 主要用于图表设计器判断样式改变是否来自工具栏的全局样式按钮
*
* @param isFromToolBar 是否来自工具栏 * @param isFromToolBar 是否来自工具栏
*/ */
public void styleChange(boolean isFromToolBar){ public void styleChange(boolean isFromToolBar) {
//doNothing
} }
/** /**
@ -341,7 +346,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
DesignTableDataManager.addDsChangeListener(new ChangeListener() { DesignTableDataManager.addDsChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex()); AbstractChartAttrPane attrPane = paneList.get(tabsHeaderIconPane.getSelectedIndex());
attrPane.refreshChartDataPane(collection); //不显示,没有处于编辑状态,没必要更新。
if (attrPane.isShowing()) {
attrPane.refreshChartDataPane(collection);
}
} }
}); });
} }

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

@ -17,6 +17,7 @@ import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox;
import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.item.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -238,6 +239,9 @@ public class ChartTypePane extends AbstractChartAttrPane{
for (int i = 0; i < this.cards.size(); i++) { for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i); FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) { if (pane.accept(ob)) {
GUICoreUtils.setEnabled(chartTypeComBox.getUIComboBox(), ob.isValidPlot());
pane.populateBean(ob); pane.populateBean(ob);
Object item = pane.title4PopupWindow(); Object item = pane.title4PopupWindow();
for (int j = 0; j < cardNames.length; j++) { for (int j = 0; j < cardNames.length; j++) {

47
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -41,7 +42,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private UIButton addButton; private UIButton addButton;
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public List<UIComboBox> getBoxList() {
return boxList;
}
public CategoryPlotMoreCateTableDataContentPane() { public CategoryPlotMoreCateTableDataContentPane() {
// do nothing // do nothing
} }
@ -89,8 +94,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null); checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox); makeToolTipUse(categoryCombox);
checkAddButton(); checkComponent();
} }
}); });
} }
@ -129,15 +134,15 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
buttonPane.add(delButton); buttonPane.add(delButton);
boxPane.add(buttonPane); boxPane.add(buttonPane);
boxList.add(combox); boxList.add(combox);
checkAddButton(); checkComponent();
delButton.addActionListener(new ActionListener() { delButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane); boxPane.remove(buttonPane);
boxList.remove(combox); boxList.remove(combox);
checkAddButton(); checkComponent();
relayoutPane(); relayoutPane();
} }
}); });
@ -150,6 +155,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
int size = boxList.size(); int size = boxList.size();
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null); addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null);
} }
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() { private void relayoutPane() {
this.revalidate(); this.revalidate();
@ -162,8 +171,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/ */
public void checkBoxUse(boolean hasUse) { public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse); super.checkBoxUse(hasUse);
checkAddButton(); checkComponent();
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {
@ -221,17 +230,23 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/ */
public void updateBean(ChartCollection collection) { public void updateBean(ChartCollection collection) {
super.updateBean(collection); super.updateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if(top instanceof NormalTableDataDefinition) { Plot plot = collection.getSelectedChart().getPlot();
NormalTableDataDefinition normal = (NormalTableDataDefinition)top; if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
normal.clearMoreCate(); normal.clearMoreCate();
for(int i = 0, size = boxList.size(); i < size; i++) { updateMoreCate(normal, plot);
UIComboBox box = boxList.get(i); }
if(box.getSelectedItem() != null) { }
normal.addMoreCate(box.getSelectedItem().toString());
} protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
for (int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i);
if (box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString());
} }
} }
} }
} }

347
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -12,6 +12,7 @@ import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane; import com.fr.design.chart.javascript.ChartEmailPane;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane;
@ -21,6 +22,8 @@ import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.UIBubbleFloatPane; import com.fr.design.gui.frpane.UIBubbleFloatPane;
import com.fr.design.gui.frpane.UICorrelationComboBoxPane; import com.fr.design.gui.frpane.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -53,9 +56,10 @@ import java.text.DecimalFormat;
import java.text.Format; import java.text.Format;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Set;
public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIObserver{
private static final long serialVersionUID = 3477409806918835992L; private static final long serialVersionUID = 3477409806918835992L;
private static HashMap normalMap = new HashMap(); private static HashMap normalMap = new HashMap();
private static HashMap gisMap = new HashMap(); private static HashMap gisMap = new HashMap();
private static HashMap mapMap = new HashMap(); private static HashMap mapMap = new HashMap();
@ -69,16 +73,16 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private static final int TIME_SWITCH_GAP = 40; private static final int TIME_SWITCH_GAP = 40;
private UICheckBox isChartAnimation;// 动态 private UICheckBox isChartAnimation;// 动态
private UICheckBox isSeriesDragEnable; //系列拖拽 private UICheckBox isSeriesDragEnable; //系列拖拽
private UICheckBox isAxisZoom;// 缩放 private UICheckBox isAxisZoom;// 缩放
private UICheckBox isDatapointValue;// 数据点提示 private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat; private UIButton dataPointValueFormat;
private UICheckBox isDatapointPercent; private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat; private UIButton dataPointPercentFormat;
private UILabel tooltipStyleLabel; private UILabel tooltipStyleLabel;
private UIComboBox tooltipStyle; private UIComboBox tooltipStyle;
@ -90,55 +94,55 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private UICheckBox isAddress; private UICheckBox isAddress;
private UICheckBox isAddressName; private UICheckBox isAddressName;
private UICheckBox isAxisShowToolTip;// 坐标轴提示 private UICheckBox isAxisShowToolTip;// 坐标轴提示
protected UICheckBox isAutoRefresh;// 自动刷新 protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime; protected UISpinner autoRefreshTime;
private UICorrelationComboBoxPane superLink;// 超链 private UICorrelationComboBoxPane superLink;// 超链
private FormatPane valueFormatPane; private FormatPane valueFormatPane;
private FormatPane percentFormatPane; private FormatPane percentFormatPane;
private Format valueFormat; private Format valueFormat;
private Format percentFormat; private Format percentFormat;
private JPanel tooltipPane; private JPanel tooltipPane;
private JPanel axisShowPane; private JPanel axisShowPane;
private JPanel autoRefreshPane; private JPanel autoRefreshPane;
private JPanel superlinkPane; private JPanel superlinkPane;
private ChartOtherPane parent; private ChartOtherPane parent;
private UICheckBox timeSwitch; private UICheckBox timeSwitch;
private JPanel timeSwitchContainer; private JPanel timeSwitchContainer;
private TimeSwitchPane timeSwitchPane; private TimeSwitchPane timeSwitchPane;
private static final int SIZEX = 258; private static final int SIZEX = 258;
private static final int SIZEY = 209; private static final int SIZEY = 209;
private static final int DET = 20; private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) { public ChartInteractivePane(ChartOtherPane parent) {
super(); super();
this.parent = parent; this.parent = parent;
} }
/** /**
* 界面标题. * 界面标题.
* @return 返回标题. * @return 返回标题.
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab"); return Inter.getLocText("Chart-Interactive_Tab");
} }
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow")); isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag")); isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value")); isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent")); isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format")); dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")}); tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name")); tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name"));
tooltipShowType = new UIComboBox(new String []{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")}); tooltipShowType = new UIComboBox(new String []{Inter.getLocText("Chart-Series_SingleData"), Inter.getLocText("Chart-Series_AllData")});
@ -148,13 +152,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address")); isAddress = new UICheckBox(Inter.getLocText("Chart-Gis_Address"));
isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name")); isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name"));
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip")); isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom")); isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"})); isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1); autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane(); superLink = new UICorrelationComboBoxPane();
isAutoRefresh.addActionListener(new ActionListener() { isAutoRefresh.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
checkAutoRefresh(); checkAutoRefresh();
@ -162,9 +166,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}); });
timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch")); timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch"));
timeSwitchPane = new TimeSwitchPane(); timeSwitchPane = new TimeSwitchPane();
initFormatListener(); initFormatListener();
return initPaneWithListener(); return initPaneWithListener();
} }
private void initFormatListener() { private void initFormatListener() {
@ -240,19 +244,19 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}); });
} }
private void checkAutoRefresh() { private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected()); GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
} }
/** /**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件. * 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return * @return
*/ */
private JPanel initPaneWithListener() { private JPanel initPaneWithListener() {
initDataPointToolTipPane(); initDataPointToolTipPane();
initAxisShowPane(); initAxisShowPane();
initAutoRefreshPane(); initAutoRefreshPane();
initSuperlinkPane(); initSuperlinkPane();
initTimeSwitchPane(); initTimeSwitchPane();
@ -271,7 +275,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}; };
//初始化界面时 加载事件 //初始化界面时 加载事件
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
private void initTimeSwitchPane(){ private void initTimeSwitchPane(){
timeSwitchContainer = new JPanel(new BorderLayout()); timeSwitchContainer = new JPanel(new BorderLayout());
@ -283,11 +287,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
/** /**
* 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout. * 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout.
*/ */
private void initDataPointToolTipPane() { private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p}; double[] rowSize = new double[]{p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat}, new Component[]{isDatapointPercent, dataPointPercentFormat},
@ -298,7 +302,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipStyleLabel, tooltipStyle} new Component[]{tooltipStyleLabel, tooltipStyle}
}; };
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize); tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
} }
private void relayoutDataPointToolTipPane(Plot plot) { private void relayoutDataPointToolTipPane(Plot plot) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
@ -333,8 +337,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else { } else {
rowSize = new double[]{p, p, p}; rowSize = new double[]{p, p, p};
components = new Component[][]{ components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat}, new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat}, new Component[]{isDatapointPercent, dataPointPercentFormat},
getTooltipStyleComponent() getTooltipStyleComponent()
}; };
} }
@ -370,49 +374,49 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null}; return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
} }
private void initAxisShowPane() { private void initAxisShowPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p}; double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip}, new Component[]{isAxisShowToolTip},
}; };
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize); axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
} }
private void initAutoRefreshPane() { private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p}; double[] rowSize = new double[]{p, p, p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null}, new Component[]{isAutoRefresh,null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{ new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")), new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime, autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds")) new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)}, }, 1)},
new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null}, new Component[]{new UILabel("<html><font size='2' face='Microsoft Yahei' color='red'>" + Inter.getLocText("FR-Chart-AutoRefresh_NotSupportIMGAndReportData") + "</font></html>"), null},
}; };
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize); autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize);
} }
private void initSuperlinkPane() { private void initSuperlinkPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f}; double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{superLink, null}, new Component[]{superLink, null},
}; };
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize); superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
} }
private void relayoutWithPlot(Plot plot) { private void relayoutWithPlot(Plot plot) {
this.removeAll(); this.removeAll();
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{TableLayout.FILL}; double[] columnSize = new double[]{TableLayout.FILL};
double[] rowSize = new double[]{p, p, p}; double[] rowSize = new double[]{p, p, p};
@ -427,7 +431,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
double[] row = new double[]{p, p, p, p, p, p}; double[] row = new double[]{p, p, p, p, p, p};
reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize)); reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize));
} }
private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) { private Component[] getChartAnimatePane(Plot plot, double[] row, double[] col) {
@ -455,9 +459,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER); timeSwitchContainer.add(timeSwitch, BorderLayout.CENTER);
if(timeSwitch.isSelected()){ if(timeSwitch.isSelected()){
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f}; double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] rowSize = new double[]{p}; double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, timeSwitchPane}, new Component[]{null, timeSwitchPane},
}; };
@ -523,15 +527,15 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[]{superlinkPane}; return new Component[]{superlinkPane};
} }
@Override @Override
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
relayoutWithGis(chart, plot); relayoutWithGis(chart, plot);
relayoutWithPlot(plot); relayoutWithPlot(plot);
populateChartAnimate(chart, plot); populateChartAnimate(chart, plot);
populateChartScale(plot); populateChartScale(plot);
@ -540,8 +544,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
populateAutoRefresh(chart); populateAutoRefresh(chart);
populateHyperlink(plot); populateHyperlink(plot);
checkAutoRefresh(); checkAutoRefresh();
} }
private void relayoutWithGis(Chart chart, Plot plot) { private void relayoutWithGis(Chart chart, Plot plot) {
if(plot.isSupportAddress4Gis()) { if(plot.isSupportAddress4Gis()) {
@ -579,7 +583,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
timeSwitch.setEnabled(false); timeSwitch.setEnabled(false);
//只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换 //只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换
if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){ if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){
return; return;
} }
if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){ if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){
@ -655,6 +659,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private void populateHyperlink(Plot plot) { private void populateHyperlink(Plot plot) {
HashMap paneMap = renewMapWithPlot(plot); HashMap paneMap = renewMapWithPlot(plot);
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator();
paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
List<UIMenuNameableCreator> list = refreshList(paneMap); List<UIMenuNameableCreator> list = refreshList(paneMap);
superLink.refreshMenuAndAddMenuAction(list); superLink.refreshMenuAndAddMenuAction(list);
@ -672,13 +683,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.doLayout(); superLink.doLayout();
} }
@Override @Override
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) { if (chart == null || chart.getPlot() == null) {
return; return;
} }
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
updateChartAnimate(chart, plot); updateChartAnimate(chart, plot);
updateChartScale(plot); updateChartScale(plot);
@ -686,7 +697,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
updateAxisTip(plot); updateAxisTip(plot);
updateAutoRefresh(plot); updateAutoRefresh(plot);
updateHyperlink(plot); updateHyperlink(plot);
} }
private void updateChartAnimate(Chart chart, Plot plot) { private void updateChartAnimate(Chart chart, Plot plot) {
if(plot.isSupportAnimate()) { if(plot.isSupportAnimate()) {
@ -818,7 +829,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} }
protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) { protected Class<? extends BasicBeanPane> getUseMap(HashMap map, Object key) {
if(map.get(key) != null){ if(map.get(key) != null){
return (Class<? extends BasicBeanPane>)map.get(key); return (Class<? extends BasicBeanPane>)map.get(key);
} }
@ -832,33 +843,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} }
} }
return null; return null;
} }
protected List<UIMenuNameableCreator> refreshList(HashMap map) {
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"), protected List<UIMenuNameableCreator> refreshList(HashMap map) {
List<UIMenuNameableCreator> list = new ArrayList<UIMenuNameableCreator>();
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Reportlet"),
new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class))); new ReportletHyperlink(), getUseMap(map, ReportletHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class)); list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Mail"), new EmailJavaScript(), ChartEmailPane.class));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"),
new WebHyperlink(), getUseMap(map, WebHyperlink.class))); new WebHyperlink(), getUseMap(map, WebHyperlink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Dynamic_Parameters"),
new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class))); new ParameterJavaScript(), getUseMap(map, ParameterJavaScript.class)));
list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class))); list.add(new UIMenuNameableCreator("JavaScript", new JavaScriptImpl(), getUseMap(map, JavaScriptImpl.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Float_Chart"),
new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class))); new ChartHyperPoplink(), getUseMap(map, ChartHyperPoplink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"),
new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class))); new ChartHyperRelateCellLink(), getUseMap(map, ChartHyperRelateCellLink.class)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Float"),
new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class))); new ChartHyperRelateFloatLink(), getUseMap(map, ChartHyperRelateFloatLink.class)));
FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider hyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Form"), list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Form"),
hyperlink, getUseMap(map, FormHyperlinkProvider.class))); hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list; return list;
} }
private HashMap renewMapWithPlot(Plot plot) { private HashMap renewMapWithPlot(Plot plot) {
if(plot instanceof PiePlot) { if(plot instanceof PiePlot) {
@ -1021,8 +1032,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private HashMap getNormalPlotHyperMap() { private HashMap getNormalPlotHyperMap() {
if(normalMap.isEmpty()) { if(normalMap.isEmpty()) {
FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider fp = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART.class); normalMap.put(ReportletHyperlink.class, ReportletHyperlinkPane.CHART.class);
normalMap.put(EmailJavaScript.class, ChartEmailPane.class); normalMap.put(EmailJavaScript.class, ChartEmailPane.class);
normalMap.put(WebHyperlink.class, WebHyperlinkPane.CHART.class); normalMap.put(WebHyperlink.class, WebHyperlinkPane.CHART.class);
@ -1041,27 +1052,27 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} }
return normalMap; return normalMap;
} }
@Override @Override
public Chart updateBean() { public Chart updateBean() {
return null; return null;
} }
/** /**
* 给组件登记一个观察者监听事件 * 给组件登记一个观察者监听事件
* *
* @param listener 观察者监听事件 * @param listener 观察者监听事件
*/ */
public void registerChangeListener(UIObserverListener listener) { public void registerChangeListener(UIObserverListener listener) {
timeSwitch.registerChangeListener(listener); timeSwitch.registerChangeListener(listener);
timeSwitchPane.registerChangeListener(listener); timeSwitchPane.registerChangeListener(listener);
} }
/** /**
* 组件是否需要响应添加的观察者事件 * 组件是否需要响应添加的观察者事件
* *
* @return 如果需要响应观察者事件则返回true否则返回false * @return 如果需要响应观察者事件则返回true否则返回false
*/ */
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return true; return true;
} }

13
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -43,6 +43,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
protected List<ChartImagePane> styleList; protected List<ChartImagePane> styleList;
protected JPanel stylePane; //样式布局的面板 protected JPanel stylePane; //样式布局的面板
private JPanel typePane;
protected abstract String[] getTypeIconPath(); protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName(); protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath(); protected abstract String[] getTypeLayoutPath();
@ -70,10 +71,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
checkDemosBackground(); checkDemosBackground();
JPanel typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4); this.typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
for(int i = 0; i < typeDemo.size(); i++) { for(int i = 0; i < typeDemo.size(); i++) {
ChartImagePane tmp = typeDemo.get(i); ChartImagePane tmp = typeDemo.get(i);
typePane.add(tmp); this.typePane.add(tmp);
tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()])); tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()]));
} }
@ -99,7 +100,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
stylePane.setVisible(false); stylePane.setVisible(false);
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(typePane),rowSize,columnSize); JPanel panel = TableLayoutHelper.createTableLayoutPane(getPaneComponents(this.typePane),rowSize,columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
} }
@ -133,7 +134,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
} }
//子类覆盖 //子类覆盖
protected Plot getSelectedClonedPlot(){ protected <T extends Plot> T getSelectedClonedPlot(){
return null; return null;
} }
@ -586,6 +587,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
&& chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE; && chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE;
} }
protected JPanel getTypePane(){
return this.typePane;
}
public Chart getDefaultChart() { public Chart getDefaultChart() {
return BarIndependentChart.barChartTypes[0]; return BarIndependentChart.barChartTypes[0];
} }

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 "";
}
}

2
designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java

@ -50,7 +50,7 @@ public class XCheckBoxGroup extends XFieldEditor {
new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive")) new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class),
new CRPropertyDescriptor("chooseAll", this.data.getClass()).setI18NName( new CRPropertyDescriptor("chooseAll", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Provide", "Choose_All"})).putKeyValue( Inter.getLocText("FR-Designer_Provide_Choose_All")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName( new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class) Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class)

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;

9
designer_form/src/com/fr/design/mainframe/JForm.java

@ -528,18 +528,21 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
@Override @Override
protected void applyUndoState(FormUndoState u) { protected void applyUndoState(FormUndoState u) {
try { try {
//JForm的target重置
this.setTarget((Form) u.getForm().clone());
if (this.index == FORM_TAB) { if (this.index == FORM_TAB) {
//JForm的target重置
this.setTarget((Form) u.getForm().clone());
JForm.this.refreshRoot(); JForm.this.refreshRoot();
this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue()); this.formDesign.getArea().setAreaSize(u.getAreaSize(), u.getHorizontalValue(), u.getVerticalValue(), u.getWidthValue(), u.getHeightValue(), u.getSlideValue());
//撤销的时候要重新选择的body布局 //撤销的时候要重新选择的body布局
this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(),
formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()}));
} else { } else {
// 只在报表块里撤销是不需要修改外部form对象的, 因为编辑的是当前报表块.
// 修改了JForm的Target需要同步修改formDesign的Target.
Form undoForm = (Form) u.getForm().clone();
String widgetName = this.formDesign.getElementCaseContainerName(); String widgetName = this.formDesign.getElementCaseContainerName();
//这儿太坑了,u.getForm() 与 getTarget内容不一样 //这儿太坑了,u.getForm() 与 getTarget内容不一样
FormElementCaseProvider dataTable = getTarget().getElementCaseByName(widgetName); FormElementCaseProvider dataTable = undoForm.getElementCaseByName(widgetName);
this.reportComposite.setSelectedWidget(dataTable); this.reportComposite.setSelectedWidget(dataTable);
//下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC //下面这句话是防止撤销之后直接退出编辑再编辑撤销的东西会回来,因为撤销不会保存EC
formDesign.setElementCase(dataTable); formDesign.setElementCase(dataTable);

Loading…
Cancel
Save