Browse Source

Merge pull request #519 in BA/design from ~NEIL/design:release to master

* commit '66766b87e10a6fcb968bf94d0cdef1ccefcd3cd5': (244 commits)
  ct
  ct
  ct
  无JIRA任务 组件共享支持远程安装删除
  无JIRA任务 用了非法的依赖关系,先写死再整理
  无JIRA任务 组件共享远程切换同步到release
  rt
  populate之前init面板让组件没有listener。typepane先和stylepane逻辑统一,dev里面我不init面板,只是把所有listener remove掉,这样比较合理
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  rt
  ...
master
neil 8 years ago
parent
commit
325be3563d
  1. 0
      build.dev.gradle
  2. 85
      build.release.gradle
  3. 85
      build.release.gradle.bak
  4. 2
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  5. 2
      designer/src/com/fr/design/mainframe/JWorkBook.java
  6. 5
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  7. 33
      designer/src/com/fr/design/module/DesignerModule.java
  8. 4
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  9. 6
      designer/src/com/fr/design/webattr/EditToolBar.java
  10. 39
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  11. 6
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  12. 2
      designer/src/com/fr/poly/creator/ChartBlockCreator.java
  13. 18
      designer/src/com/fr/quickeditor/ChartQuickEditor.java
  14. 23
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  15. 70
      designer_base/build.dev.gradle
  16. 70
      designer_base/build.release.gradle
  17. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  18. 36
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  19. 2
      designer_base/src/com/fr/design/actions/file/LocalePane.java
  20. 6
      designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java
  21. 5
      designer_base/src/com/fr/design/condition/LiteConditionPane.java
  22. 2
      designer_base/src/com/fr/design/constants/KeyWords.java
  23. 28
      designer_base/src/com/fr/design/data/BasicTableDataTreePane.java
  24. 34
      designer_base/src/com/fr/design/data/DesignTableDataManager.java
  25. 1
      designer_base/src/com/fr/design/data/datapane/TableDataComboBox.java
  26. 29
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  27. 10
      designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  28. 37
      designer_base/src/com/fr/design/event/TemplateTreeDragSource.java
  29. 19
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  30. 1
      designer_base/src/com/fr/design/extra/PluginHelper.java
  31. 11
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  32. 49
      designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java
  33. 6
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  34. 2
      designer_base/src/com/fr/design/file/MutilTempalteTabPane.java
  35. 2
      designer_base/src/com/fr/design/formula/VariableResolverAdapter.java
  36. 4
      designer_base/src/com/fr/design/fun/ElementUIProvider.java
  37. 5
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java
  38. 35
      designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java
  39. 51
      designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java
  40. 4
      designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java
  41. 13
      designer_base/src/com/fr/design/gui/chart/ChartEditPaneProvider.java
  42. 94
      designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
  43. 24
      designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java
  44. 12
      designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java
  45. 6
      designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java
  46. 70
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  47. 3
      designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java
  48. 4
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
  49. 2
      designer_base/src/com/fr/design/icon/IconPathConstants.java
  50. BIN
      designer_base/src/com/fr/design/images/buttonicon/config.png
  51. BIN
      designer_base/src/com/fr/design/images/control/help_close.png
  52. BIN
      designer_base/src/com/fr/design/images/control/help_open.png
  53. 3
      designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt
  54. 3
      designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt
  55. 34
      designer_base/src/com/fr/design/layout/TableLayoutHelper.java
  56. 13
      designer_base/src/com/fr/design/mainframe/HelpDialogHandler.java
  57. 38
      designer_base/src/com/fr/design/mainframe/HelpDialogManager.java
  58. 23
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  59. 2
      designer_base/src/com/fr/design/module/DesignModuleFactory.java
  60. 8
      designer_base/src/com/fr/design/selection/QuickEditor.java
  61. 107
      designer_base/src/com/fr/env/RemoteEnv.java
  62. 2
      designer_base/src/com/fr/start/BaseDesigner.java
  63. 66
      designer_chart/build.dev.gradle
  64. 66
      designer_chart/build.release.gradle
  65. 334
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  66. 2
      designer_chart/src/com/fr/design/chart/ChartPlotFactory.java
  67. 2
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  68. 4
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  69. 4
      designer_chart/src/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java
  70. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java
  71. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java
  72. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java
  73. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java
  74. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSeriesAttrAction.java
  75. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSheetAction.java
  76. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java
  77. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java
  78. 4
      designer_chart/src/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java
  79. 7
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapCustomPane.java
  80. 13
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  81. 29
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/TooltipContentsPane.java
  82. 15
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java
  83. 13
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/FunnelDataLabelPane.java
  84. 18
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MapDataLabelPane.java
  85. 4
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java
  86. 28
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FunnelPlotDataSeriesConditionPane.java
  87. 6
      designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java
  88. 143
      designer_chart/src/com/fr/design/mainframe/ChartAndWidgetPropertyPane.java
  89. 34
      designer_chart/src/com/fr/design/mainframe/ChartDesigner.java
  90. 134
      designer_chart/src/com/fr/design/mainframe/ChartDesignerPropertyPane.java
  91. 7
      designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java
  92. 47
      designer_chart/src/com/fr/design/mainframe/ChartUndoState.java
  93. 376
      designer_chart/src/com/fr/design/mainframe/JChart.java
  94. 16
      designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java
  95. 132
      designer_chart/src/com/fr/design/mainframe/actions/AbstractExportAction4JChart.java
  96. 68
      designer_chart/src/com/fr/design/mainframe/actions/ExcelExportAction4Chart.java
  97. 21
      designer_chart/src/com/fr/design/mainframe/actions/JChartAction.java
  98. 61
      designer_chart/src/com/fr/design/mainframe/actions/NewChartAction.java
  99. 65
      designer_chart/src/com/fr/design/mainframe/actions/PDFExportAction4Chart.java
  100. 66
      designer_chart/src/com/fr/design/mainframe/actions/PNGExportAction4Chart.java
  101. Some files were not shown because too many files have changed in this diff Show More

0
build.master.gradle → build.dev.gradle

85
build.release.gradle

@ -0,0 +1,85 @@
apply plugin: "java"
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable/master"
//
FileTree files =fileTree(dir:"./",include:"build.*.gradle")
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\"))
def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1)
task appletJar<<{
ant{
mkdir(dir:"${libDir}/tmp-${branchName}")
mkdir(dir:"build/classes/")
copy(todir:"build/classes/"){
fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main")
}
unjar(src:"${libDir}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){
exclude(name:"*.*")
exclude(name:"bin/*.*")
exclude(name:"classes/**")
exclude(name:"com/fr/schedule/**")
exclude(name:"com/fr/cell/**")
exclude(name:"com/fr/dialog/**")
exclude(name:"com/fr/view/**")
exclude(name:"com/fr/web/**")
exclude(name:"com/fr/fs/**")
exclude(name:"com/fr/design/**")
exclude(name:"com/fr/start/**")
exclude(name:"com/fr/process/**")
}
fileset(dir:"${libDir}/tmp-${branchName}"){
include(name:"javax/mail/**")
include(name:"javax/servlet/**")
include(name:"org/freehep/**")
include(name:"com/fr/third/JAI/**")
include(name:"com/fr/third/antlr/**")
include(name:"com/fr/third/javax/**")
include(name:"com/sun/xml/**")
include(name:"javax/xml/**")
}
fileset(dir:"build/classes"){
include(name:"com/fr/web/*.class")
include(name:"com/fr/web/attr/*.class")
}
}
delete(dir:"${libDir}/tmp-${branchName}")
def jdk6home= "D:/FineReport/develop/java/jdk1.6u35"
def keystore="frapplet.store"
def keycert="fr.cert"
def keypassword="123456"
def keyalias="fr"
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-genkey -dname &quot;CN=FineReport L=NanJing C=China&quot; -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/jarsigner"){
arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}")
}
delete(file:"${keystore}")
delete(file:"${keycert}")
delete(dir:"build/classes")
}
}

85
build.release.gradle.bak

@ -0,0 +1,85 @@
apply plugin: "java"
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable/master"
//
FileTree files =fileTree(dir:"./",include:"build.*.gradle")
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\"))
def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1)
task appletJar<<{
ant{
mkdir(dir:"${libDir}/tmp-${branchName}")
mkdir(dir:"build/classes/")
copy(todir:"build/classes/"){
fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main")
}
unjar(src:"${libDir}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){
exclude(name:"*.*")
exclude(name:"bin/*.*")
exclude(name:"classes/**")
exclude(name:"com/fr/schedule/**")
exclude(name:"com/fr/cell/**")
exclude(name:"com/fr/dialog/**")
exclude(name:"com/fr/view/**")
exclude(name:"com/fr/web/**")
exclude(name:"com/fr/fs/**")
exclude(name:"com/fr/design/**")
exclude(name:"com/fr/start/**")
exclude(name:"com/fr/process/**")
}
fileset(dir:"${libDir}/tmp-${branchName}"){
include(name:"javax/mail/**")
include(name:"javax/servlet/**")
include(name:"org/freehep/**")
include(name:"com/fr/third/JAI/**")
include(name:"com/fr/third/antlr/**")
include(name:"com/fr/third/javax/**")
include(name:"com/sun/xml/**")
include(name:"javax/xml/**")
}
fileset(dir:"build/classes"){
include(name:"com/fr/web/*.class")
include(name:"com/fr/web/attr/*.class")
}
}
delete(dir:"${libDir}/tmp-${branchName}")
def jdk6home= "D:/FineReport/develop/java/jdk1.6u35"
def keystore="frapplet.store"
def keycert="fr.cert"
def keypassword="123456"
def keyalias="fr"
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-genkey -dname &quot;CN=FineReport L=NanJing C=China&quot; -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/jarsigner"){
arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}")
}
delete(file:"${keystore}")
delete(file:"${keycert}")
delete(dir:"build/classes")
}
}

2
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane;
@ -58,6 +59,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (editingTemplate != null && !editingTemplate.isUpMode()) {
EastRegionContainerPane.getInstance().replaceDownPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceUpPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
}
}
});

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

@ -732,6 +732,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
}
} else {
DesignerContext.getDesignerFrame().resetToolkitByPlus(JWorkBook.this);
EastRegionContainerPane.getInstance().removeParameterPane();
if (delegate4ToolbarMenuAdapter() instanceof PolyDesigner) {
PolyDesigner polyDesigner = (PolyDesigner) delegate4ToolbarMenuAdapter();
if (polyDesigner.getSelectionType() == PolyDesigner.SelectionType.NONE || polyDesigner.getSelection() == null) {
@ -752,6 +753,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane());
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
}
centerPane.needToShowCoverAndHidPane();
}

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

@ -18,6 +18,7 @@ import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -99,7 +100,9 @@ public class UserInfoLabel extends UILabel{
}
});
//PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
if (StableUtils.getMajorJavaVersion() == 8) {
PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
}
QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this);
UserLoginContext.addLoginContextListener(new LoginContextListener() {

33
designer/src/com/fr/design/module/DesignerModule.java

@ -111,17 +111,17 @@ public class DesignerModule extends DesignModule {
*/
private void registerCellEditor() {
ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.getInstance());
ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.getInstance());
ActionFactory.registerCellEditor(Formula.class, CellStringQuickEditor.getInstance());
ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.getInstance());
ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.getInstance());
ActionFactory.registerCellEditor(DSColumn.class, CellDScolumnEditor.getInstance());
ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.getInstance());
ActionFactory.registerCellEditor(BiasTextPainter.class, new CellBiasTextPainterEditor());
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.getInstance());
ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.getInstance());
ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(Formula.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class);
ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class);
ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class);
ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.class);
ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class);
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class);
ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.class);
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
for (ElementUIProvider provider : providers) {
@ -139,14 +139,13 @@ public class DesignerModule extends DesignModule {
* kunnat: 注册悬浮选中Editor
*/
private void registerFloatEditor() {
FloatStringQuickEditor floatStringQuickEditor = new FloatStringQuickEditor();
ActionFactory.registerFloatEditor(String.class, floatStringQuickEditor);
ActionFactory.registerFloatEditor(Formula.class, floatStringQuickEditor);
ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class);
ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class);
FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor();
ActionFactory.registerFloatEditor(Image.class, floatImageQuickEditor);
ActionFactory.registerFloatEditor(BufferedImage.class, floatImageQuickEditor);
ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.getInstance());
ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class);
ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class);
ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.class);
}
/**

4
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -20,7 +20,9 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityToolBarPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.*;
import com.fr.design.module.DesignModuleFactory;
@ -244,7 +246,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
isdelayItem.setSelected(reportParameterAttr.isDelayPlaying());
isshowWindowItem.setSelected(reportParameterAttr.isShowWindow());
isEditing = true;
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height);
ParameterBridge bridge = paraDesignEditor.getParaComponent();
if (parameterUI != null) {
bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying());

6
designer/src/com/fr/design/webattr/EditToolBar.java

@ -319,7 +319,7 @@ public class EditToolBar extends BasicPane {
private CardLayout card;
private JPanel centerPane;
private UICheckBox icon, text, pdf, excelP, excelO, excelS, image, word,
flashPrint, pdfPrint, appletPrint, serverPrint, isPopup, isVerify, failSubmit;
flashPrint, pdfPrint, appletPrint, serverPrint, isPopup, isVerify, failSubmit, isCurSheet;
private UIBasicSpinner count;
private Widget widget;
private UITextField nameField;
@ -469,10 +469,12 @@ public class EditToolBar extends BasicPane {
private JPanel getSubmitPane() {
isVerify = new UICheckBox(Inter.getLocText("Verify-Data_Verify"));
failSubmit = new UICheckBox(Inter.getLocText(new String[]{"Verify_Fail", "Still", "Submit"}));
isCurSheet = new UICheckBox(Inter.getLocText("FR-Designer-Basic_Only_Submit_Current_Sheet"));
JPanel submitPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
submitPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"}), null));
submitPane.add(isVerify);
submitPane.add(failSubmit);
submitPane.add(isCurSheet);
isVerify.addChangeListener(changeListener);
return submitPane;
}
@ -562,6 +564,7 @@ public class EditToolBar extends BasicPane {
Submit submit = ((Submit) widget);
this.isVerify.setSelected(submit.isVerify());
this.failSubmit.setSelected(submit.isFailVerifySubmit());
this.isCurSheet.setSelected(submit.isOnlySubmitSelect());
}
private void populatePDFPrint(){
@ -624,6 +627,7 @@ public class EditToolBar extends BasicPane {
Submit submit = ((Submit) widget);
submit.setVerify(this.isVerify.isSelected());
submit.setFailVerifySubmit(this.failSubmit.isSelected());
submit.setOnlySubmitSelect(this.isCurSheet.isSelected());
}
private void updatePrint(){

39
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -31,7 +31,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox returnTypeComboBox;
private UILabel sampleLabel;// preview
// content
private UITextField patternTextField = null;
private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv;
private ValueEditorPane endDv;
@ -63,25 +63,21 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
// sample pane
sampleLabel = new UILabel("");
// samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
// content pane
patternTextField = new UITextField();
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
String[] arr = getDateFormateArray();
final UIComboBox comboBox = new UIComboBox(arr);
comboBox.setPreferredSize(new Dimension(150,20));
comboBox.addActionListener(new ActionListener(){
dateFormatComboBox = new UIComboBox(arr);
dateFormatComboBox.setPreferredSize(new Dimension(150,20));
dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
patternTextField.setText( (String)comboBox.getSelectedItem());
refreshPreviewLabel();
}
});
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),comboBox,sampleLabel}, FlowLayout.LEFT, 5);
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH);
@ -104,22 +100,9 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
return rangePane;
}
private DocumentListener patternTextDocumentListener = new DocumentListener() {
public void insertUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
public void removeUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
public void changedUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
};
private void refreshPreviewLabel() {
String text = patternTextField.getText();
String text = (String) dateFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) {
try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -143,12 +126,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText();
patternTextField.setText(formatText);
dateFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
populateStartEnd(e);
};
}
@Override
protected DateEditor updateSubDirectWriteEditorBean() {
@ -231,11 +214,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
private SimpleDateFormat getSimpleDateFormat() {
String text = patternTextField.getText();
String text = (String) dateFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) {
try {
simpleDateFormat = new SimpleDateFormat(patternTextField.getText());
simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) {
simpleDateFormat = new SimpleDateFormat("");

6
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -61,11 +61,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
regPane.getRegComboBox().addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
if (!StringUtils.isNotEmpty(regExp.toRegText())) {
getRegErrorMsgTextField().setEnabled(false);
} else {
getRegErrorMsgTextField().setEnabled(true);
}
getRegErrorMsgTextField().setEnabled(regExp.errorMessageEditable());
}
});

2
designer/src/com/fr/poly/creator/ChartBlockCreator.java

@ -142,7 +142,7 @@ public class ChartBlockCreator extends BlockCreator<PolyChartBlock> {
@Override
public QuickEditor getQuickEditor(TargetComponent tc) {
ChartQuickEditor quitEditor = ChartQuickEditor.getInstance();
ChartQuickEditor quitEditor = new ChartQuickEditor();
quitEditor.populate(tc);
return quitEditor;
}

18
designer/src/com/fr/quickeditor/ChartQuickEditor.java

@ -16,29 +16,17 @@ import com.fr.design.selection.QuickEditor;
import java.awt.*;
public class ChartQuickEditor extends QuickEditor<TargetComponent>{
private static ChartQuickEditor THIS;
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
private BaseChartPropertyPane editingPropertyPane = null;
public static final ChartQuickEditor getInstance() {
if(THIS == null) {
THIS = new ChartQuickEditor();
}
return THIS;
}
//private BaseChartPropertyPane editingPropertyPane = null;
private ChartQuickEditor() {
public ChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
if(editingPropertyPane != null) {
remove(editingPropertyPane);
}
BaseChartPropertyPane editingPropertyPane = null;
BaseChartCollection collection = null;
if(tc instanceof PolyDesigner) {
ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor();

23
designer/src/com/fr/quickeditor/cellquick/CellDScolumnEditor.java → designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -16,7 +16,7 @@ import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
public class CellDScolumnEditor extends CellQuickEditor {
public class CellDSColumnEditor extends CellQuickEditor {
private JPanel dsColumnRegion;
private JPanel centerPane;
private SelectedDataColumnPane dataPane;
@ -55,16 +55,7 @@ public class CellDScolumnEditor extends CellQuickEditor {
}
};
private static CellDScolumnEditor THIS;
public static final CellDScolumnEditor getInstance() {
if (THIS == null) {
THIS = new CellDScolumnEditor();
}
return THIS;
}
private CellDScolumnEditor() {
private CellDSColumnEditor() {
super();
}
@ -107,4 +98,14 @@ public class CellDScolumnEditor extends CellQuickEditor {
this.validate();
}
/**
* for 关闭时候释放
*/
public void release () {
super.release();
dsColumnRegion = null;
centerPane = null;
}
}

70
designer_base/build.dev.gradle

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

70
designer_base/build.release.gradle

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

2
designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1 +1 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }

36
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -10,6 +10,7 @@ import com.fr.design.selection.QuickEditor;
import javax.swing.*;
import java.awt.event.KeyEvent;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.*;
/**
@ -22,11 +23,11 @@ public class ActionFactory {
private ActionFactory() {
}
private static Map<Class, QuickEditor> floatEditor = new HashMap<Class, QuickEditor>();
private static Map<Class, Class<? extends QuickEditor>> floatEditor = new HashMap<Class, Class<? extends QuickEditor>>();
private static Class chartCollectionClass = null;
private static Map<Class, QuickEditor> cellEditor = new HashMap<Class, QuickEditor>();
private static Map<Class, Class<? extends QuickEditor>> cellEditor = new HashMap<Class, Class<? extends QuickEditor>>();
private static UpdateAction chartPreStyleAction = null;
@ -36,17 +37,18 @@ public class ActionFactory {
* @param clazz 待说明
* @param editor 待说明
*/
public static void registerCellEditor(Class clazz, QuickEditor editor) {
public static void registerCellEditor(Class clazz, Class<? extends QuickEditor> editor) {
cellEditor.put(clazz, editor);
}
/**
* 待说明
*
* @param clazz 待说明
* @param editor 待说明
*/
public static void registerFloatEditor(Class clazz, QuickEditor editor) {
public static void registerFloatEditor(Class clazz, Class<? extends QuickEditor> editor) {
floatEditor.put(clazz, editor);
}
@ -84,7 +86,7 @@ public class ActionFactory {
*
* @param editor 待说明
*/
public static void registerChartFloatEditorInEditor(QuickEditor editor) {
public static void registerChartFloatEditorInEditor(Class<? extends QuickEditor> editor) {
if (chartCollectionClass != null) {
floatEditor.put(chartCollectionClass, editor);
}
@ -95,7 +97,7 @@ public class ActionFactory {
*
* @param editor 待说明
*/
public static void registerChartCellEditorInEditor(QuickEditor editor) {
public static void registerChartCellEditorInEditor(Class<? extends QuickEditor> editor) {
if (chartCollectionClass != null) {
cellEditor.put(chartCollectionClass, editor);
}
@ -105,11 +107,29 @@ public class ActionFactory {
* 返回 悬浮元素选中的Editor
*/
public static QuickEditor getFloatEditor(Class clazz) {
return floatEditor.get(clazz);
return createEditor(clazz, floatEditor);
}
private static QuickEditor createEditor(Class clazz, Map<Class, Class<? extends QuickEditor>> editorMap) {
Class<? extends QuickEditor> c = editorMap.get(clazz);
try {
Constructor<? extends QuickEditor> constructor = c.getDeclaredConstructor();
constructor.setAccessible(true);
return constructor.newInstance();
} catch (NoSuchMethodException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (InvocationTargetException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
return null;
}
public static QuickEditor getCellEditor(Class clazz) {
return cellEditor.get(clazz);
return createEditor(clazz, cellEditor);
}
/**

2
designer_base/src/com/fr/design/actions/file/LocalePane.java

@ -210,8 +210,6 @@ public class LocalePane extends BasicPane {
/**
* 保存当前编辑的国际化
*
*
* @date 2014-9-30-下午3:10:30
*/
public void save() {
Env env = FRContext.getCurrentEnv();

6
designer_base/src/com/fr/design/actions/file/SwitchExistEnv.java

@ -10,6 +10,7 @@ import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.TemplatePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
@ -41,13 +42,16 @@ public class SwitchExistEnv extends MenuDef {
this.setName(getMenuKeySet().getMenuName());
this.setHasScrollSubMenu(true);
initMenuDef();
GeneralContext.addEnvWillChangedListener(new EnvChangedListener() {
JTemplate<?, ?> t = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if(t != null) {
GeneralContext.addEnvWillChangedListener(t.getFullPathName(), new EnvChangedListener() {
public void envChanged() {
SwitchExistEnv.this.clearShortCuts();
initMenuDef();
}
});
}
}
private void initMenuDef() {
//ButtonGroup group = new ButtonGroup();

5
designer_base/src/com/fr/design/condition/LiteConditionPane.java

@ -542,13 +542,12 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
andRadioButton.setSelected(true);
JPanel radioPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(3);
JPanel radioPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
addControlPane.add(radioPane);
radioPane.add(andRadioButton);
addControlPane.add(Box.createHorizontalStrut(4));
radioPane.add(orRadioButton);
addControlPane.add(Box.createHorizontalStrut(12));
addControlPane.add(Box.createHorizontalStrut(35));
addButton = new UIButton(Inter.getLocText("FR-Designer_Add"), BaseUtils.readIcon("com/fr/base/images/cell/control/add.png"));
addButton.setMnemonic('A');

2
designer_base/src/com/fr/design/constants/KeyWords.java

@ -117,6 +117,8 @@ public class KeyWords {
"verifyReport()",
"writeReportIgnoreVerify(true)",
"writeReport(index)",
"loadSheetByIndex(index)",
"loadSheetByName(sheetName)",
// curLGP
"currentTDCell",

28
designer_base/src/com/fr/design/data/BasicTableDataTreePane.java

@ -3,6 +3,7 @@ package com.fr.design.data;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
@ -117,7 +118,7 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
if (StringUtils.isBlank(tempName)) {
nPanel.setShowText(Inter.getLocText(new String[]{"DS-TableData", "ISEMPTY", "PLEASE", "GIVE-NAME"}, new String[]{"", ",", "", "!"}));
dg.setButtonEnabled(false);
} else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName, allDSNames)) {
} else if (!ComparatorUtils.equals(oldName, tempName) && isDsNameRepeaded(tempName)) {
String[] waring = new String[]{"DS-TableData", "Utils-has_been_existed", "PLEASE", "Rename"};
String[] sign = new String[]{tempName, ",", "", "!"};
nPanel.setShowText(Inter.getLocText(waring, sign));
@ -323,20 +324,22 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
private String createDsName(String prefix) {
int count = 1;
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
while (isDsNameRepeaded(prefix + count, allDSNames)) {
while (isDsNameRepeaded(prefix + count)) {
count++;
}
return prefix + count;
}
private boolean isDsNameRepeaded(String name, String[] names) {
boolean repeat = false;
for (int i = 0; i < names.length; i++) {
if (ComparatorUtils.equals(name, names[i])) {
repeat = true;
protected boolean isDsNameRepeaded(String name) {
if (allDSNames == null) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
}
for (int i = 0; i < allDSNames.length; i++) {
if (ComparatorUtils.equals(name, allDSNames[i])) {
return true;
}
}
return repeat;
return false;
}
protected KeyAdapter getTableTreeNodeListener(final UpdateAction editAction, final UpdateAction previewTableDataAction, final UpdateAction removeAction, final TableDataSourceOP op, final TableDataTree dataTree) {
@ -423,4 +426,13 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp
this.setSmallIcon(BaseUtils.readIcon(IconPathConstants.TD_CONNECTION_ICON_PATH));
}
}
/**
* 合并数据集
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public void addTableData(String srcName, TableDataSource tableDataSource) {
}
}

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

@ -13,8 +13,10 @@ import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.impl.storeproc.StoreProcedureConstants;
import com.fr.design.data.tabledata.wrapper.*;
import com.fr.design.DesignModelAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.iprogressbar.AutoProgressBar;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.file.DatasourceManager;
@ -34,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,7 +57,10 @@ public abstract class DesignTableDataManager {
*/
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 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>>();
public static String NO_PARAMETER = "no_paramater_pane";
@ -73,6 +79,8 @@ public abstract class DesignTableDataManager {
* 响应数据集改变.
*/
private static void fireDsChanged() {
for(Entry<String, List<ChangeListener>> listenerEntry : dsListenersMap.entrySet()) {
List<ChangeListener> dsListeners = listenerEntry.getValue();
for (int i = 0; i < dsListeners.size(); i++) {
//增强for循环用的iterator实现的, 如果中间哪个listener修改或删除了(如ChartEditPane.dsChangeListener),
// 由于dsListeners是arraylist, 此时会ConcurrentModifyException
@ -81,6 +89,20 @@ public abstract class DesignTableDataManager {
dsListeners.get(i).stateChanged(e);
}
}
}
public static void closeTemplate(JTemplate<?,?> template) {
if(template != null) {
dsListenersMap.remove(template.getFullPathName());
}
}
public static void envChange() {
dsListenersMap.clear();
dsNameChangedMap.clear();
clearGlobalDs();
}
/**
* 响应数据集改变
@ -127,6 +149,16 @@ public abstract class DesignTableDataManager {
* @param l ChangeListener监听器
*/
public static void addDsChangeListener(ChangeListener l) {
JTemplate<?, ?> template = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
String key = StringUtils.EMPTY;
if(template != null) {
key = template.getFullPathName();
}
List<ChangeListener> dsListeners = dsListenersMap.get(key);
if (dsListeners == null) {
dsListeners = new ArrayList<ChangeListener>();
dsListenersMap.put(key, dsListeners);
}
dsListeners.add(l);
}

1
designer_base/src/com/fr/design/data/datapane/TableDataComboBox.java

@ -146,4 +146,5 @@ public class TableDataComboBox extends UIComboBox implements Prepare4DataSourceC
}
});
}
}

29
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -39,6 +39,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class TableDataTreePane extends BasicTableDataTreePane {
@ -138,6 +139,7 @@ public class TableDataTreePane extends BasicTableDataTreePane {
populate(new TableDataSourceOP(tc));
this.checkButtonEnabled();
}
protected void initbuttonGroup() {
Icon[] iconArray = {BaseUtils.readIcon("/com/fr/design/images/data/datasource.png"), BaseUtils.readIcon("/com/fr/design/images/data/dock/serverdatabase.png")};
final Integer[] modeArray = {TEMPLATE_TABLE_DATA, SERVER_TABLE_DATA};
@ -267,4 +269,31 @@ public class TableDataTreePane extends BasicTableDataTreePane {
public TableDataTree getDataTree() {
return dataTree;
}
/**
* 合并数据集
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public void addTableData(String srcName, TableDataSource tableDataSource) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next();
TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName;
}
int i = 0;
while (tds.getTableData(tdName) != null) {
i++;//如果拼上名字后依然已经存在就加编号
tdName += i;
}
tds.putTableData(tdName, td);
}
tc.parameterChanged();
dataTree.refresh();
}
}

10
designer_base/src/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -445,6 +445,14 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
return suffixList.toArray(new String[suffixList.size()]);
}
private String getFileSuffixToString() {
String suffixToString = fileTypeComboBox.getSelectedItem().toString().toLowerCase();
if (suffixToString.equalsIgnoreCase("excel")) {
suffixToString = "xls";
}
return suffixToString;
}
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) {
ActionListener fileTypeListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -458,7 +466,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} else {
setPanel.add(textSetPanel(width,height), BorderLayout.NORTH);
}
String tipContent = Inter.getLocText("FR-Designer-Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffix() + "<br>"
String tipContent = Inter.getLocText("FR-Designer-Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent);
}

37
designer_base/src/com/fr/design/event/TemplateTreeDragSource.java

@ -1,37 +0,0 @@
package com.fr.design.event;
import com.fr.design.gui.itree.filetree.TemplateFileTree;
import com.fr.design.mainframe.dnd.ArrayTransferable;
import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.general.web.ParameterConsts;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceAdapter;
/**
* Created with IntelliJ IDEA.
* User: richie
* Date: 13-11-4
* Time: 下午2:17
*/
public class TemplateTreeDragSource extends DragSourceAdapter implements DragGestureListener {
private DragSource source;
public TemplateTreeDragSource(JTree tree, int actions) {
source = new DragSource();
source.createDefaultDragGestureRecognizer(tree, actions, this);
}
public void dragGestureRecognized(DragGestureEvent dge) {
Component comp = dge.getComponent();
if (comp instanceof TemplateFileTree) {
String selectedPath = ((TemplateFileTree)comp).getSelectedTemplatePath();
source.startDrag(dge, DragSource.DefaultLinkDrop, new SerializableTransferable(selectedPath), this);
}
}
}

19
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -118,14 +118,13 @@ public class LoginWebBridge {
if(!StringUtils.isEmpty(this.userName)){
updateMessageCount();
}
DesignerEnvManager.getEnvManager().setBBSName(userName);
this.userName = userName;
}
/**
* 定时取后台论坛消息
*/
private void updateMessageCount(){
public void updateMessageCount(){
//启动获取消息更新的线程
//登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数.
Thread updateMessageThread = new Thread(new Runnable() {
@ -171,7 +170,7 @@ public class LoginWebBridge {
}
this.messageCount = count;
StringBuilder sb = new StringBuilder();
sb.append(StringUtils.BLANK).append(this.userName)
sb.append(StringUtils.BLANK).append(DesignerEnvManager.getEnvManager().getBBSName())
.append("(").append(this.messageCount)
.append(")").append(StringUtils.BLANK);
DesignerEnvManager.getEnvManager().setInShowBBsName(sb.toString());
@ -244,7 +243,7 @@ public class LoginWebBridge {
* @param uiLabel 两边的label显示
* @return 登录信息标志
*/
private String login(String username, String password, UILabel uiLabel) {
public String login(String username, String password, UILabel uiLabel) {
if (!StringUtils.isNotBlank(username) && !StringUtils.isNotBlank(password)) {
return LOGIN_INFO_EMPTY;
}
@ -253,7 +252,7 @@ public class LoginWebBridge {
}
String loginResult = login(username, password);
if (loginResult.equals(LOGININ)) {
updateUserInfo(username, password);
updateUserInfo(username);
loginSuccess(username, uiLabel);
setUserName(username, uiLabel);
}
@ -275,10 +274,7 @@ public class LoginWebBridge {
* @param username 用户名
* @param password 密码
*/
public void updateUserInfo(String username,String password) {
DesignerEnvManager.getEnvManager().setBBSName(username);
DesignerEnvManager.getEnvManager().setBBSPassword(password);
DesignerEnvManager.getEnvManager().setInShowBBsName(username);
public void updateUserInfo(String username) {
this.userName = username;
}
@ -309,7 +305,7 @@ public class LoginWebBridge {
});
}
public String login(String username, String password) {
private String login(String username, String password) {
try {
Client uc = new Client();
String result = uc.uc_user_login(username, password);
@ -319,6 +315,9 @@ public class LoginWebBridge {
int $uid = Integer.parseInt(list.get(0));
if ($uid > 0) {
DesignerEnvManager.getEnvManager().setBbsUid($uid);
DesignerEnvManager.getEnvManager().setBBSName(username);
DesignerEnvManager.getEnvManager().setInShowBBsName(username);
DesignerEnvManager.getEnvManager().setBBSPassword(password);
return LOGININ;//登录成功,0
} else if ($uid == -1) {
return USERNAME_NOT_EXSIT;//用户名不存在,-1

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

@ -154,7 +154,6 @@ public class PluginHelper {
installDependenceOnline(currentID, needInstallDependence);
}
/**
* 构造一个下载UI
*

11
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -529,6 +529,17 @@ public class PluginWebBridge {
return LoginWebBridge.getHelper().pluginManageLogin(username, password, uiLabel);
}
/**
* 插件管理部分的登陆的回调处理
* @param username
* @param password
* @param callback
*/
public void defaultLogin(String username, String password, final JSObject callback) {
Task<Void> task = new PluginTask<>(webEngine, callback, new PluginLoginExecutor(username, password, uiLabel));
new Thread(task).start();
}
/**
* 弹出QQ授权页面
*/

49
designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java

@ -0,0 +1,49 @@
package com.fr.design.extra.exe;
import com.fr.design.extra.LoginWebBridge;
import com.fr.design.extra.Process;
import com.fr.design.gui.ilable.UILabel;
/**
* Created by Slpire on 2016/11/7.
*/
public class PluginLoginExecutor implements Executor {
private String result = "[]";
private String username;
private String password;
private UILabel uiLabel;
public PluginLoginExecutor(String username, String password, UILabel uiLabel) {
this.username = username;
this.password = password;
this.uiLabel = uiLabel;
}
@Override
public String getTaskFinishMessage() {
return result;
}
@Override
public Command[] getCommands() {
return new Command[] {
new Command() {
@Override
public String getExecuteMessage() {
return null;
}
@Override
public void run(Process<String> process) {
String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel);
if (Integer.valueOf(loginResult) == 0) {
LoginWebBridge.getHelper().updateMessageCount();
}
result = loginResult;
}
}
};
}
}

6
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -11,6 +11,7 @@ import javax.swing.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ListSelectionEvent;
@ -24,9 +25,11 @@ import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.UIList;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory;
import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.project.ProjectConstants;
@ -102,6 +105,9 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations {
* @param selected 选择的
*/
public void closeSelectedReport(JTemplate<?, ?> selected) {
DesignModuleFactory.clearChartPropertyPane();
DesignTableDataManager.closeTemplate(selected);
GeneralContext.removeEnvWillChangedListener(selected.getFullPathName());
if (contains(selected) == -1) {
return;
}

2
designer_base/src/com/fr/design/file/MutilTempalteTabPane.java

File diff suppressed because one or more lines are too long

2
designer_base/src/com/fr/design/formula/VariableResolverAdapter.java

@ -29,7 +29,7 @@ public abstract class VariableResolverAdapter implements VariableResolver {
// 空值参数
"NULL", "NOFILTER",
// request变量
CalculatorProvider.REPORT_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME,
CalculatorProvider.REPORT_NAME, CalculatorProvider.FORMLET_NAME, CalculatorProvider.SERVLET_URL, CalculatorProvider.SERVER_SCHEMA, CalculatorProvider.SERVER_NAME,
CalculatorProvider.SERVER_PORT, CalculatorProvider.SERVER_URL, CalculatorProvider.CONTEXT_PATH, CalculatorProvider.SESSION_ID
};
}

4
designer_base/src/com/fr/design/fun/ElementUIProvider.java

@ -13,7 +13,7 @@ public interface ElementUIProvider extends Mutable {
String MARK_STRING = "ElementUIProvider";
int CURRENT_LEVEL = 1;
int CURRENT_LEVEL = 2;
/**
* 单元格元素编辑器
@ -31,7 +31,7 @@ public interface ElementUIProvider extends Mutable {
* 右侧的快速编辑器
* @return 编辑器
*/
QuickEditor<?> quickEditor();
Class<? extends QuickEditor> quickEditor();
/**
* 插件单元格元素

5
designer_base/src/com/fr/design/fun/FormElementCaseEditorProcessor.java

@ -6,10 +6,9 @@ import com.fr.stable.fun.mark.Immutable;
import java.beans.PropertyDescriptor;
/**
* Created by zhouping on 2015/9/10.
* Created by Slpire on 2016/10/28.
*/
public interface FormElementCaseEditorProcessor extends Immutable {
String MARK_STRING = "PropertyEditor";
int CURRENT_LEVEL = 1;
@ -29,6 +28,4 @@ public interface FormElementCaseEditorProcessor extends Immutable {
* @return 返回pc自适应属性值
*/
int getFitStateInPC(ReportFitAttrProvider fitAttrProvider);
}

35
designer_base/src/com/fr/design/fun/FormElementCaseEditorProvider.java

@ -0,0 +1,35 @@
package com.fr.design.fun;
import com.fr.form.FormProvider;
import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.Mutable;
import java.beans.PropertyDescriptor;
/**
* Created by zhouping on 2015/9/10.
*/
public interface FormElementCaseEditorProvider extends Mutable {
String MARK_STRING = "PropertyEditor";
int CURRENT_LEVEL = 1;
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, FormProvider formProvider, ElementCaseEditorProvider editor);
/**
* 生成属性表
* @param temp 传入当前操作的class
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr);
/**
* 返回pc自适应属性值
* @param fitAttrProvider 传入的自适应属性
* @return 返回pc自适应属性值
*/
int getFitStateInPC(ReportFitAttrProvider fitAttrProvider);
}

51
designer_base/src/com/fr/design/fun/impl/AbstractFormElementCaseEditorProvider.java

@ -0,0 +1,51 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.FormElementCaseEditorProvider;
import com.fr.form.FormProvider;
import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
import com.fr.stable.fun.mark.API;
import java.beans.PropertyDescriptor;
/**
* Created by zhouping on 2015/9/10.
*/
@API(level = FormElementCaseEditorProvider.CURRENT_LEVEL)
public abstract class AbstractFormElementCaseEditorProvider implements FormElementCaseEditorProvider {
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return this.getClass().getName();
}
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, FormProvider reportAttr, ElementCaseEditorProvider editor) {
return new PropertyDescriptor[0];
}
/**
* 生成属性表
* @param temp 传入当前操作的class
* @param reportFitAttr 传入的自适应属性
* @return 返回属性表
*/
@Override
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr) {
return new PropertyDescriptor[0];
}
/**
* 返回pc自适应属性值
* @param fitAttrProvider 传入的自适应属性
* @return 返回pc自适应属性值
*/
@Override
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) {
return 0;
}
}

4
designer_base/src/com/fr/design/gui/chart/BaseChartPropertyPane.java

@ -21,5 +21,7 @@ public abstract class BaseChartPropertyPane extends DockingView {
public abstract void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> ePane);
public abstract void setWidgetPropertyPane(BaseWidgetPropertyPane pane);
public abstract ChartEditPaneProvider getChartEditPane();
//public abstract void clear();
}

13
designer_base/src/com/fr/design/gui/chart/ChartEditPaneProvider.java

@ -0,0 +1,13 @@
package com.fr.design.gui.chart;
/**
* Created by daniel on 2016/11/2.
*/
public interface ChartEditPaneProvider {
void gotoPane(String... id);
void fire();
}

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

@ -1,40 +1,49 @@
package com.fr.design.gui.frpane;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.general.NameObject;
import com.fr.data.impl.TableDataDictionary;
import com.fr.data.impl.TreeAttr;
import com.fr.data.impl.TreeNodeAttr;
import com.fr.data.impl.TreeNodeWrapper;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.tree.layer.config.LayerDataControlPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeDataCardPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor;
import com.fr.form.ui.tree.LayerConfig;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.Arrays;
public class TreeSettingPane extends BasicPane implements DataCreatorUI {
private JTreeControlPane controlPane;
private JTreeAutoBuildPane autoBuildPane;
/**
* 新的分层构建方式
*/
private LayerDataControlPane layerDataControlPane;
private UIComboBox buildBox;
/**
*
*/
private static final long serialVersionUID = 1762889323082827111L;
private String[] buildWay = new String[] { Inter.getLocText("FR-Designer_Layer-Build"),
Inter.getLocText("FR-Designer_Auto-Build") };
private String[] buildWay = new String[]{Inter.getLocText("FR-Designer_DataTable-Build"),
Inter.getLocText("FR-Designer_Auto-Build"), Inter.getLocText("FR-Designer_Layer-Build")};
public TreeSettingPane(boolean isEditor) {
this.initComponents(isEditor);
@ -58,14 +67,30 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
controlPane = new JTreeControlPane(new NameableCreator[] { treeNode },
new TreeDataCardPane(), isEditor);
autoBuildPane = new JTreeAutoBuildPane();
layerDataControlPane = new LayerDataControlPane();
this.add(buildWayPanel, BorderLayout.NORTH);
cardChanged(0);
}
private void cardChanged(int index) {
this.remove(controlPane);
this.remove(autoBuildPane);
this.add(index == 0 ? controlPane : autoBuildPane, BorderLayout.CENTER);
this.remove(layerDataControlPane);
switch (index) {
case 0:
this.add(layerDataControlPane);
break;
case 1:
this.add(autoBuildPane);
break;
case 2:
this.add(controlPane);
break;
default:
break;
}
validate();
repaint();
revalidate();
@ -101,8 +126,17 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
buildBox.setSelectedIndex(1);
TableDataDictionary dictionary = treeEditor.getDictionary();
autoBuildPane.populate(dictionary);
} else {
} else if (treeEditor.isLayerBuild()) {
buildBox.setSelectedIndex(0);
java.util.List<LayerConfig> layerConfigList = treeEditor.getLayerConfigs();
LayerConfig[] layerConfigs = new LayerConfig[layerConfigList.size()];
int i = 0;
for (LayerConfig layerConfig : layerConfigList) {
layerConfigs[i++] = layerConfig;
}
this.layerDataControlPane.populate(new NameObject("Tree Layer Data", layerConfigs));
} else {
buildBox.setSelectedIndex(2);
}
}
@ -121,10 +155,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update();
te.setAutoBuild(true);
te.setLayerBuild(false);
te.setDictionary(dictionary);
te.setNodeOrDict(dictionary);
} else {
} else if (buildBox.getSelectedIndex() == 2) {
te.setAutoBuild(false);
te.setLayerBuild(false);
NameObject no = this.controlPane.update();
if (no != null) {
TreeEditor editor = (TreeEditor) no.getObject();
@ -141,6 +177,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
te.setNodeOrDict(editor.getTreeNodeAttr());
te.setPerformanceFirst(editor.isPerformanceFirst());
}
} else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
te.setAutoBuild(false);
te.setLayerBuild(true);
te.setLayerConfigs(Arrays.asList(configs));
}
return te;
}
@ -150,11 +191,14 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
* @return
*/
public Object updateTreeNodeAttrs() {
if(buildBox.getSelectedIndex() == 0) {
if (buildBox.getSelectedIndex() == 2) {
NameObject no = controlPane.update();
if (no != null) {
return no.getObject();
}
} else if (buildBox.getSelectedIndex() == 0) {
return layerDataControlPane.update();
} else {
return autoBuildPane.update();
}
@ -170,10 +214,12 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
if (buildBox.getSelectedIndex() == 1) {
TableDataDictionary dictionary = this.autoBuildPane.update();
tcb.setAutoBuild(true);
tcb.setLayerBuild(false);
tcb.setDictionary(dictionary);
tcb.setNodeOrDict(dictionary);
} else {
} else if (buildBox.getSelectedIndex() == 2) {
tcb.setAutoBuild(false);
tcb.setLayerBuild(false);
NameObject no = this.controlPane.update();
if (no != null) {
if (no.getObject() instanceof TreeComboBoxEditor) {
@ -194,6 +240,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
tcb.setNodeOrDict(editor.getTreeNodeAttr());
tcb.setPerformanceFirst(editor.isPerformanceFirst());
}
}else {
LayerConfig[] configs = (LayerConfig[]) layerDataControlPane.update().getObject();
tcb.setAutoBuild(false);
tcb.setLayerBuild(true);
tcb.setLayerConfigs(Arrays.asList(configs));
}
return tcb;
}
@ -204,12 +255,15 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
*/
public void populate(Object nodeOrDict) {
if(nodeOrDict instanceof TreeNodeAttr[] || nodeOrDict instanceof TreeNodeWrapper) {
buildBox.setSelectedIndex(0);
buildBox.setSelectedIndex(2);
NameObject no = new NameObject("name", nodeOrDict);
controlPane.populate(no);
} else if(nodeOrDict instanceof TableDataDictionary) {
buildBox.setSelectedIndex(1);
autoBuildPane.populate((TableDataDictionary)nodeOrDict);
} else if (nodeOrDict instanceof NameObject) {
buildBox.setSelectedIndex(0);
layerDataControlPane.populate((NameObject) nodeOrDict);
}
}
}

24
designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java

@ -25,7 +25,7 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
protected JPanel cardPane;
protected List<FurtherBasicBeanPane<? extends T>> cards;
private String[] cardNames;
protected String[] cardNames;
public UIComboBoxPane() {
cards = initPaneList();
@ -49,6 +49,19 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
addComboBoxItem(cards, i);
}
addItemChangeEvent();
initLayout();
jcb.setSelectedIndex(0);
}
public FurtherBasicBeanPane<? extends T> getSelectedPane(){
return cards.get(jcb.getSelectedIndex());
}
protected void addItemChangeEvent() {
jcb.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
@ -57,10 +70,6 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
cl.show(cardPane, cardNames[jcb.getSelectedIndex()]);
}
});
initLayout();
jcb.setSelectedIndex(0);
}
protected UIComboBox createComboBox() {
@ -117,6 +126,8 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
}
}
@Override
public T updateBean() {
return cards.get(jcb.getSelectedIndex()).updateBean();
@ -142,4 +153,7 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
return this.cards;
}
public void clear() {
reset();
}
}

12
designer_base/src/com/fr/design/gui/icombobox/FRTreeComboBox.java

@ -247,7 +247,17 @@ public class FRTreeComboBox extends UIComboBox {
}
@Override
protected UIButton createArrowButton() {
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON);
arrowButton = new UIButton(UIConstants.ARROW_DOWN_ICON){
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
@Override
public boolean shouldResponseChangeListener() {
return false;
}
};
((UIButton) arrowButton).setRoundBorder(true, Constants.LEFT);
arrowButton.addMouseListener(this);
comboBox.addMouseListener(this);

6
designer_base/src/com/fr/design/gui/icombobox/UIComboBox.java

@ -37,7 +37,7 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
private static final int SIZE5 = 5;
private UIObserverListener uiObserverListener;
protected UIObserverListener uiObserverListener;
private String comboBoxName = "";
@ -71,7 +71,7 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
initListener();
}
private void initListener() {
protected void initListener() {
if (shouldResponseChangeListener()) {
this.addFocusListener(new FocusAdapter() {
@Override
@ -94,7 +94,7 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser
}
}
private void fireSetGlobalName() {
protected void fireSetGlobalName() {
if (globalNameListener != null && shouldResponseNameListener()) {
globalNameListener.setGlobalName(comboBoxName);
}

70
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -3,6 +3,7 @@ package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils;
@ -21,11 +22,14 @@ public class UIResizableContainer extends JPanel {
private JComponent upPane;
private JComponent downPane;
//放参数面板
private JComponent parameterPane = new JPanel();
private HorizotalToolPane horizontToolPane;
private VerticalToolPane verticalToolPane;
private int direction;
private boolean hasParameterPane;
private static final int MAX_WIDTH = 300;
private static final int MIN_WIDTH = 165;
@ -37,6 +41,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ;
private int paraHeight;
public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction);
@ -86,6 +91,7 @@ public class UIResizableContainer extends JPanel {
add(downPane);
add(verticalToolPane);
}
public UIResizableContainer(JComponent upPane, int direction) {
setBackground(UIConstants.NORMAL_BACKGROUND);
@ -119,6 +125,26 @@ public class UIResizableContainer extends JPanel {
}
}
/**
* 获取参数面板高度
*/
public int getParameterPaneHeight() {
return paraHeight;
}
/**
* 设置参数面板高度
*
* @param height
*/
public void setParameterHeight(int height) {
paraHeight = hasParameterPane? height : 0;
refreshContainer();
}
/**
* 得到上下子面板的高度
*
@ -183,7 +209,7 @@ public class UIResizableContainer extends JPanel {
if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
horizontToolPane.setBounds(0, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight);
downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight);
downPane.setBounds(0, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight-30);
verticalToolPane.setBounds(containerWidth - toolPaneHeight, 0, toolPaneHeight, getHeight());
}else{
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, getHeight());
@ -194,16 +220,17 @@ public class UIResizableContainer extends JPanel {
if (toolPaneY > getHeight() - toolPaneHeight) {
toolPaneY = getHeight() - toolPaneHeight;
}
upPane.setBounds(toolPaneHeight, 0, containerWidth - toolPaneHeight, toolPaneY);
horizontToolPane.setBounds(toolPaneHeight, toolPaneY, containerWidth - toolPaneHeight, toolPaneHeight);
downPane.setBounds(toolPaneHeight, toolPaneY + toolPaneHeight, containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight);
parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());
upPane.setBounds(toolPaneHeight, getParameterPaneHeight(), containerWidth - toolPaneHeight, toolPaneY);
horizontToolPane.setBounds(toolPaneHeight, toolPaneY + getParameterPaneHeight(), containerWidth - toolPaneHeight, toolPaneHeight);
downPane.setBounds(toolPaneHeight, toolPaneY + toolPaneHeight + getParameterPaneHeight(), containerWidth - toolPaneHeight, parent.getHeight() - toolPaneY - toolPaneHeight - getParameterPaneHeight());
verticalToolPane.setBounds(0, 0, toolPaneHeight, getHeight());
}else{
upPane.setBounds(toolPaneHeight, 0, containerWidth - toolPaneHeight, getHeight());
} else {
parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());
upPane.setBounds(toolPaneHeight, getParameterPaneHeight(), containerWidth - toolPaneHeight, getHeight() - getParameterPaneHeight());
verticalToolPane.setBounds(0, 0, toolPaneHeight, getHeight());
}
}
}
@Override
@ -244,6 +271,20 @@ public class UIResizableContainer extends JPanel {
refreshContainer();
}
public void addParameterPane(JComponent pane) {
add(this.parameterPane = pane);
hasParameterPane = true;
refreshContainer();
}
public void removeParameterPane() {
remove(this.parameterPane);
setParameterHeight(0);
hasParameterPane = false;
refreshContainer();
}
/**
* 得到上子面板
*
@ -262,6 +303,15 @@ public class UIResizableContainer extends JPanel {
return this.downPane;
}
/**
* 得到参数面板
*
* @return
*/
public JComponent getParameterPane() {
return this.parameterPane;
}
/**
* 刷新下面板
*/
@ -303,7 +353,7 @@ public class UIResizableContainer extends JPanel {
public void mouseDragged(MouseEvent e) {
toolPaneY = e.getYOnScreen() - UIResizableContainer.this.getLocationOnScreen().y;
toolPaneY = toolPaneY < 0 ? 0 : toolPaneY;
toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight : toolPaneY;
toolPaneY = toolPaneY > UIResizableContainer.this.getHeight() - toolPaneHeight ? UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight() : toolPaneY - getParameterPaneHeight();
refreshContainer();
}
});
@ -326,7 +376,7 @@ public class UIResizableContainer extends JPanel {
if (e.getX() <= ARROW_RANGE) {
toolPaneY = 0;
} else if (e.getX() >= getWidth() - ARROW_RANGE) {
toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight;
toolPaneY = UIResizableContainer.this.getHeight() - toolPaneHeight - getParameterPaneHeight();
} else {
return;
}
@ -483,7 +533,7 @@ public class UIResizableContainer extends JPanel {
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel content = (JPanel) jf.getContentPane();
content.setLayout(new BorderLayout());
UIResizableContainer bb = new UIResizableContainer(Constants.LEFT);
UIResizableContainer bb = new UIResizableContainer(Constants.RIGHT);
JPanel cc = new JPanel();
cc.setBackground(Color.blue);
content.add(bb, BorderLayout.EAST);

3
designer_base/src/com/fr/design/gui/itree/filetree/EnvFileTree.java

@ -2,13 +2,11 @@ package com.fr.design.gui.itree.filetree;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.dnd.DnDConstants;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.TemplateTreeDragSource;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeCellRenderer;
@ -74,7 +72,6 @@ public class EnvFileTree extends RefreshableJTree {
this.setRootVisible(false);
this.setShowsRootHandles(true);
this.setEditable(false);
new TemplateTreeDragSource(this, DnDConstants.ACTION_COPY);
}
// CellRenderer

4
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -63,12 +63,12 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": "));
heightTextFiled = new UINumberField();
heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE));
heightTextFiled.setPreferredSize(new Dimension(60, 20));
heightTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(heightTextFiled);
newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": "));
widthTextFiled = new UINumberField();
widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE));
widthTextFiled.setPreferredSize(new Dimension(60, 20));
widthTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(widthTextFiled);
JPanel centerPanel = new JPanel(new BorderLayout());

2
designer_base/src/com/fr/design/icon/IconPathConstants.java

@ -1 +1 @@
package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png"; }
package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png"; }

BIN
designer_base/src/com/fr/design/images/buttonicon/config.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

BIN
designer_base/src/com/fr/design/images/control/help_close.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 801 B

BIN
designer_base/src/com/fr/design/images/control/help_open.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 895 B

3
designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt

@ -0,0 +1,3 @@
表单名字
假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,
formName就是Form1.frm

3
designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt

@ -0,0 +1,3 @@
form name
http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm£¬
formName is Form1.frm

34
designer_base/src/com/fr/design/layout/TableLayoutHelper.java

@ -47,6 +47,40 @@ public class TableLayoutHelper {
return createCommonTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM);
}
/**
* 标题布局(二级菜单距左边框46)
* @param title 标题
* @param component 组件
* @return 布局好的组件
*/
public static JPanel createTableLayoutPaneWithTitle(String title, Component component){
return createTitlePane(title, component, LayoutConstants.CHART_ATTR_TOMARGIN);
}
public static JPanel createTitlePane(String title, Component component, int gap){
return createTitlePaneWithUILabel(new UILabel(title), component, gap);
}
/**
* 标题布局指定gap
* @param label 标题label
* @param component 组件
* @param gap 距左侧距离
* @return 布局好的组件
*/
public static JPanel createTitlePaneWithUILabel(UILabel label, Component component, int gap){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {gap, f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{label,null},
new Component[]{null,component},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
public static JPanel createCommonTableLayoutPane(Component[][] components, double[] rowSize, double[] columnSize, double gap) {
return createGapTableLayoutPane(components, rowSize, columnSize, gap, gap);

13
designer_base/src/com/fr/design/mainframe/HelpDialogHandler.java

@ -0,0 +1,13 @@
package com.fr.design.mainframe;
/**
* Coder: zack
* Date: 2016/11/3
* Time: 10:43
*/
public interface HelpDialogHandler {
/**
* 销毁
*/
void destroyHelpDialog();
}

38
designer_base/src/com/fr/design/mainframe/HelpDialogManager.java

@ -0,0 +1,38 @@
package com.fr.design.mainframe;
/**
* 帮助信息的面板由于需要滚动条所以采用了很挫的dialog做dialog很多情况下不能主动关闭这边控制一下
* Coder: zack
* Date: 2016/11/2
* Time: 16:34
*/
public class HelpDialogManager {
private static HelpDialogManager THIS;
private HelpDialogHandler handler;
private HelpDialogManager() {
}
public HelpDialogHandler getPane() {
return handler;
}
public void setPane(HelpDialogHandler dialog) {
if (dialog == this.handler) {
return;
}
//只允许一个dialog存在
if (this.handler != null) {
handler.destroyHelpDialog();
}
this.handler = dialog;
}
public static HelpDialogManager getInstance() {
if (THIS == null) {
THIS = new HelpDialogManager();
}
return THIS;
}
}

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

@ -139,10 +139,31 @@ public abstract class ToolBarMenuDock {
menuList.add(createHelpMenuDef());
// 添加社区菜单
menuList.add(createCommunityMenuDef());
addCommunityMenuDef(menuList);
return menuList.toArray(new MenuDef[menuList.size()]);
}
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){
Locale locale = FRContext.getLocale();
Locale [] locales =supportCommunityLocales();
for(int i = 0; i < locales.length; i++) {
if(locale.equals(locales[i])){
menuList.add(createCommunityMenuDef());
break;
}
}
}
public Locale[] supportCommunityLocales() {
return new Locale[]{
Locale.CHINA,
Locale.JAPAN,
Locale.TAIWAN,
Locale.US,
};
}
public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) {
// 给菜单加插件入口
for (MenuDef m : menuDefs) {

2
designer_base/src/com/fr/design/module/DesignModuleFactory.java

File diff suppressed because one or more lines are too long

8
designer_base/src/com/fr/design/selection/QuickEditor.java

@ -41,6 +41,14 @@ public abstract class QuickEditor<T extends TargetComponent> extends JComponent
protected abstract void refresh();
/**
* for 关闭时候释放
*/
public void release () {
tc = null;
}
public static QuickEditor DEFAULT_EDITOR = new QuickEditor() {
@Override

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

@ -31,8 +31,7 @@ import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginLoader;
import com.fr.plugin.dependence.PluginServiceCreator;
import com.fr.plugin.dependence.PluginServiceManager;
import com.fr.share.ShareConstants;
import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider;
import com.fr.stable.project.ProjectConstants;
@ -2106,4 +2105,108 @@ public class RemoteEnv implements Env {
public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception {
}
@Override
public File[] loadREUFile() throws Exception {
File target = new File(CacheManager.getProviderInstance().getCacheDirectory(),
ShareConstants.DIR_SHARE_CACHE);
StableUtils.deleteFile(target);
StableUtils.mkdirs(target);
File cacheDir = null;
File zip = null;
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_read_reufile");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para);
InputStream input = client.getResponseStream();
zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip");
cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE);
StableUtils.deleteFile(cacheDir);
StableUtils.mkdirs(cacheDir);
StableUtils.makesureFileExist(zip);
FileOutputStream out = new FileOutputStream(zip);
IOUtils.copyBinaryTo(input, out);
out.flush();
out.close();
IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录
if (cacheDir.exists() && cacheDir.isDirectory()) {
return cacheDir.listFiles(new FilenameFilter() {
public boolean accept(File file, String s) {
return s.endsWith("reu");
}
});
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
} finally {
StableUtils.deleteFile(zip);
}
return new File[0];
}
@Override
public boolean installREUFile(File reuFile) {
// if (reuFile == null) {
// return false;
// }
// try {
// HashMap<String, String> para = new HashMap<String, String>();
// para.put("op", "fr_remote_design");
// para.put("cmd", "design_install_reufile");
// para.put("current_uid", this.createUserID());
// para.put("currentUsername", this.getUser());
// para.put("reuFileName", reuFile.getName());
//
// HttpClient client = createHttpMethod(para);
// client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(reuFile)));
// InputStream input = execute4InputStream(client);
// return ComparatorUtils.equals(stream2String(input), "true");
// } catch (Exception e) {
// return false;
// }
return false;
}
@Override
public boolean removeREUFilesByName(String fileName) {
if (StringUtils.isEmpty(fileName)) {
return true;
}
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_remove_reufile");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
para.put("reuFileName", fileName);
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
return ComparatorUtils.equals(stream2String(input), "true");
} catch (Exception e) {
return false;
}
}
@Override
public String getSharePath() {
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_get_share_path");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
return stream2String(input);
} catch (Exception e) {
return StringUtils.EMPTY;
}
}
}

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

@ -248,7 +248,7 @@ public abstract class BaseDesigner extends ToolBarMenuDock {
});
df.setVisible(true);
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
FRLogger.getLogger().error(e.getMessage(), e);
if (!isException) {
showDesignerFrame(args, df, true);
} else {

66
designer_chart/build.dev.gradle

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

66
designer_chart/build.release.gradle

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

334
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -21,10 +21,7 @@ import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane
import com.fr.design.module.DesignModuleFactory;
import com.fr.file.XMLFileManager;
import com.fr.form.ui.ChartEditor;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.general.*;
import com.fr.plugin.PluginCollector;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginMessage;
@ -38,10 +35,7 @@ import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import javax.swing.*;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* Created by eason on 14/12/29.
@ -54,13 +48,13 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
private static ClassLoader loader = Thread.currentThread().getContextClassLoader();
private static ChartTypeInterfaceManager classManager = null;
private static LinkedHashMap<String, IndependentChartUIProvider> chartTypeInterfaces = new LinkedHashMap<String, IndependentChartUIProvider>();
private static LinkedHashMap<String, LinkedHashMap<String, IndependentChartUIProvider>> chartTypeInterfaces = new LinkedHashMap<String, LinkedHashMap<String, IndependentChartUIProvider>>();
public synchronized static ChartTypeInterfaceManager getInstance() {
if (classManager == null) {
classManager = new ChartTypeInterfaceManager();
chartTypeInterfaces.clear();
classManager.readDefault();
}
return classManager;
}
@ -77,7 +71,6 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success() {
ChartTypeInterfaceManager.getInstance().readDefault();
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
}
@ -88,23 +81,43 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
final Chart[][] allCharts = new Chart[typeName.length][];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if(rowChart == null) {
continue;
}
//初始化图表模型图片
initChartsDemoImage(rowChart);
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
allCharts[i] = rowChart;
}
//异步加载图片
new Thread(new Runnable() {
@Override
public void run() {
initAllChartsDemoImage(allCharts);
}
}).start();
return child;
}
//加载所有图表图片
private static void initAllChartsDemoImage(Chart[][] allCharts){
for (int i = 0; i < allCharts.length; i++) {
Chart[] rowChart = allCharts[i];
if(rowChart == null) {
continue;
}
//加载初始化图表模型图片
initChartsDemoImage(rowChart);
}
}
private static void initChartsDemoImage(Chart[] rowChart) {
int rowChartsCount = rowChart.length;
for (int j = 0; j < rowChartsCount; j++) {
@ -118,36 +131,67 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
}
private static void readDefault() {
chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
if (chartTypeInterfaces.containsKey(ChartTypeManager.CHART_PRIORITY)){
return;
}
LinkedHashMap<String, IndependentChartUIProvider> chartUIList = new LinkedHashMap<String, IndependentChartUIProvider>();
chartUIList.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface());
chartUIList.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface());
chartUIList.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface());
chartUIList.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface());
chartUIList.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface());
chartUIList.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface());
chartUIList.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface());
chartUIList.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface());
chartUIList.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface());
chartUIList.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface());
chartUIList.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface());
chartUIList.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface());
chartUIList.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface());
chartUIList.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface());
chartUIList.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface());
chartUIList.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartUIList.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
chartTypeInterfaces.put(ChartTypeManager.CHART_PRIORITY, chartUIList);
}
public String getIconPath(String plotID) {
if (chartTypeInterfaces.get(plotID) != null) {
return chartTypeInterfaces.get(plotID).getIconPath();
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
String imagePath = getIconPath(priority, plotID);
if (!StringUtils.isEmpty(imagePath)) {
return imagePath;
}
}
}
return StringUtils.EMPTY;
}
private String getIconPath(String priority, String plotID) {
if (chartTypeInterfaces.get(priority) != null && chartTypeInterfaces.get(priority).get(plotID) != null) {
return chartTypeInterfaces.get(priority).get(plotID).getIconPath();
}else {
return StringUtils.EMPTY;
}
}
public static void addChartTypeInterface(IndependentChartUIProvider provider, String plotID) {
if (chartTypeInterfaces != null && !chartTypeInterfaces.containsKey(plotID)) {
chartTypeInterfaces.put(plotID, provider);
public static void addChartTypeInterface(IndependentChartUIProvider provider, String priority, String plotID) {
if (chartTypeInterfaces != null){
if (!chartTypeInterfaces.containsKey(priority)){
//新建一个具体图表列表
LinkedHashMap<String, IndependentChartUIProvider> chartUIList = new LinkedHashMap<String, IndependentChartUIProvider>();
chartUIList.put(plotID, provider);
chartTypeInterfaces.put(priority, chartUIList);
}else {
LinkedHashMap<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
if (!chartUIList.containsKey(plotID)) {
chartUIList.put(plotID, provider);
}
}
}
}
@ -157,7 +201,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
* @param className 类名
* @param plotID 标志ID
*/
public void addChartInterface(String className, String plotID, PluginSimplify simplify) {
public void addChartInterface(String className, String priority, String plotID, PluginSimplify simplify) {
if (StringUtils.isNotBlank(className)) {
try {
Class<?> clazz = Class.forName(className);
@ -169,7 +213,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
if (PluginCollector.getCollector().isError(provider, IndependentChartUIProvider.CURRENT_API_LEVEL, simplify.getPluginName()) || !containsChart(plotID)) {
PluginMessage.remindUpdate(className);
} else {
ChartTypeInterfaceManager.getInstance().addChartTypeInterface(provider, plotID);
ChartTypeInterfaceManager.getInstance().addChartTypeInterface(provider, priority, plotID);
}
} catch (ClassNotFoundException e) {
FRLogger.getLogger().error("class not found:" + e.getMessage());
@ -184,44 +228,221 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
return ChartTypeManager.getInstance().containsPlot(plotID);
}
/**
* 把所有的pane加到list里
*
* @param paneList pane容器
*/
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) {
List<Integer> priorityList = getPriorityInOrder();
for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i));
Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator();
while (chartUIIterator.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next();
IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue();
paneList.add(provider.getPlotTypePane());
}
}
}
public String[] getTitle4PopupWindow(String priority){
if (priority.isEmpty()){
return getTitle4PopupWindow();
}
String[] names = new String[getChartSize(priority)];
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)){
HashMap<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
Iterator iterator = chartUIList.entrySet().iterator();
int i = 0;
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
IndependentChartUIProvider provider = (IndependentChartUIProvider) entry.getValue();
names[i++] = provider.getPlotTypePane().title4PopupWindow();
}
return names;
}
return new String[0];
}
/**
* 获取指定图表的标题
* @param priority
* @return
*/
public String getTitle4PopupWindow(String priority, String plotID){
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)){
HashMap<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
return provider.getPlotTypePane().title4PopupWindow();
}
return new String();
}
private String[] getTitle4PopupWindow(){
List<Integer> priorityList = getPriorityInOrder();
if (priorityList.size() == 0){
return new String[0];
}
int size = 0;
//获取总得图表格式
for (int i = 0; i < priorityList.size(); i++) {
size += getChartSize(String.valueOf(priorityList.get(i)));
}
String[] names = new String[size];
int index = 0;
for (int i = 0; i < priorityList.size(); i++){
String priority = String.valueOf(priorityList.get(i));
Iterator chartUI = chartTypeInterfaces.get(priority).entrySet().iterator();
index = fetchNames(chartUI, names, index);
}
return names;
}
private List<Integer> getPriorityInOrder() {
List<Integer> priorityList = new ArrayList<Integer>();
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue();
paneList.add(creator.getPlotTypePane());
String priority = (String) entry.getKey();
priorityList.add(Integer.valueOf(priority));
}
}
return ChartTypeManager.orderInPriority(priorityList);
}
private int fetchNames(Iterator chartUI, String[] names, int index) {
while (chartUI.hasNext()) {
Map.Entry chartUIEntry = (Map.Entry) chartUI.next();
IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue();
names[index++] = provider.getPlotTypePane().title4PopupWindow();
}
return index;
}
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) {
return chartTypeInterfaces.get(plotID).getChartDataPane(listener);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plotID, priority)) {
return getChartDataPane(priority, plotID, listener);
}
}
return getChartDataPane(ChartTypeManager.CHART_PRIORITY, plotID, listener);
}
private ChartDataPane getChartDataPane(String priority, String plotID, AttributeChangeListener listener) {
return chartTypeInterfaces.get(priority).get(plotID).getChartDataPane(listener);
}
/**
* 获取对应ID的图表数量
* @param key
* @return
*/
private int getChartSize(String key){
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(key)){
return chartTypeInterfaces.get(key).size();
}
return 0;
}
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) {
return chartTypeInterfaces.get(plotID).getAttrPaneArray(listener);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plotID, priority)) {
return getAttrPaneArray(priority, plotID, listener);
}
}
return getAttrPaneArray(ChartTypeManager.CHART_PRIORITY, plotID, listener);
}
private AbstractChartAttrPane[] getAttrPaneArray(String priority, String plotID, AttributeChangeListener listener) {
return chartTypeInterfaces.get(priority).get(plotID).getAttrPaneArray(listener);
}
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(plot.getPlotID()).getTableDataSourcePane(plot, parent);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plot.getPlotID(), priority)) {
return getTableDataSourcePane(priority, plot, parent);
}
}
return getTableDataSourcePane(ChartTypeManager.CHART_PRIORITY, plot, parent);
}
private AbstractTableDataContentPane getTableDataSourcePane(String priority, Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getTableDataSourcePane(plot, parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(plot.getPlotID()).getReportDataSourcePane(plot, parent);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
String plotID = plot.getPlotID();
if (plotInChart(plotID, priority)) {
return getReportDataSourcePane(priority, plot, parent);
}
}
return getReportDataSourcePane(ChartTypeManager.CHART_PRIORITY, plot, parent);
}
private boolean plotInChart(String plotID, String priority) {
return chartTypeInterfaces != null
&& chartTypeInterfaces.containsKey(priority)
&& chartTypeInterfaces.get(priority).containsKey(plotID);
}
private AbstractReportDataContentPane getReportDataSourcePane(String priority, Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getReportDataSourcePane(plot, parent);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return chartTypeInterfaces.get(plot.getPlotID()).getPlotConditionPane(plot);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plot.getPlotID(), priority)) {
return getPlotConditionPane(priority, plot);
}
}
return getPlotConditionPane(ChartTypeManager.CHART_PRIORITY, plot);
}
private ConditionAttributesPane getPlotConditionPane(String priority, Plot plot) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return chartTypeInterfaces.get(plot.getPlotID()).getPlotSeriesPane(parent, plot);
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (plotInChart(plot.getPlotID(), priority)) {
return getPlotSeriesPane(priority, parent, plot);
}
}
return getPlotSeriesPane(ChartTypeManager.CHART_PRIORITY, parent, plot);
}
private BasicBeanPane<Plot> getPlotSeriesPane(String priority, ChartStylePane parent, Plot plot) {
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotSeriesPane(parent, plot);
}
/**
@ -231,9 +452,22 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
* @return 是否使用默认的界面
*/
public boolean isUseDefaultPane(String plotID) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey();
if (chartTypeInterfaces.get(priority).containsKey(plotID)){
return isUseDefaultPane(priority, plotID);
}
}
return true;
}
private boolean isUseDefaultPane(String priority, String plotID){
if (chartTypeInterfaces.containsKey(plotID)) {
return chartTypeInterfaces.get(plotID).isUseDefaultPane();
if (chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) {
return chartTypeInterfaces.get(priority).get(plotID).isUseDefaultPane();
}
return true;
@ -251,7 +485,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
extraChartDesignInterfaceList.add(tagName);
}
if (IndependentChartUIProvider.XML_TAG.equals(tagName)) {
addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("plotID", ""), simplify);
addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("priority", ChartTypeManager.DEFAULT_PRIORITY),reader.getAttrAsString("plotID", ""), simplify);
}
}
}

2
designer_chart/src/com/fr/design/chart/ChartPlotFactory.java

@ -72,7 +72,7 @@ public class ChartPlotFactory {
.setAxisPaneCls(XYChartStyleAxisPane.class)
.setDataLabelPaneClass(XYDataLabelPane.class));
map.put(FunnelPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(PieDataLabelPane.class));
.setDataLabelPaneClass(FunnelDataLabelPane.class));
}
private ChartPlotFactory() {

2
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -15,7 +15,7 @@ import com.fr.general.ComparatorUtils;
* Created by Mitisky on 16/3/7.
*/
public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider {
private static final int OLD_PLUGIN_LEVEL = -2;
private static final int OLD_PLUGIN_LEVEL = 3;
@Override
//以前的插件没有覆写这个方法,所以始终获取到-2,比当前level低,提示更新.

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

@ -311,11 +311,11 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene
} else {
chartGlyph.setBounds(new Rectangle2D.Double(0, 0, chartWidth, chartHeight));
}
// chartGlyph.draw(g2d, ScreenResolution.getScreenResolution());
//不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单
//其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边
//处理画图事件
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this);
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution(), this, null);
g2d.drawImage(chartImage, 0, 0, null);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java

@ -6,8 +6,8 @@ import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DataSeries;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
/**
* Created by IntelliJ IDEA.
@ -36,7 +36,7 @@ public class DataSeriesActiveGlyph extends ActiveGlyph {
return;
}
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
}
@Override

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
public class SetAnalysisLineStyleAction extends ChartComponentAction{
@ -20,7 +20,7 @@ public class SetAnalysisLineStyleAction extends ChartComponentAction{
}
public void showAnalysisLineStylePane(){
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LINE_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LINE_TITLE);
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
@ -28,6 +28,6 @@ public class SetAxisStyleAction extends ChartComponentAction {
public void showAxisStylePane() {
String axisType = getActiveAxisGlyph() == null ? StringUtils.EMPTY : getActiveAxisGlyph().getAxisType();
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AXIS_TITLE, axisType);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AXIS_TITLE, axisType);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -26,6 +26,6 @@ public class SetChartStyleAciton extends ChartComponentAction {
}
public void showChartStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
public class SetDataLabelStyleAction extends ChartComponentAction{
@ -20,7 +20,7 @@ public class SetDataLabelStyleAction extends ChartComponentAction{
}
public void showDataLabelStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LABEL_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LABEL_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSeriesAttrAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -21,6 +21,6 @@ public class SetDataSeriesAttrAction extends ChartComponentAction {
}
public void actionPerformed(ActionEvent e) {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSheetAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -28,6 +28,6 @@ public class SetDataSheetAction extends ChartComponentAction {
}
public void showDataSheetStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_DATA_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_DATA_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -27,6 +27,6 @@ public class SetLegendStyleAction extends ChartComponentAction {
}
public void showLegendStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LEGNED_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LEGNED_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -27,6 +27,6 @@ public class SetPlotStyleAction extends ChartComponentAction {
}
public void showPlotPane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE);
}
}

4
designer_chart/src/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java

@ -3,8 +3,8 @@ package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
/**
@ -27,6 +27,6 @@ public class SetTitleStyleAction extends ChartComponentAction {
}
public void showTitlePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_TITLE_TITLE);
DesignModuleFactory.getChartPropertyPane().getChartEditPane().gotoPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_TITLE_TITLE);
}
}

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

@ -194,8 +194,13 @@ refreshAreaNameBox();
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
Object oldSelected = areaString.getSelectedItem();
areaString.removeAllItems();
areaString.setItemList(columnNameList);
for(String item : columnNameList) {
areaString.addItem(item);
}
areaString.getModel().setSelectedItem(oldSelected);
}
/**

13
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -27,13 +27,22 @@ import java.util.Iterator;
* Time : 上午9:16
*/
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
protected Plot plot;
public DataSeriesConditionPane() {
public DataSeriesConditionPane(Plot plot) {
this.plot = plot;
initAvailableActionList();
initComponents();
}
public void setPlot(Plot plot) {
this.plot = plot;
}
public DataSeriesConditionPane() {
this(null);
}
private void initAvailableActionList() {
addBasicAction();
addAxisPositionAction();

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

@ -1,28 +1,23 @@
package com.fr.design.chart.series.SeriesCondition;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Format;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.style.FormatPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.style.FormatPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.Format;
/**
* 数据点提示内容面板包含系列值系列百分比
@ -58,7 +53,7 @@ public class TooltipContentsPane extends BasicPane{
protected JPanel createJPanel4Value() {
if (showValueCB == null) {
showValueCB = new UICheckBox(Inter.getLocText("Value"));
showValueCB = new UICheckBox(getValueString());
}
showValueCB.setSelected(true);
@ -75,7 +70,9 @@ public class TooltipContentsPane extends BasicPane{
return valuePane;
}
protected String getValueString() {
return Inter.getLocText("Value");
}
protected Component[] createComponents4PercentValue() {
if (showPercent == null) {

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

@ -1,12 +1,5 @@
package com.fr.design.chart.series.SeriesCondition.dlp;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import com.fr.base.Utils;
import com.fr.chart.base.AttrContents;
import com.fr.chart.base.ChartConstants;
@ -21,6 +14,9 @@ import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
@ -80,11 +76,14 @@ public class DataLabelPane extends TooltipContentsPane {
protected Component[] createComponents4ShowCategoryName() {
if (showCategoryNameCB == null) {
showCategoryNameCB = new UICheckBox(Inter.getLocText(new String[]{"StyleFormat-Category", "WF-Name"}));
showCategoryNameCB = new UICheckBox(getCategoryString());
}
return new Component[]{null, showCategoryNameCB};
}
protected String getCategoryString(){
return Inter.getLocText(new String[]{"StyleFormat-Category", "WF-Name"});
}
protected Component[] createComponents4ShowGuidLine() {

13
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/FunnelDataLabelPane.java

@ -0,0 +1,13 @@
package com.fr.design.chart.series.SeriesCondition.dlp;
import java.awt.*;
/**
* Created by Mitisky on 16/11/9.
*/
public class FunnelDataLabelPane extends DataLabelPane {
@Override
protected Component[] createComponents4ShowCategoryName() {
return new Component[0];
}
}

18
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MapDataLabelPane.java

@ -1,6 +1,9 @@
package com.fr.design.chart.series.SeriesCondition.dlp;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
@ -13,6 +16,21 @@ import javax.swing.*;
*/
public class MapDataLabelPane extends DataLabelPane {
@Override
protected Component[] createComponents4ShowSeriesName() {
return new Component[0];
}
@Override
protected String getCategoryString() {
return Inter.getLocText("FR-Chart-Area_Name");
}
@Override
protected String getValueString() {
return Inter.getLocText("FR-Chart-Area_Value");
}
protected JPanel createJPanel4Position() {
return null;
}

4
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java

@ -13,8 +13,8 @@ import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.ChartHyperEditPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
@ -130,7 +130,7 @@ public class ChartHyperPoplinkPane extends BasicBeanPane<ChartHyperPoplink> {
hyperEditPane.updateHyperLink(chartHyperlink);
chartHyperlink.setChartCollection(chartComponent.update());
ChartEditPane.getInstance().fire();// 响应整个图表保存事件等.
DesignModuleFactory.getChartPropertyPane().getChartEditPane().fire();// 响应整个图表保存事件等.
if(itemNameTextField != null){
chartHyperlink.setItemName(this.itemNameTextField.getText());
}

28
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FunnelPlotDataSeriesConditionPane.java

@ -0,0 +1,28 @@
package com.fr.design.chart.series.SeriesCondition.impl;
import com.fr.chart.chartattr.FunnelPlot;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.PiePlotChartConditionPane;
/**
* Created by Mitisky on 16/11/9.
*/
public class FunnelPlotDataSeriesConditionPane extends DataSeriesConditionPane {
@Override
protected ChartConditionPane createListConditionPane() {
return new PiePlotChartConditionPane();
}
/**
* 返回class对象
* @return class对象
*/
@Override
public Class<? extends Plot> class4Correspond() {
return FunnelPlot.class;
}
}

6
designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java

@ -3,6 +3,8 @@ package com.fr.design.chartinterface;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.impl.AbstractIndependentChartUIWithAPILevel;
import com.fr.design.chart.series.SeriesCondition.impl.FunnelPlotDataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
@ -34,6 +36,10 @@ public class FunnelIndependentChartInterface extends AbstractIndependentChartUIW
return new FunnelSeriesPane(parent, plot);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new FunnelPlotDataSeriesConditionPane();
}
/**
*图标路径
* @return 图标路径

143
designer_chart/src/com/fr/design/mainframe/ChartAndWidgetPropertyPane.java

@ -1,143 +0,0 @@
/*
* Copyright(c) 2001-2011, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe;
import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.module.DesignModuleFactory;
import com.fr.general.Inter;
public class ChartAndWidgetPropertyPane extends MiddleChartPropertyPane {
public synchronized static ChartAndWidgetPropertyPane getInstance(BaseFormDesigner formEditor) {
if(singleton == null) {
singleton = new ChartAndWidgetPropertyPane(formEditor);
}
singleton.setWidgetPropertyPane(DesignModuleFactory.getWidgetPropertyPane(formEditor));
singleton.setSureProperty();
return singleton;
}
public static ChartAndWidgetPropertyPane getInstance() {
if(singleton == null) {
singleton = new ChartAndWidgetPropertyPane();
}
return singleton;
}
private static ChartAndWidgetPropertyPane singleton;
private BaseWidgetPropertyPane widgetpane = null;
private UIToggleButton hisButton;
public ChartAndWidgetPropertyPane() {
}
public ChartAndWidgetPropertyPane(BaseFormDesigner formEditor) {
super();
this.widgetpane = DesignModuleFactory.getWidgetPropertyPane(formEditor);
}
public void setWidgetPropertyPane(BaseWidgetPropertyPane pane) {
this.widgetpane = pane;
}
@Override
protected void createMainPane() {
this.add(chartEditPane, BorderLayout.CENTER);
}
@Override
protected void createNameLabel() {
nameLabel = new UILabel();
nameLabel.setHorizontalAlignment(SwingConstants.LEFT);
nameLabel.setBorder(BorderFactory.createEmptyBorder(-2, 6, 2, 0));
}
@Override
protected JComponent createNorthComponent() {
JPanel toolPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel hisPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
hisPane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
hisButton = new UIToggleButton(Inter.getLocText(new String[]{"Widget", "Attribute"}), UIConstants.HISTORY_ICON);
hisButton.setNormalPainted(false);
hisButton.setBorderPaintedOnlyWhenPressed(true);
hisPane.add(hisButton, BorderLayout.CENTER);
hisButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
cardChange();
}
});
toolPane.add(nameLabel, BorderLayout.CENTER);
toolPane.add(hisPane, BorderLayout.EAST);
titleListener = new TitleChangeListener() {
@Override
public void fireTitleChange(String addName) {
if(hisButton.isSelected()) {
nameLabel.setText(Inter.getLocText(new String[]{"Widget", "Form-Widget_Property_Table"}));
}else {
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName);
}
}
};
return toolPane;
}
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param ePane 面板
*/
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) {
super.populateChartPropertyPane(collection, ePane);
//表单中的图表切换界面上得更新
resetChartEditPane();
}
protected void resetChartEditPane() {
cardChange();
}
private void cardChange() {
remove(chartEditPane);
remove((Component)widgetpane);
if(hisButton.isSelected()) {
nameLabel.setText(Inter.getLocText(new String[]{"Widget", "Form-Widget_Property_Table"}));
add((Component)widgetpane, BorderLayout.CENTER);
} else {
String tabname = chartEditPane.getSelectedTabName();
nameLabel.setText(Inter.getLocText(new String[]{"Utils-The-Chart", "Form-Widget_Property_Table"}) + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : ""));
add(chartEditPane, BorderLayout.CENTER);
}
validate();
repaint();
revalidate();
}
}

34
designer_chart/src/com/fr/design/mainframe/ChartDesigner.java

@ -29,40 +29,13 @@ public class ChartDesigner extends TargetComponent<ChartBook> implements MouseL
private ChartArea chartArea;//上层区域
private boolean hasCalGap = false;
private ChartDesignerUI designerUI;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private ChartToolBarPane chartToolBarPane;
public ChartDesigner(ChartBook chartBook) {
super(chartBook);
this.addMouseListener(this);
designerUI = new ChartDesignerUI();
chartToolBarPane = new ChartToolBarPane(this){
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
return new Dimension(size.width, ChartToolBarPane.TOTAL_HEIGHT);
}
};
this.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseMoved(MouseEvent e) {
if(designerUI!=null){
designerUI.mouseMoved(e);
ChartDesigner.this.repaint();
}
}
});
updateUI();// 初始化界面设计工具的UI实例
}
/**
* 设置其UI类为DesignerUI负责渲染
*/
@Override
public void updateUI() {
setUI(designerUI);
}
/**
* 设置上层区域
* @param chartArea 图表区域
@ -203,8 +176,6 @@ public class ChartDesigner extends TargetComponent<ChartBook> implements MouseL
* @param e 事件
*/
public void mouseClicked(MouseEvent e) {
designerUI.mouseClicked(e);
this.chartToolBarPane.populate();
}
/**
@ -247,18 +218,13 @@ public class ChartDesigner extends TargetComponent<ChartBook> implements MouseL
this.changeListeners.add(changeListener);
}
public ChartToolBarPane getChartToolBarPane(){
return this.chartToolBarPane;
}
public void populate(){
this.chartToolBarPane.populate();
}
/**
* 清除工具栏上面全局风格按钮的选中
*/
public void clearToolBarStyleChoose(){
chartToolBarPane.clearStyleChoose();
}
}

134
designer_chart/src/com/fr/design/mainframe/ChartDesignerPropertyPane.java

@ -1,134 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartDesignEditPane;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 下午12:43
*/
public class ChartDesignerPropertyPane extends BaseChartPropertyPane {
private static ChartDesignerPropertyPane instance;
private TargetComponentContainer container = new TargetComponentContainer();
private ChartEditPane chartEditPane;
private UILabel nameLabel;
private TitleChangeListener titleListener = new TitleChangeListener() {
@Override
public void fireTitleChange(String addName) {
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName);
}
};
public synchronized static ChartDesignerPropertyPane getInstance() {
if (instance == null) {
instance = new ChartDesignerPropertyPane();
}
instance.setSureProperty();
return instance;
}
public ChartDesignerPropertyPane() {
this.setLayout(new BorderLayout());
this.setBorder(null);
createNameLabel();
this.add(nameLabel, BorderLayout.NORTH);
chartEditPane = ChartDesignEditPane.getInstance();
this.add(chartEditPane, BorderLayout.CENTER);
}
private void createNameLabel() {
nameLabel = new UILabel() {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 18);
}
};
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0));
nameLabel.setHorizontalAlignment(SwingConstants.CENTER);
}
@Override
public void setSureProperty() {
chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener);
String tabname = chartEditPane.getSelectedTabName();
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : ""));
resetChartEditPane();
}
protected void resetChartEditPane() {
remove(chartEditPane);
add(chartEditPane, BorderLayout.CENTER);
validate();
repaint();
revalidate();
}
@Override
public void setSupportCellData(boolean supportCellData){
}
/**
* 感觉ChartCollection加载图表属性界面.
* @param collection 收集图表
* @param chartDesigner 图表设计
*/
public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> chartDesigner) {
if (collection instanceof ChartCollection) {
this.container.setEPane(chartDesigner);
chartEditPane.populate((ChartCollection) collection);
}
}
@Override
public void setWidgetPropertyPane(BaseWidgetPropertyPane pane) {
}
/**
* 刷新
*/
public void refreshDockingView() {
}
@Override
public String getViewTitle() {
return null;
}
@Override
public Icon getViewIcon() {
return null;
}
/**
* 位置
* @return 位置
*/
public Location preferredLocation() {
return null;
}
}

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

@ -17,7 +17,7 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{
/**
* 创建图表属性表实例.
*/
public synchronized static ChartPropertyPane getInstance() {
private synchronized static ChartPropertyPane getInstance() {
if(singleton == null) {
singleton = new ChartPropertyPane();
}
@ -50,8 +50,7 @@ public class ChartPropertyPane extends MiddleChartPropertyPane{
return nameLabel;
}
@Override
public void setWidgetPropertyPane(BaseWidgetPropertyPane pane) {
public synchronized static void clear() {
singleton = null;
}
}

47
designer_chart/src/com/fr/design/mainframe/ChartUndoState.java

@ -1,47 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe;
import com.fr.form.ui.ChartBook;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-13
* Time: 下午2:32
*/
public class ChartUndoState extends BaseUndoState<JChart> {
private ChartBook chartBook;
private Dimension designerSize;
private double widthValue;
private double heightValue;
public ChartUndoState(JChart t,ChartArea area) {
super(t);
try {
this.chartBook = (ChartBook) t.getTarget().clone();
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
this.widthValue =area.getCustomWidth();
this.heightValue = area.getCustomHeight();
}
public ChartBook getChartBook(){
return this.chartBook;
}
/**
* 应用状态
*/
public void applyState() {
this.getApplyTarget().applyUndoState(this);
}
}

376
designer_chart/src/com/fr/design/mainframe/JChart.java

@ -1,376 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
* 图表类型文件
*/
package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.file.FILEChooserPane;
import com.fr.file.FILEChooserPane4Chart;
import com.fr.form.ui.ChartBook;
import com.fr.design.DesignModelAdapter;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.actions.ExcelExportAction4Chart;
import com.fr.design.mainframe.actions.PDFExportAction4Chart;
import com.fr.design.mainframe.actions.PNGExportAction4Chart;
import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.file.FILE;
import com.fr.general.Inter;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.datatransfer.StringSelection;
/**
* 图表crt文件
* <p/>
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-13
* Time: 下午2:28
*/
public class JChart extends JTemplate<ChartBook, ChartUndoState> {
public static final String XML_TAG = "JChart";
private static final String CHART_CARD = "FORM";
private static final String ELEMENTCASE_CARD = "ELEMENTCASE";
private static final String[] CARDNAME = new String[]{CHART_CARD, ELEMENTCASE_CARD};
private static final int TOOLBARPANEDIMHEIGHT_FORM = 60;
//图表设计器
ChartDesigner chartDesigner;
//中间编辑区域, carllayout布局
private JPanel tabCenterPane;
private CardLayout cardLayout;
//当前编辑的组件对象
private JComponent editingComponent;
private FormECCompositeProvider reportComposite;
public JChart() {
super(new ChartBook(), "Chart");
}
public JChart(ChartBook chartFile, FILE file) {
super(chartFile, file);
}
@Override
protected JPanel createCenterPane() {
tabCenterPane = FRGUIPaneFactory.createCardLayout_S_Pane();
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, new Color(85, 85, 85)));
chartDesigner = new ChartDesigner(this.getTarget());
ChartArea area = new ChartArea(chartDesigner);
centerPane.add(area, BorderLayout.CENTER);
tabCenterPane.add(centerPane, CHART_CARD, 0);
chartDesigner.addTargetModifiedListener(new TargetModifiedListener() {
public void targetModified(TargetModifiedEvent e) {
JChart.this.fireTargetModified();// 调用保存*, 调用刷新界面, 刷新工具栏按钮
}
});
this.add(tabCenterPane, BorderLayout.CENTER);
return tabCenterPane;
}
/**
* 移除选择
*/
public void removeTemplateSelection() {
}
/**
* 刷新容器
*/
public void refreshContainer() {
}
/**
* 移除参数面板选择
*/
public void removeParameterPaneSelection() {
}
/**
* 创建设计模式
*
* @return 返回模式
*/
protected DesignModelAdapter<ChartBook, ?> createDesignModel() {
return null;
}
/**
* 创建预览得菜单
*
* @return 菜单
*/
public UIMenuItem[] createMenuItem4Preview() {
return new UIMenuItem[0];
}
/**
* 创建撤销状态
*
* @return 状态
*/
protected ChartUndoState createUndoState() {
return new ChartUndoState(this,chartDesigner.getArea());
}
/**
* 应用撤销状态
*
* @param chartUndoState 撤销状态
*/
protected void applyUndoState(ChartUndoState chartUndoState) {
try {
this.setTarget((ChartBook)chartUndoState.getChartBook().clone());
chartDesigner.setTarget(this.getTarget());
chartDesigner.populate();
}catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
/**
* 后缀
*
* @return 后缀
*/
public String suffix() {
return ".crt";
}
/**
* 复制
*/
public void copy() {
}
/**
* 黏贴
*
* @return 是否鸟贴成功
*/
public boolean paste() {
return false;
}
/**
* 是否剪切
*
* @return 剪切成功
*/
public boolean cut() {
return false;
}
/**
* 创建权限编辑面板
*
* @return 面板
*/
public AuthorityEditPane createAuthorityEditPane() {
return null;
}
/**
* 工具栏
*
* @return 工具栏
*/
public ToolBarMenuDockPlus getToolBarMenuDockPlus() {
return null;
}
/**
* 东上面板
*
* @return 面板
*/
public JPanel getEastUpPane() {
return null;
}
/**
* 东下面板
*
* @return 面板
*/
public JPanel getEastDownPane() {
return null;
}
/**
* 工具栏菜单
*
* @return 菜单
*/
public ToolBarDef[] toolbars4Target() {
return new ToolBarDef[0];
}
/**
* 表单面板
*
* @return 面板
*/
public JPanel[] toolbarPanes4Form() {
return new JPanel[0];
}
/**
* 模版菜单
*
* @return 模版菜单
*/
public ShortCut[] shortcut4TemplateMenu() {
return new ShortCut[0];
}
/**
* 权限编辑菜单
*
* @return 菜单
*/
public ShortCut[] shortCuts4Authority() {
return new ShortCut[0];
}
/**
* 工具条表单
*
* @return 表单
*/
public JComponent[] toolBarButton4Form() {
return new JComponent[0];
}
/**
* 权限编辑工具栏,但是图表设计器里面用于正常工具栏不是全县编辑
*
* @return 工具条
*/
public JComponent toolBar4Authority() {
return chartDesigner.getChartToolBarPane();
}
/**
* 工具条高度
*
* @return 工具条高度
*/
public int getToolBarHeight() {
return 0;
}
/**
* 是否是报表
*
* @return 不是
*/
public boolean isJWorkBook() {
return false;
}
/**
* 是否是图表
*
* @return 是则返回true
*/
public boolean isChartBook() {
return true;
}
/**
* 设置权限编辑模式
*
* @param isUpMode 没有权限编辑
*/
public void setAuthorityMode(boolean isUpMode) {
}
/**
* 刷新工具区域
*/
public void refreshToolArea() {
DesignerContext.getDesignerFrame().resetToolkitByPlus(JChart.this);
chartDesigner.populate();
ChartDesignerPropertyPane.getInstance().populateChartPropertyPane(getTarget().getChartCollection(), chartDesigner);
EastRegionContainerPane.getInstance().replaceUpPane(ChartDesignerPropertyPane.getInstance());
}
/**
* 导出菜单的子菜单 目前用于图表设计器
*
* @return 子菜单
*/
public ShortCut[] shortcut4ExportMenu() {
return new ShortCut[]{new PNGExportAction4Chart(this), new ExcelExportAction4Chart(this), new PDFExportAction4Chart(this)};
}
public Icon getIcon() {
return BaseUtils.readIcon("/com/fr/design/images/chart.png");
}
public ChartDesigner getChartDesigner(){
return chartDesigner;
}
/**
* 复制JS代码
*/
public void copyJS(){
JSONObject jsonObject =this.getTarget().createExportConfig();
String jsonString = StringUtils.EMPTY;
if(jsonObject != null){
try{
if(jsonObject.has("charts")){
JSONArray charts = jsonObject.getJSONArray("charts");
jsonString = charts.toString(2);
}else{
jsonString = jsonObject.toString(2);
}
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Message"), Inter.getLocText("FR-Chart-Action_Copy")+"JS", JOptionPane.INFORMATION_MESSAGE);
}catch (JSONException ex){
FRContext.getLogger().error(ex.getMessage());
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Failed")+"!", Inter.getLocText("Error"), JOptionPane.ERROR_MESSAGE);
}
}else{
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Failed")+"!", Inter.getLocText("Error"), JOptionPane.ERROR_MESSAGE);
}
StringSelection stringSelection = new StringSelection(jsonString);
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null);
};
/**
* 系列风格改动
*/
public void styleChange(){
chartDesigner.clearToolBarStyleChoose();
}
protected FILEChooserPane getFILEChooserPane(boolean isShowLoc){
return new FILEChooserPane4Chart(true, isShowLoc);
}
}

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

@ -13,11 +13,13 @@ import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.gui.chart.ChartEditPaneProvider;
import com.fr.design.gui.frpane.UITitlePanel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itabpane.TitleChangeListener;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
@ -37,7 +39,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
createNameLabel();
this.add(createNorthComponent(), BorderLayout.NORTH);
chartEditPane = ChartEditPane.getInstance();
chartEditPane = StableUtils.construct(ChartEditPane.class);
chartEditPane.setSupportCellData(true);
this.createMainPane();
}
@ -48,6 +50,12 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
protected abstract void createMainPane();
@Override
public ChartEditPaneProvider getChartEditPane() {
return chartEditPane;
}
public void setSureProperty() {
chartEditPane.setContainer(container);
chartEditPane.addTitleChangeListener(titleListener);
@ -93,6 +101,12 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{
}
}
// public void clear() {
// this.container.setEPane(null);
// chartEditPane.clear();
// getParent().remove(this);
// }
/**
* 返回View的标题.
*/

132
designer_chart/src/com/fr/design/mainframe/actions/AbstractExportAction4JChart.java

@ -1,132 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.base.FRContext;
import com.fr.design.gui.iprogressbar.FRProgressBar;
import com.fr.form.ui.ChartBook;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.JChart;
import com.fr.design.mainframe.exporter.Exporter4Chart;
import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.FileOutputStream;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 上午9:48
*/
public abstract class AbstractExportAction4JChart extends JChartAction {
protected AbstractExportAction4JChart(JChart chart){
super(chart);
}
private FRProgressBar progressbar;
protected ChartBook getChartBook(){
return this.getEditingComponent().getTarget();
}
/**
* 执行方法
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
JChart chart = this.getEditingComponent();
FILE editingFILE = chart.getEditingFILE();
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
// 弹出参数
final java.util.Map parameterMap = new java.util.HashMap();
final ChartBook chartBook = getChartBook();
// Choose a file name....
FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(false, true);
fileChooserPane.setFILEFilter(this.getChooseFileFilter());
// 打开文件后输出文件名修改,eg:w.cpt.doc / w.svg.doc,去掉中间的后缀名~~ w.doc
String filenName = editingFILE.getName();
if (filenName.indexOf('.') != -1) {
filenName = filenName.substring(0, editingFILE.getName().lastIndexOf('.'));
}
fileChooserPane.setFileNameTextField(filenName, "." + this.getDefaultExtension());
int saveValue = fileChooserPane.showSaveDialog(designerFrame, "." + this.getDefaultExtension());
if (saveValue == FILEChooserPane.CANCEL_OPTION || saveValue == FILEChooserPane.JOPTIONPANE_CANCEL_OPTION) {
fileChooserPane = null;
return;
} else if (saveValue == FILEChooserPane.JOPTIONPANE_OK_OPTION || saveValue == FILEChooserPane.OK_OPTION) {
FILE file = fileChooserPane.getSelectedFILE();
try {
file.mkfile();
} catch (Exception e1) {
FRLogger.getLogger().error("Error In Make New File");
}
fileChooserPane = null;
FRContext.getLogger().info("\"" + file.getName() + "\"" + Inter.getLocText("Prepare_Export") + "!");
(progressbar = new FRProgressBar(createExportWork(file, chartBook), designerFrame,
Inter.getLocText("Exporting"), "", 0, 100)).start();
}
}
private SwingWorker createExportWork(FILE file, final ChartBook chartBook) {
final String filePath = file.getPath();
final String fileGetName = file.getName();
SwingWorker exportWorker = new SwingWorker<Void, Void>() {
protected Void doInBackground() throws Exception {
Thread.sleep(100); //bug 10516
try {
final FileOutputStream fileOutputStream = new FileOutputStream(filePath);
this.setProgress(10);
dealExporter(fileOutputStream,chartBook);
this.setProgress(80);
fileOutputStream.close();
this.setProgress(100);
FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("Finish_Export") + "!");
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Inter.getLocText("Exported_successfully") + "\n" + filePath);
} catch (Exception exp) {
this.setProgress(100);
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Export_failed") + "\n" + filePath);
}
return null;
}
public void done() {
progressbar.close();
}
};
return exportWorker;
}
private void dealExporter(FileOutputStream fileOutputStream, final ChartBook chartBook) throws Exception {
final Exporter4Chart exporter = AbstractExportAction4JChart.this.getExporter();
exporter.export(fileOutputStream,this.getEditingComponent());
}
protected abstract ChooseFileFilter getChooseFileFilter();
protected abstract String getDefaultExtension();
protected abstract Exporter4Chart getExporter();
}

68
designer_chart/src/com/fr/design/mainframe/actions/ExcelExportAction4Chart.java

@ -1,68 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.base.ExcelUtils;
import com.fr.design.mainframe.JChart;
import com.fr.design.mainframe.exporter.ExcelExporter4Chart;
import com.fr.design.mainframe.exporter.Exporter4Chart;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.KeyEvent;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 上午9:52
*/
public class ExcelExportAction4Chart extends AbstractExportAction4JChart {
private MenuKeySet excel= new MenuKeySet() {
@Override
public char getMnemonic() {
return 'E';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Chart-Format_Excel");
}
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK);
}
};
public ExcelExportAction4Chart(JChart chart) {
super(chart);
this.setMenuKeySet(excel);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png"));
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"xls", "xlsx"}, Inter.getLocText("Export-Excel"));
}
@Override
protected String getDefaultExtension() {
return ExcelUtils.checkThirdJarSupportPOI() ? "xlsx" : "xls";
}
@Override
protected Exporter4Chart getExporter() {
return new ExcelExporter4Chart();
}
}

21
designer_chart/src/com/fr/design/mainframe/actions/JChartAction.java

@ -1,21 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.mainframe.JChart;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 上午9:47
*/
public abstract class JChartAction extends JTemplateAction<JChart> {
public JChartAction(JChart jChart) {
super(jChart);
}
}

61
designer_chart/src/com/fr/design/mainframe/actions/NewChartAction.java

@ -1,61 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JChart;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-13
* Time: 下午3:22
*/
public class NewChartAction extends UpdateAction{
public NewChartAction(){
this.setMenuKeySet(NEW_CHART);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/newchart_normal.png"));
this.setAccelerator(getMenuKeySet().getKeyStroke());
}
/**
* 执行事件
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JChart());
}
public static final MenuKeySet NEW_CHART = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'F';
}
@Override
public String getMenuName() {
return Inter.getLocText("M-New_ChartBook");
}
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK);
}
};
}

65
designer_chart/src/com/fr/design/mainframe/actions/PDFExportAction4Chart.java

@ -1,65 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JChart;
import com.fr.design.mainframe.exporter.Exporter4Chart;
import com.fr.design.mainframe.exporter.PdfExporter4Chart;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 上午10:16
*/
public class PDFExportAction4Chart extends AbstractExportAction4JChart {
private MenuKeySet pdf = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'P';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Chart-Format_PDF");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
public PDFExportAction4Chart(JChart chart) {
super(chart);
this.setMenuKeySet(pdf);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pdf.png"));
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"pdf"}, Inter.getLocText("Export-PDF"));
}
@Override
protected String getDefaultExtension() {
return "pdf";
}
@Override
protected Exporter4Chart getExporter() {
return new PdfExporter4Chart();
}
}

66
designer_chart/src/com/fr/design/mainframe/actions/PNGExportAction4Chart.java

@ -1,66 +0,0 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JChart;
import com.fr.design.mainframe.exporter.Exporter4Chart;
import com.fr.design.mainframe.exporter.ImageExporter4Chart;
import com.fr.design.menu.MenuKeySet;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.KeyEvent;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 6.5.6
* Date: 14-10-15
* Time: 上午10:18
*/
public class PNGExportAction4Chart extends AbstractExportAction4JChart {
private MenuKeySet menuSet = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'M';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Chart-Format_Image");
}
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK);
}
};
public PNGExportAction4Chart(JChart chart) {
super(chart);
this.setMenuKeySet(menuSet);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/exportimg.png"));
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"png"}, Inter.getLocText("Image"));
}
@Override
protected String getDefaultExtension() {
return "png";
}
@Override
protected Exporter4Chart getExporter() {
return new ImageExporter4Chart();
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save