Browse Source

Merge remote-tracking branch 'origin/release/9.0' into release/9.0

master
juhaoyu 7 years ago
parent
commit
b8633dab4a
  1. 2
      build.performance.gradle
  2. 73
      designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java
  3. 4
      designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java
  4. 1
      designer/src/com/fr/design/mainframe/JWorkBook.java
  5. 28
      designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  6. BIN
      designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif
  7. 2
      designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java
  8. 100
      designer/src/com/fr/design/report/ReportBackgroundPane.java
  9. 2
      designer/src/com/fr/design/report/ReportExportAttrPane.java
  10. 101
      designer/src/com/fr/design/report/VerifierListPane.java
  11. 2
      designer/src/com/fr/design/webattr/WriteWebSettingPane.java
  12. 8
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  13. 7
      designer/src/com/fr/grid/IntelliElements.java
  14. 5
      designer/src/com/fr/start/Designer.java
  15. 7
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  16. 5
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  17. 12
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  18. 27
      designer_base/src/com/fr/design/gui/controlpane/AbstractNameableCreator.java
  19. 17
      designer_base/src/com/fr/design/gui/controlpane/NameableCreator.java
  20. 3
      designer_base/src/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  21. 5
      designer_base/src/com/fr/design/gui/ilable/UILabel.java
  22. 6
      designer_base/src/com/fr/design/mainframe/loghandler/DesignerLogImpl.java
  23. 3
      designer_base/src/com/fr/design/mainframe/loghandler/LogDetailPane.java
  24. 45
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java
  25. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  26. 2
      designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java
  27. 61
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  28. 56
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  29. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  30. 47
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  31. 347
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  32. 13
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  33. 42
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java
  34. 2
      designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java
  35. 4
      designer_form/src/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  36. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  37. 2
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java
  38. 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}/chart/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}/servlet-api.jar",dest:"./tmp")

73
designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java

@ -6,24 +6,39 @@ package com.fr.design.actions.insert.flot;
import com.fr.base.BaseUtils;
import com.fr.base.DynamicUnitList;
import com.fr.base.Formula;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.design.report.SelectImagePane;
import com.fr.general.Inter;
import com.fr.grid.Grid;
import com.fr.grid.selection.FloatSelection;
import com.fr.report.ReportHelper;
import com.fr.report.cell.FloatElement;
import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.stable.unit.FU;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
/**
* Insert formula.
*/
public class FormulaFloatAction extends AbstractShapeAction {
public class FormulaFloatAction extends ElementCaseAction {
private boolean returnValue = false;
public FormulaFloatAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(FLOAT_INSERT_FORMULA);
@ -49,23 +64,6 @@ public class FormulaFloatAction extends AbstractShapeAction {
}
};
/**
* 动作
*
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
ElementCasePane jws = getEditingComponent();
if (jws == null) {
return;
}
//
FloatElement floatElement = new FloatElement(new Formula(""));
this.startDraw(floatElement);
doWithDrawingFloatElement();
jws.getGrid().startEditing();
}
private void doWithDrawingFloatElement() {
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
Grid grid = jws.getGrid();
@ -95,4 +93,43 @@ public class FormulaFloatAction extends AbstractShapeAction {
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
}
/**
* 执行动作
*
* @return 成功返回true
*/
@Override
public boolean executeActionReturnUndoRecordNeeded() {
final ElementCasePane reportPane = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (reportPane == null) {
return false;
}
reportPane.stopEditing();
final FloatElement floatElement = new FloatElement();
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(new Formula(StringUtils.EMPTY));
BasicDialog dialog = formulaPane.showLargeWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
floatElement.setValue(formulaPane.update());
if (reportPane == null) {
return;
}
reportPane.getGrid().setDrawingFloatElement(floatElement);
doWithDrawingFloatElement();
returnValue = true;
}
@Override
public void doCancel() {
returnValue = false;
}
});
dialog.setVisible(true);
return returnValue;
}
}

4
designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java

@ -54,6 +54,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
*
* @param e 动作
*/
@Override
public void actionPerformed(ActionEvent e) {
ElementCasePane jws = getEditingComponent();
if (jws == null) {
@ -67,7 +68,7 @@ public class TextBoxFloatAction extends AbstractShapeAction {
private void doWithDrawingFloatElement() {
ElementCasePane jws = (ElementCasePane) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
;
Grid grid = jws.getGrid();
ElementCasePane reportPane = grid.getElementCasePane();
@ -93,5 +94,6 @@ public class TextBoxFloatAction extends AbstractShapeAction {
report.addFloatElement(grid.getDrawingFloatElement());
reportPane.setSelection(new FloatSelection(grid.getDrawingFloatElement().getName()));
reportPane.fireTargetModified();
}
}

1
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -399,7 +399,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setJTemplateResolution(resolution);
polyDezi.updateUI();
}
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().fireTargetModified();
}
@Override

28
designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -670,6 +670,8 @@ public class AlphaFineDialog extends UIDialog {
searchTextField.setText(null);
removeSearchResult();
}
} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
dealWithSearchResult(searchResultList.getSelectedValue());
}
}
});
@ -694,6 +696,15 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 处理搜索结果
* @param selectedValue
*/
private void dealWithSearchResult(AlphaCellModel selectedValue) {
doNavigate();
saveLocalHistory(selectedValue);
}
/**
* 当鼠标在搜索界面边界外点击时触发
*/
@ -725,6 +736,9 @@ public class AlphaFineDialog extends UIDialog {
//不处理
}
/**
* 导航到结果页面
*/
private void doNavigate() {
AlphaFineDialog.this.dispose();
final AlphaCellModel model = searchResultList.getSelectedValue();
@ -732,15 +746,15 @@ public class AlphaFineDialog extends UIDialog {
}
/**
* 保存本地本地常用
* 保存结果到本地本地常用
*
* @param cellModel
*/
private void saveHistory(AlphaCellModel cellModel) {
private void saveLocalHistory(AlphaCellModel cellModel) {
RecentSearchManager recentSearchManager = RecentSearchManager.getRecentSearchManger();
recentSearchManager.addRecentModel(storeText, cellModel);
recentSearchManager.saveXMLFile();
sendToServer(storeText, cellModel);
sendDataToServer(storeText, cellModel);
}
@ -750,7 +764,7 @@ public class AlphaFineDialog extends UIDialog {
* @param searchKey
* @param cellModel
*/
private void sendToServer(String searchKey, AlphaCellModel cellModel) {
private void sendDataToServer(String searchKey, AlphaCellModel cellModel) {
if (cellModel.isNeedToSendToServer()) {
String username = ConfigManager.getProviderInstance().getBbsUsername();
String uuid = DesignerEnvManager.getEnvManager().getUUID();
@ -908,8 +922,7 @@ public class AlphaFineDialog extends UIDialog {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
doNavigate();
saveHistory(getSelectedValue());
dealWithSearchResult(getSelectedValue());
} else if (e.getKeyCode() == KeyEvent.VK_UP) {
if (getSelectedIndex() == 1) {
searchTextField.requestFocus();
@ -926,8 +939,7 @@ public class AlphaFineDialog extends UIDialog {
int selectedIndex = getSelectedIndex();
AlphaCellModel selectedValue = getSelectedValue();
if (e.getClickCount() == 2 && selectedValue.hasAction()) {
doNavigate();
saveHistory(selectedValue);
dealWithSearchResult(selectedValue);
} else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);

BIN
designer/src/com/fr/design/mainframe/alphafine/images/bigloading.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 19 KiB

2
designer/src/com/fr/design/mainframe/alphafine/search/manager/RecommendSearchManager.java

@ -16,6 +16,7 @@ import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.CodeUtils;
import com.fr.stable.StringUtils;
import java.util.Iterator;
import java.util.List;
@ -37,6 +38,7 @@ public class RecommendSearchManager implements AlphaFineSearchProcessor {
@Override
public synchronized SearchResult getLessSearchResult(String searchText) {
searchText = searchText.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
this.modelList = new SearchResult();
this.recommendModelList = new SearchResult();
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) {

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

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

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

@ -56,7 +56,7 @@ public class WriteWebSettingPane extends WebSettingPane<WebWrite> {
//sheet标签页显示位置
topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
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();
bottomRadioButton.setSelected(true);
buttonGroup.add(topRadioButton);

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

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

@ -194,7 +194,12 @@ public class IntelliElements {
TemplateCellElement newCellElement = new DefaultTemplateCellElement(colIndex, rowIndex);
applyStyle(newCellElement, sourceCellElement);//style
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.setCellExpandAttr(sourceCellElement.getCellExpandAttr());
} else if (sourceCellElement.getValue() instanceof Number) {

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

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

@ -36,8 +36,12 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
@Override
public void itemStateChanged(ItemEvent e) {
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem();
if (tableDataWrapper == null) {
return;
}
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList();
List<String> nameList = tableDataWrapper.calculateColumnNameList();
columnNames = new String[nameList.size()];
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames);
columnNameComboBox.removeAllItems();
@ -64,7 +68,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
dsColumn.setDsName(tableDataWrappe.getTableDataName());
TableDataColumn column;
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);
Pattern pattern = Pattern.compile("[^\\d]");
if (pattern.matcher(number).find()) {
@ -80,6 +84,10 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> {
return dsColumn;
}
private boolean checkColumnExp (String columnExp) {
return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#");
}
public String getIconName() {
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.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.js.JavaScript;
import javax.swing.*;
@ -14,7 +15,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
protected Class clazzOfObject;
protected Class clazzOfInitCase;
protected Class<? extends BasicBeanPane> clazzOfEditor;
public AbstractNameableCreator(String menuName, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.clazzOfObject = clazz;
@ -28,7 +29,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfObject = clazz;
this.clazzOfInitCase = clazz;
}
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath);
@ -36,7 +37,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
this.clazzOfEditor = clazzOfEditor;
this.clazzOfInitCase = clazz;
}
public AbstractNameableCreator(String menuName, String iconPath, Class clazz, Class clazz4Init, Class<? extends BasicBeanPane> clazzOfEditor) {
this.menuName = menuName;
this.menuIcon = BaseUtils.readIcon(iconPath);
@ -50,7 +51,7 @@ public abstract class AbstractNameableCreator implements NameableCreator {
* get menuName
* @return
*/
public String menuName() {
public String menuName() {
return this.menuName;
}
@ -70,6 +71,14 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return this.clazzOfEditor;
}
/**
* get clazzOfObject
* @return clazzOfObject
*/
public Class <? extends JavaScript> getHyperlink() {
return this.clazzOfObject;
}
/**
*
* @param ob
@ -83,12 +92,12 @@ public abstract class AbstractNameableCreator implements NameableCreator {
doSthChanged4Icon(ob);
return ob;
}
return null;
}
protected void doSthChanged4Icon(Object ob){
}
/**
@ -99,9 +108,9 @@ public abstract class AbstractNameableCreator implements NameableCreator {
return null;
}
public boolean isNeedParameterWhenPopulateJControlPane(){
return false;
}
public boolean isNeedParameterWhenPopulateJControlPane(){
return false;
}
public boolean equals(Object obj) {
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.gui.ilist.ListModelElement;
import com.fr.js.JavaScript;
import com.fr.stable.Nameable;
import javax.swing.*;
public interface NameableCreator {
public String menuName();
public Icon menuIcon();
public String createTooltip();
public Nameable createNameable(UnrepeatedNameHelper helper);
public Class<? extends BasicBeanPane> getUpdatePane();
public Class <? extends JavaScript> getHyperlink();
public Object acceptObject2Populate(Object ob);
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() {
Dimension dimension = new Dimension();
dimension.height = super.getPreferredSize().height;
dimension.width = addButton.getWidth() - 2;
// 不能写死,否则出现国际化显示不全的问题
dimension.width = Math.max(addButton.getWidth() - 2, super.getPreferredSize().width);
return dimension;
}
};

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

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

@ -1,6 +1,7 @@
package com.fr.design.mainframe.loghandler;
import com.fr.stable.fun.impl.AbstractLogProvider;
import com.fr.stable.web.SessionProvider;
import com.fr.stable.xml.LogRecordTimeProvider;
import java.util.ArrayList;
@ -43,4 +44,9 @@ public class DesignerLogImpl extends AbstractLogProvider{
public void record(LogRecordTimeProvider 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.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
public class LogDetailPane extends JPanel{
public LogDetailPane() {
@ -20,7 +21,7 @@ public class LogDetailPane extends JPanel{
fr.setSize(600, 400);
GUICoreUtils.centerWindow(fr);
fr.setResizable(false);
fr.setTitle("日志");
fr.setTitle(Inter.getLocText("FR-Designer_Log"));
fr.setIconImage(BaseUtils.readImageWithCache("com/fr/design/images/buttonicon/history.png"));
fr.getContentPane().setLayout(new BorderLayout());
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;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
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.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.chart.chartglyph.MapShapeValue;
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.ChangeListener;
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.UITableNoOptionUI;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.CoreGraphHelper;
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));
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);
return boxPane;
}
@ -111,34 +111,9 @@ public class DataLabelPane extends TooltipContentsPane {
}
protected JPanel createJPanel4Position() {
// 标签位置:上下左右中.
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;
return null;
}
public void populate(AttrContents seriesAttrContents) {
super.populate(seriesAttrContents);
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);
}
};
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
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.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
@ -30,11 +31,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
public MiddleChartPropertyPane() {
initComponenet();
}
protected void initComponenet() {
this.setLayout(new BorderLayout());
this.setBorder(null);
createNameLabel();
this.add(createNorthComponent(), BorderLayout.NORTH);
chartEditPane = StableUtils.construct(ChartEditPane.class);
@ -47,11 +48,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
this.createMainPane();
setSureProperty();
}
protected abstract void createNameLabel();
protected abstract JComponent createNorthComponent();
protected abstract void createMainPane();
@ -64,10 +65,10 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener);
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();
}
protected void resetChartEditPane() {
remove(chartEditPane);
add(chartEditPane, BorderLayout.CENTER);
@ -75,20 +76,20 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
repaint();
revalidate();
}
protected TitleChangeListener titleListener = new TitleChangeListener() {
@Override
public void fireTitleChange(String addName) {
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName);
}
};
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) {
addChartEditPane(collection.getSelectedChart().getPlot().getPlotID());
setSupportCellData(true);
@ -96,11 +97,11 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
chartEditPane.populate(collection);
}
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> ePane) {
if (collection instanceof ChartCollection) {
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 定位
*/
/**
* 预定义定位
* @return 定位
*/
public Location preferredLocation() {
return Location.WEST_BELOW;
}
/**
* 创建标题Panel
* @return 标题panel
*/
/**
* 创建标题Panel
* @return 标题panel
*/
public UITitlePanel createTitlePanel() {
return new UITitlePanel(this);
}
@ -148,14 +149,14 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
*/
public void refreshDockingView() {
// TODO Auto-generated method stub
}
/**
* 设置是否支持单元格数据.
*/
public void setSupportCellData(boolean supportCellData) {
if(chartEditPane != null) {
if (chartEditPane != null) {
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.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -30,7 +31,7 @@ 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, Prepare4DataSourceChange, ChartEditPaneProvider {
private final static int CHANGE_MIN_TIME = 80;
@ -118,7 +119,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();
}
@ -129,10 +130,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());
@ -140,22 +142,22 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
addTypePane();
boolean isDefault = true;
String plotID = "";
if(currentChart.getPlot() != null){
String plotID = StringUtils.EMPTY;
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]);
}
@ -177,6 +179,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
protected void setSelectedTab() {
//doNothing
}
/**
@ -222,7 +225,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
return;
}
if(checkNeedsReLayout(collection.getSelectedChart())){
if (isNeedsReLayout(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;
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;
}
}
@ -263,12 +266,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
}
//populate的时候看看要不要重构面板
private boolean checkNeedsReLayout(Chart chart){
if(chart != null){
private boolean isNeedsReLayout(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);
}
@ -279,9 +282,10 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
/**
* 当前界面是否是默认的界面
*
* @return 是否是默认的界面
*/
public boolean isDefaultPane(){
public boolean 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 是否来自工具栏
*/
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() {
public void stateChanged(ChangeEvent e) {
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.ItemEventType;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
@ -238,6 +239,9 @@ public class ChartTypePane extends AbstractChartAttrPane{
for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(ob)) {
GUICoreUtils.setEnabled(chartTypeComBox.getUIComboBox(), ob.isValidPlot());
pane.populateBean(ob);
Object item = pane.title4PopupWindow();
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.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -41,7 +42,11 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private UIButton addButton;
private UIObserverListener uiobListener = null;
public List<UIComboBox> getBoxList() {
return boxList;
}
public CategoryPlotMoreCateTableDataContentPane() {
// do nothing
}
@ -89,8 +94,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
checkAddButton();
checkComponent();
}
});
}
@ -129,15 +134,15 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
buttonPane.add(delButton);
boxPane.add(buttonPane);
boxList.add(combox);
checkAddButton();
checkComponent();
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane);
boxList.remove(combox);
checkAddButton();
checkComponent();
relayoutPane();
}
});
@ -150,6 +155,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
int size = boxList.size();
addButton.setEnabled(size < 2 && categoryCombox.getSelectedItem() != null);
}
protected void checkComponent() {
checkAddButton();
}
private void relayoutPane() {
this.revalidate();
@ -162,8 +171,8 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/
public void checkBoxUse(boolean hasUse) {
super.checkBoxUse(hasUse);
checkAddButton();
checkComponent();
}
protected void refreshBoxListWithSelectTableData(List list) {
@ -221,17 +230,23 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
*/
public void updateBean(ChartCollection collection) {
super.updateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if(top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition)top;
Plot plot = collection.getSelectedChart().getPlot();
if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
normal.clearMoreCate();
for(int i = 0, size = boxList.size(); i < size; i++) {
UIComboBox box = boxList.get(i);
if(box.getSelectedItem() != null) {
normal.addMoreCate(box.getSelectedItem().toString());
}
updateMoreCate(normal, plot);
}
}
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.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.javascript.ChartEmailPane;
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.event.UIObserver;
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.UICorrelationComboBoxPane;
import com.fr.design.gui.ibutton.UIButton;
@ -53,9 +56,10 @@ import java.text.DecimalFormat;
import java.text.Format;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
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 gisMap = 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 UICheckBox isChartAnimation;// 动态
private UICheckBox isChartAnimation;// 动态
private UICheckBox isSeriesDragEnable; //系列拖拽
private UICheckBox isAxisZoom;// 缩放
private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat;
private UICheckBox isDatapointValue;// 数据点提示
private UIButton dataPointValueFormat;
private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat;
private UICheckBox isDatapointPercent;
private UIButton dataPointPercentFormat;
private UILabel tooltipStyleLabel;
private UIComboBox tooltipStyle;
@ -90,55 +94,55 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private UICheckBox isAddress;
private UICheckBox isAddressName;
private UICheckBox isAxisShowToolTip;// 坐标轴提示
private UICheckBox isAxisShowToolTip;// 坐标轴提示
protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime;
protected UICheckBox isAutoRefresh;// 自动刷新
protected UISpinner autoRefreshTime;
private UICorrelationComboBoxPane superLink;// 超链
private UICorrelationComboBoxPane superLink;// 超链
private FormatPane valueFormatPane;
private FormatPane percentFormatPane;
private Format valueFormat;
private Format percentFormat;
private FormatPane valueFormatPane;
private FormatPane percentFormatPane;
private Format valueFormat;
private Format percentFormat;
private JPanel tooltipPane;
private JPanel axisShowPane;
private JPanel autoRefreshPane;
private JPanel superlinkPane;
private JPanel tooltipPane;
private JPanel axisShowPane;
private JPanel autoRefreshPane;
private JPanel superlinkPane;
private ChartOtherPane parent;
private ChartOtherPane parent;
private UICheckBox timeSwitch;
private JPanel timeSwitchContainer;
private TimeSwitchPane timeSwitchPane;
private static final int SIZEX = 258;
private static final int SIZEY = 209;
private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
}
private static final int SIZEX = 258;
private static final int SIZEY = 209;
private static final int DET = 20;
public ChartInteractivePane(ChartOtherPane parent) {
super();
this.parent = parent;
}
/**
* 界面标题.
/**
* 界面标题.
* @return 返回标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab");
}
@Override
protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-Interactive_Tab");
}
@Override
protected JPanel createContentPane() {
isChartAnimation = new UICheckBox(Inter.getLocText("Chart-Animation_JSShow"));
isSeriesDragEnable = new UICheckBox(Inter.getLocText("Chart-Series_Drag"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointValue = new UICheckBox(Inter.getLocText("Chart-Use_Value"));
dataPointValueFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
isDatapointPercent = new UICheckBox(Inter.getLocText("Chart-Value_Percent"));
dataPointPercentFormat = new UIButton(Inter.getLocText("Chart-Use_Format"));
tooltipStyle = new UIComboBox(new String []{Inter.getLocText("Chart-White_Black"), Inter.getLocText("Chart-Black_White")});
tooltipStyleLabel = new UILabel(Inter.getLocText("Chart-Style_Name"));
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"));
isAddressName = new UICheckBox(Inter.getLocText("Chart-Address_Name"));
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane();
isAxisShowToolTip = new UICheckBox(Inter.getLocText("Chart-Interactive_AxisTooltip"));
isAxisZoom = new UICheckBox(Inter.getLocText("Chart-Use_Zoom"));
isAutoRefresh = new UICheckBox(Inter.getLocText(new String[]{"Chart-Use_Auto", "Chart-Use_Refresh"}));
autoRefreshTime = new UISpinner(1, Integer.MAX_VALUE, 1);
superLink = new UICorrelationComboBoxPane();
isAutoRefresh.addActionListener(new ActionListener() {
isAutoRefresh.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkAutoRefresh();
@ -162,9 +166,9 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
});
timeSwitch = new UICheckBox(Inter.getLocText("FR-Chart-Interactive_timeSwitch"));
timeSwitchPane = new TimeSwitchPane();
initFormatListener();
return initPaneWithListener();
}
initFormatListener();
return initPaneWithListener();
}
private void initFormatListener() {
@ -240,19 +244,19 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
});
}
private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
}
/**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return
*/
private JPanel initPaneWithListener() {
initDataPointToolTipPane();
initAxisShowPane();
initAutoRefreshPane();
initSuperlinkPane();
private void checkAutoRefresh() {
GUICoreUtils.setEnabled(autoRefreshTime, isAutoRefresh.isSelected());
}
/**
* 反正后面还有relayout,这边init一下就好了 保证所有的init 加入界面 并且加载入事件.
* @return
*/
private JPanel initPaneWithListener() {
initDataPointToolTipPane();
initAxisShowPane();
initAutoRefreshPane();
initSuperlinkPane();
initTimeSwitchPane();
@ -271,7 +275,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
};
//初始化界面时 加载事件
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
}
private void initTimeSwitchPane(){
timeSwitchContainer = new JPanel(new BorderLayout());
@ -283,11 +287,11 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
/**
* 全部初始化, 对所有的界面 都加入, 然后会加载事件响应. 后续再relayout.
*/
private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p};
private void initDataPointToolTipPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
@ -298,7 +302,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
new Component[]{tooltipStyleLabel, tooltipStyle}
};
tooltipPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartData-Tooltip"},components, rowSize, columnSize);
}
}
private void relayoutDataPointToolTipPane(Plot plot) {
double p = TableLayout.PREFERRED;
@ -333,8 +337,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
} else {
rowSize = new double[]{p, p, p};
components = new Component[][]{
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
new Component[]{isDatapointValue, dataPointValueFormat},
new Component[]{isDatapointPercent, dataPointPercentFormat},
getTooltipStyleComponent()
};
}
@ -370,49 +374,49 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[] {TableLayoutHelper.createTableLayoutPane(newComponents, newRowSize, newColumnSize), null};
}
private void initAxisShowPane() {
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip},
};
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
}
private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p};
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)},
private void initAxisShowPane() {
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{p};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{isAxisShowToolTip},
};
axisShowPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ChartF-Axis", "Chart-Interactive"},components, rowSize, columnSize);
}
private void initAutoRefreshPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p,p};
Component[][] components = new Component[][]{
new Component[]{isAutoRefresh,null},
new Component[]{GUICoreUtils.createFlowPane(new Component[]{
new UILabel(Inter.getLocText("Chart-Time_Interval")),
autoRefreshTime,
new UILabel(Inter.getLocText("Chart-Time_Seconds"))
}, 1)},
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);
}
private void initSuperlinkPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{superLink, null},
};
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
}
private void relayoutWithPlot(Plot plot) {
this.removeAll();
double p = TableLayout.PREFERRED;
};
autoRefreshPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Data-Check"},components, rowSize, columnSize);
}
private void initSuperlinkPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{superLink, null},
};
superlinkPane = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"Hyperlink"},components, rowSize, columnSize);
}
private void relayoutWithPlot(Plot plot) {
this.removeAll();
double p = TableLayout.PREFERRED;
double[] columnSize = new double[]{TableLayout.FILL};
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};
reloaPane(TableLayoutHelper.createTableLayoutPane(components, row, columnSize));
}
}
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);
if(timeSwitch.isSelected()){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] rowSize = new double[]{p};
double f = TableLayout.FILL;
double[] columnSize = new double[]{TIME_SWITCH_GAP,f};
double[] rowSize = new double[]{p};
Component[][] components = new Component[][]{
new Component[]{null, timeSwitchPane},
};
@ -523,15 +527,15 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
return new Component[]{superlinkPane};
}
@Override
public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
@Override
public void populateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
Plot plot = chart.getPlot();
Plot plot = chart.getPlot();
relayoutWithGis(chart, plot);
relayoutWithPlot(plot);
relayoutWithPlot(plot);
populateChartAnimate(chart, plot);
populateChartScale(plot);
@ -540,8 +544,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
populateAutoRefresh(chart);
populateHyperlink(plot);
checkAutoRefresh();
}
checkAutoRefresh();
}
private void relayoutWithGis(Chart chart, Plot plot) {
if(plot.isSupportAddress4Gis()) {
@ -579,7 +583,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
timeSwitch.setEnabled(false);
//只有坐标轴为时间坐标轴,并且勾选了图表缩放的时候,才支持时间切换
if(!plot.isSupportZoomCategoryAxis() || !isAxisZoom.isSelected()){
return;
return;
}
if(plot.getxAxis() ==null && !plot.getxAxis().isDate()){
@ -655,6 +659,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private void populateHyperlink(Plot 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);
superLink.refreshMenuAndAddMenuAction(list);
@ -672,13 +683,13 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
superLink.doLayout();
}
@Override
public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
@Override
public void updateBean(Chart chart) {
if (chart == null || chart.getPlot() == null) {
return;
}
Plot plot = chart.getPlot();
Plot plot = chart.getPlot();
updateChartAnimate(chart, plot);
updateChartScale(plot);
@ -686,7 +697,7 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
updateAxisTip(plot);
updateAutoRefresh(plot);
updateHyperlink(plot);
}
}
private void updateChartAnimate(Chart chart, Plot plot) {
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){
return (Class<? extends BasicBeanPane>)map.get(key);
}
@ -832,33 +843,33 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
}
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)));
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_Mail"), new EmailJavaScript(), ChartEmailPane.class));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Web"),
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)));
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)));
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"),
list.add(new UIMenuNameableCreator(Inter.getLocText("Chart-Link_Cell"),
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)));
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"),
hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list;
}
hyperlink, getUseMap(map, FormHyperlinkProvider.class)));
return list;
}
private HashMap renewMapWithPlot(Plot plot) {
if(plot instanceof PiePlot) {
@ -1021,8 +1032,8 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private HashMap getNormalPlotHyperMap() {
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(EmailJavaScript.class, ChartEmailPane.class);
normalMap.put(WebHyperlink.class, WebHyperlinkPane.CHART.class);
@ -1041,27 +1052,27 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
}
return normalMap;
}
@Override
public Chart updateBean() {
return null;
}
@Override
public Chart updateBean() {
return null;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(UIObserverListener listener) {
timeSwitch.registerChangeListener(listener);
timeSwitchPane.registerChangeListener(listener);
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
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 JPanel stylePane; //样式布局的面板
private JPanel typePane;
protected abstract String[] getTypeIconPath();
protected abstract String[] getTypeTipName();
protected abstract String[] getTypeLayoutPath();
@ -70,10 +71,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
checkDemosBackground();
JPanel typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
this.typePane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(4);
for(int i = 0; i < typeDemo.size(); i++) {
ChartImagePane tmp = typeDemo.get(i);
typePane.add(tmp);
this.typePane.add(tmp);
tmp.setDemoGroup(typeDemo.toArray(new ChartSelectDemoPane[typeDemo.size()]));
}
@ -99,7 +100,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
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.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;
}
@ -586,6 +587,10 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
&& chart.getPlot().getPlotStyle() != ChartConstants.STYLE_NONE;
}
protected JPanel getTypePane(){
return this.typePane;
}
public Chart getDefaultChart() {
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"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class),
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"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
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;
}
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;

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

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

Loading…
Cancel
Save