Browse Source

移动到design中

master
svnadmin 9 years ago
parent
commit
16d66cfb14
  1. 457
      .gitattributes
  2. 1
      .gitignore
  3. 52
      designer/.classpath
  4. 1
      designer/.project
  5. 21
      designer/designer.iml
  6. 56
      designer/src/com/fr/design/actions/ButtonGroupAction.java
  7. 34
      designer/src/com/fr/design/actions/CellSelectionAction.java
  8. 33
      designer/src/com/fr/design/actions/ElementCaseAction.java
  9. 37
      designer/src/com/fr/design/actions/FloatSelectionAction.java
  10. 9
      designer/src/com/fr/design/actions/JWorkBookAction.java
  11. 26
      designer/src/com/fr/design/actions/PresentCheckBoxAction.java
  12. 9
      designer/src/com/fr/design/actions/ReportComponentAction.java
  13. 100
      designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java
  14. 85
      designer/src/com/fr/design/actions/cell/BorderAction.java
  15. 22
      designer/src/com/fr/design/actions/cell/CellAttributeAction.java
  16. 23
      designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java
  17. 24
      designer/src/com/fr/design/actions/cell/CellExpandAttrAction.java
  18. 72
      designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java
  19. 1
      designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java
  20. 37
      designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java
  21. 41
      designer/src/com/fr/design/actions/cell/EditCellAction.java
  22. 52
      designer/src/com/fr/design/actions/cell/FloatStyleAction.java
  23. 153
      designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java
  24. 84
      designer/src/com/fr/design/actions/cell/NewPresentAction.java
  25. 33
      designer/src/com/fr/design/actions/cell/StyleAction.java
  26. 308
      designer/src/com/fr/design/actions/cell/UIToolbarBorderButton.java
  27. 82
      designer/src/com/fr/design/actions/cell/style/AbstractStyleAction.java
  28. 111
      designer/src/com/fr/design/actions/cell/style/AlignmentAction.java
  29. 91
      designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java
  30. 68
      designer/src/com/fr/design/actions/cell/style/ReportFontForegroundAction.java
  31. 39
      designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java
  32. 104
      designer/src/com/fr/design/actions/cell/style/ReportFontNameAction.java
  33. 127
      designer/src/com/fr/design/actions/cell/style/ReportFontSizeAction.java
  34. 38
      designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java
  35. 17
      designer/src/com/fr/design/actions/cell/style/StyleActionInterface.java
  36. 77
      designer/src/com/fr/design/actions/cell/style/StyleBackgroundAction.java
  37. 20
      designer/src/com/fr/design/actions/columnrow/AbstractColumnRowIndexAction.java
  38. 38
      designer/src/com/fr/design/actions/columnrow/CancelColumnAction.java
  39. 40
      designer/src/com/fr/design/actions/columnrow/CancelRowAction.java
  40. 29
      designer/src/com/fr/design/actions/columnrow/ColumnHideAction.java
  41. 47
      designer/src/com/fr/design/actions/columnrow/ColumnRowRepeatAction.java
  42. 120
      designer/src/com/fr/design/actions/columnrow/ColumnRowSizingAction.java
  43. 46
      designer/src/com/fr/design/actions/columnrow/ColumnWidthAction.java
  44. 36
      designer/src/com/fr/design/actions/columnrow/DSColumnAdvancedAction.java
  45. 88
      designer/src/com/fr/design/actions/columnrow/DSColumnBasicAction.java
  46. 36
      designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java
  47. 62
      designer/src/com/fr/design/actions/columnrow/DeleteColumnAction.java
  48. 63
      designer/src/com/fr/design/actions/columnrow/DeleteRowAction.java
  49. 24
      designer/src/com/fr/design/actions/columnrow/FootColumnAction.java
  50. 23
      designer/src/com/fr/design/actions/columnrow/FootRowAction.java
  51. 23
      designer/src/com/fr/design/actions/columnrow/HeadColumnAction.java
  52. 24
      designer/src/com/fr/design/actions/columnrow/HeadRowAction.java
  53. 62
      designer/src/com/fr/design/actions/columnrow/InsertColumnAction.java
  54. 62
      designer/src/com/fr/design/actions/columnrow/InsertRowAction.java
  55. 57
      designer/src/com/fr/design/actions/columnrow/ResetColumnHideAction.java
  56. 57
      designer/src/com/fr/design/actions/columnrow/ResetRowHideAction.java
  57. 47
      designer/src/com/fr/design/actions/columnrow/RowHeightAction.java
  58. 29
      designer/src/com/fr/design/actions/columnrow/RowHideAction.java
  59. 33
      designer/src/com/fr/design/actions/edit/DeleteAction.java
  60. 70
      designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java
  61. 113
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  62. 17
      designer/src/com/fr/design/actions/edit/clear/ClearAction.java
  63. 31
      designer/src/com/fr/design/actions/edit/clear/ClearAllAction.java
  64. 31
      designer/src/com/fr/design/actions/edit/clear/ClearContentsAction.java
  65. 31
      designer/src/com/fr/design/actions/edit/clear/ClearFormatsAction.java
  66. 27
      designer/src/com/fr/design/actions/edit/clear/ClearWidgetAction.java
  67. 46
      designer/src/com/fr/design/actions/edit/merge/MergeCellAction.java
  68. 45
      designer/src/com/fr/design/actions/edit/merge/UnmergeCellAction.java
  69. 31
      designer/src/com/fr/design/actions/edit/order/AbstractFloatElementOrderAction.java
  70. 32
      designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java
  71. 32
      designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java
  72. 33
      designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java
  73. 32
      designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java
  74. 42
      designer/src/com/fr/design/actions/file/export/AbstractExcelExportAction.java
  75. 184
      designer/src/com/fr/design/actions/file/export/AbstractExportAction.java
  76. 55
      designer/src/com/fr/design/actions/file/export/CSVExportAction.java
  77. 42
      designer/src/com/fr/design/actions/file/export/EmbeddedExportExportAction.java
  78. 33
      designer/src/com/fr/design/actions/file/export/ExcelExportAction.java
  79. 44
      designer/src/com/fr/design/actions/file/export/PDFExportAction.java
  80. 31
      designer/src/com/fr/design/actions/file/export/PageExcelExportAction.java
  81. 39
      designer/src/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java
  82. 44
      designer/src/com/fr/design/actions/file/export/SVGExportAction.java
  83. 43
      designer/src/com/fr/design/actions/file/export/TextExportAction.java
  84. 43
      designer/src/com/fr/design/actions/file/export/WordExportAction.java
  85. 18
      designer/src/com/fr/design/actions/file/newReport/NewOEMWorkBookAction.java
  86. 34
      designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java
  87. 54
      designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java
  88. 17
      designer/src/com/fr/design/actions/form/AbastractFormECAction.java
  89. 47
      designer/src/com/fr/design/actions/form/FormECBackgroundAction.java
  90. 52
      designer/src/com/fr/design/actions/form/FormECColumnsAction.java
  91. 55
      designer/src/com/fr/design/actions/form/FormECFrozenAction.java
  92. 51
      designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java
  93. 48
      designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java
  94. 48
      designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java
  95. 21
      designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java
  96. 44
      designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java
  97. 46
      designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java
  98. 47
      designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java
  99. 61
      designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java
  100. 62
      designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java
  101. Some files were not shown because too many files have changed in this diff Show More

457
.gitattributes vendored

@ -1,4 +1,461 @@
* text=auto !eol * text=auto !eol
designer/.classpath -text
designer/.project -text
designer/designer.iml -text
designer/src/com/fr/design/actions/ButtonGroupAction.java -text
designer/src/com/fr/design/actions/CellSelectionAction.java -text
designer/src/com/fr/design/actions/ElementCaseAction.java -text
designer/src/com/fr/design/actions/FloatSelectionAction.java -text
designer/src/com/fr/design/actions/JWorkBookAction.java -text
designer/src/com/fr/design/actions/PresentCheckBoxAction.java -text
designer/src/com/fr/design/actions/ReportComponentAction.java -text
designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java -text
designer/src/com/fr/design/actions/cell/BorderAction.java -text
designer/src/com/fr/design/actions/cell/CellAttributeAction.java -text
designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java -text
designer/src/com/fr/design/actions/cell/CellExpandAttrAction.java -text
designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java -text
designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java -text
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java -text
designer/src/com/fr/design/actions/cell/EditCellAction.java -text
designer/src/com/fr/design/actions/cell/FloatStyleAction.java -text
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java -text
designer/src/com/fr/design/actions/cell/NewPresentAction.java -text
designer/src/com/fr/design/actions/cell/StyleAction.java -text
designer/src/com/fr/design/actions/cell/UIToolbarBorderButton.java -text
designer/src/com/fr/design/actions/cell/style/AbstractStyleAction.java -text
designer/src/com/fr/design/actions/cell/style/AlignmentAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontForegroundAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontNameAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontSizeAction.java -text
designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java -text
designer/src/com/fr/design/actions/cell/style/StyleActionInterface.java -text
designer/src/com/fr/design/actions/cell/style/StyleBackgroundAction.java -text
designer/src/com/fr/design/actions/columnrow/AbstractColumnRowIndexAction.java -text
designer/src/com/fr/design/actions/columnrow/CancelColumnAction.java -text
designer/src/com/fr/design/actions/columnrow/CancelRowAction.java -text
designer/src/com/fr/design/actions/columnrow/ColumnHideAction.java -text
designer/src/com/fr/design/actions/columnrow/ColumnRowRepeatAction.java -text
designer/src/com/fr/design/actions/columnrow/ColumnRowSizingAction.java -text
designer/src/com/fr/design/actions/columnrow/ColumnWidthAction.java -text
designer/src/com/fr/design/actions/columnrow/DSColumnAdvancedAction.java -text
designer/src/com/fr/design/actions/columnrow/DSColumnBasicAction.java -text
designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java -text
designer/src/com/fr/design/actions/columnrow/DeleteColumnAction.java -text
designer/src/com/fr/design/actions/columnrow/DeleteRowAction.java -text
designer/src/com/fr/design/actions/columnrow/FootColumnAction.java -text
designer/src/com/fr/design/actions/columnrow/FootRowAction.java -text
designer/src/com/fr/design/actions/columnrow/HeadColumnAction.java -text
designer/src/com/fr/design/actions/columnrow/HeadRowAction.java -text
designer/src/com/fr/design/actions/columnrow/InsertColumnAction.java -text
designer/src/com/fr/design/actions/columnrow/InsertRowAction.java -text
designer/src/com/fr/design/actions/columnrow/ResetColumnHideAction.java -text
designer/src/com/fr/design/actions/columnrow/ResetRowHideAction.java -text
designer/src/com/fr/design/actions/columnrow/RowHeightAction.java -text
designer/src/com/fr/design/actions/columnrow/RowHideAction.java -text
designer/src/com/fr/design/actions/edit/DeleteAction.java -text
designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java -text
designer/src/com/fr/design/actions/edit/HyperlinkAction.java -text
designer/src/com/fr/design/actions/edit/clear/ClearAction.java -text
designer/src/com/fr/design/actions/edit/clear/ClearAllAction.java -text
designer/src/com/fr/design/actions/edit/clear/ClearContentsAction.java -text
designer/src/com/fr/design/actions/edit/clear/ClearFormatsAction.java -text
designer/src/com/fr/design/actions/edit/clear/ClearWidgetAction.java -text
designer/src/com/fr/design/actions/edit/merge/MergeCellAction.java -text
designer/src/com/fr/design/actions/edit/merge/UnmergeCellAction.java -text
designer/src/com/fr/design/actions/edit/order/AbstractFloatElementOrderAction.java -text
designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java -text
designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java -text
designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java -text
designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java -text
designer/src/com/fr/design/actions/file/export/AbstractExcelExportAction.java -text
designer/src/com/fr/design/actions/file/export/AbstractExportAction.java -text
designer/src/com/fr/design/actions/file/export/CSVExportAction.java -text
designer/src/com/fr/design/actions/file/export/EmbeddedExportExportAction.java -text
designer/src/com/fr/design/actions/file/export/ExcelExportAction.java -text
designer/src/com/fr/design/actions/file/export/PDFExportAction.java -text
designer/src/com/fr/design/actions/file/export/PageExcelExportAction.java -text
designer/src/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java -text
designer/src/com/fr/design/actions/file/export/SVGExportAction.java -text
designer/src/com/fr/design/actions/file/export/TextExportAction.java -text
designer/src/com/fr/design/actions/file/export/WordExportAction.java -text
designer/src/com/fr/design/actions/file/newReport/NewOEMWorkBookAction.java -text
designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java -text
designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java -text
designer/src/com/fr/design/actions/form/AbastractFormECAction.java -text
designer/src/com/fr/design/actions/form/FormECBackgroundAction.java -text
designer/src/com/fr/design/actions/form/FormECColumnsAction.java -text
designer/src/com/fr/design/actions/form/FormECFrozenAction.java -text
designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java -text
designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java -text
designer/src/com/fr/design/actions/insert/flot/AbstractShapeAction.java -text
designer/src/com/fr/design/actions/insert/flot/ChartFloatAction.java -text
designer/src/com/fr/design/actions/insert/flot/FormulaFloatAction.java -text
designer/src/com/fr/design/actions/insert/flot/ImageFloatAction.java -text
designer/src/com/fr/design/actions/insert/flot/TextBoxFloatAction.java -text
designer/src/com/fr/design/actions/report/ReportBackgroundAction.java -text
designer/src/com/fr/design/actions/report/ReportColumnsAction.java -text
designer/src/com/fr/design/actions/report/ReportEngineAttrAction.java -text
designer/src/com/fr/design/actions/report/ReportExportAttrAction.java -text
designer/src/com/fr/design/actions/report/ReportFooterAction.java -text
designer/src/com/fr/design/actions/report/ReportHeaderAction.java -text
designer/src/com/fr/design/actions/report/ReportPageAttrAction.java -text
designer/src/com/fr/design/actions/report/ReportPageSetupAction.java -text
designer/src/com/fr/design/actions/report/ReportParameterAction.java -text
designer/src/com/fr/design/actions/report/ReportWebAttrAction.java -text
designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java -text
designer/src/com/fr/design/actions/server/ServerConfigManagerAction.java -text
designer/src/com/fr/design/actions/server/StyleListAction.java -text
designer/src/com/fr/design/actions/server/StyleManagerPane.java -text
designer/src/com/fr/design/actions/server/WidgetManagerAction.java -text
designer/src/com/fr/design/actions/utils/DeprecatedActionManager.java -text
designer/src/com/fr/design/actions/utils/ReportActionUtils.java -text
designer/src/com/fr/design/cell/bar/BarHelper.java -text
designer/src/com/fr/design/cell/bar/DynamicScrollBar.java -text
designer/src/com/fr/design/cell/bar/DynamicScrollBarUI.java -text
designer/src/com/fr/design/cell/bar/DynamicScrollButton.java -text
designer/src/com/fr/design/cell/bar/ScrollBarUIConstant.java -text
designer/src/com/fr/design/cell/clipboard/CellElementsClip.java -text
designer/src/com/fr/design/cell/clipboard/ElementsTransferable.java -text
designer/src/com/fr/design/cell/clipboard/FloatElementsClip.java -text
designer/src/com/fr/design/cell/editor/AbstractCellEditor.java -text
designer/src/com/fr/design/cell/editor/AbstractFloatEditor.java -text
designer/src/com/fr/design/cell/editor/BiasTextPainterCellEditor.java -text
designer/src/com/fr/design/cell/editor/CellEditor.java -text
designer/src/com/fr/design/cell/editor/ChartCellEditor.java -text
designer/src/com/fr/design/cell/editor/ChartFloatEditor.java -text
designer/src/com/fr/design/cell/editor/ComboBoxCellEditor.java -text
designer/src/com/fr/design/cell/editor/DSColumnCellEditor.java -text
designer/src/com/fr/design/cell/editor/DateCellEditor.java -text
designer/src/com/fr/design/cell/editor/FloatEditor.java -text
designer/src/com/fr/design/cell/editor/FormulaCellEditor.java -text
designer/src/com/fr/design/cell/editor/FormulaFloatEditor.java -text
designer/src/com/fr/design/cell/editor/GeneralCellEditor.java -text
designer/src/com/fr/design/cell/editor/GeneralFloatEditor.java -text
designer/src/com/fr/design/cell/editor/ImageCellEditor.java -text
designer/src/com/fr/design/cell/editor/ImageFloatEditor.java -text
designer/src/com/fr/design/cell/editor/RichTextCellEditor.java -text
designer/src/com/fr/design/cell/editor/RichTextToolBar.java -text
designer/src/com/fr/design/cell/editor/SubReportCellEditor.java -text
designer/src/com/fr/design/cell/editor/TextCellEditor.java -text
designer/src/com/fr/design/cell/editor/TextFloatEditor.java -text
designer/src/com/fr/design/cell/editor/package.html -text
designer/src/com/fr/design/cell/smartaction/AbstractSmartJTablePaneAction.java -text
designer/src/com/fr/design/cell/smartaction/SmartJTablePane.java -text
designer/src/com/fr/design/cell/smartaction/SmartJTablePaneAction.java -text
designer/src/com/fr/design/condition/BackPane.java -text
designer/src/com/fr/design/condition/BorderHighlightPane.java -text
designer/src/com/fr/design/condition/ColumnWidthPane.java -text
designer/src/com/fr/design/condition/FontPane.java -text
designer/src/com/fr/design/condition/ForeGroundPane.java -text
designer/src/com/fr/design/condition/HighLightConditionAttributesPane.java -text
designer/src/com/fr/design/condition/HyperlinkPane.java -text
designer/src/com/fr/design/condition/NewRealValuePane.java -text
designer/src/com/fr/design/condition/PaddingPane.java -text
designer/src/com/fr/design/condition/PagePane.java -text
designer/src/com/fr/design/condition/PresentHighlightPane.java -text
designer/src/com/fr/design/condition/RowHeightPane.java -text
designer/src/com/fr/design/condition/WHPane.java -text
designer/src/com/fr/design/condition/WidgetHighlightPane.java -text
designer/src/com/fr/design/dscolumn/DSColumnAdvancedPane.java -text
designer/src/com/fr/design/dscolumn/DSColumnBasicPane.java -text
designer/src/com/fr/design/dscolumn/DSColumnConditionsPane.java -text
designer/src/com/fr/design/dscolumn/DSColumnPane.java -text
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java -text
designer/src/com/fr/design/dscolumn/ResultSetGroupPane.java -text
designer/src/com/fr/design/dscolumn/ResultSetGroupPopUpPane.java -text
designer/src/com/fr/design/dscolumn/SelectedConfirmedDataColumnPane.java -text
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java -text
designer/src/com/fr/design/dscolumn/SpecifiedGroupAttrPane.java -text
designer/src/com/fr/design/expand/ConditionParentPane.java -text
designer/src/com/fr/design/expand/Expand.java -text
designer/src/com/fr/design/expand/ExpandDirectionPane.java -text
designer/src/com/fr/design/expand/ExpandFatherPane.java -text
designer/src/com/fr/design/expand/ExpandLeftFatherPane.java -text
designer/src/com/fr/design/expand/ExpandUpFatherPane.java -text
designer/src/com/fr/design/expand/ParentPane.java -text
designer/src/com/fr/design/expand/SortExpandAttrPane.java -text
designer/src/com/fr/design/headerfooter/EditFooterPane.java -text
designer/src/com/fr/design/headerfooter/EditHeaderPane.java -text
designer/src/com/fr/design/headerfooter/HFAttributesEditDialog.java -text
designer/src/com/fr/design/headerfooter/HFComponent.java -text
designer/src/com/fr/design/headerfooter/HFContainer.java -text
designer/src/com/fr/design/headerfooter/HeaderFooterEditPane.java -text
designer/src/com/fr/design/headerfooter/HeaderFooterPane.java -text
designer/src/com/fr/design/headerfooter/ImagePane.java -text
designer/src/com/fr/design/headerfooter/MoveActionListener.java -text
designer/src/com/fr/design/javascript/ListenerEditPane.java -text
designer/src/com/fr/design/mainframe/AbstractAttrPane.java -text
designer/src/com/fr/design/mainframe/ActiveKeyGenerator.java -text
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java -text
designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java -text
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java -text
designer/src/com/fr/design/mainframe/CellElementPropertyPane.java -text
designer/src/com/fr/design/mainframe/ElementCasePane.java -text
designer/src/com/fr/design/mainframe/ElementCasePaneAuthorityEditPane.java -text
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java -text
designer/src/com/fr/design/mainframe/FormatBrushAction.java -text
designer/src/com/fr/design/mainframe/InformationCollector.java -text
designer/src/com/fr/design/mainframe/JPolyWorkBook.java -text
designer/src/com/fr/design/mainframe/JWorkBook.java -text
designer/src/com/fr/design/mainframe/PolySheetNameTabPane.java -text
designer/src/com/fr/design/mainframe/RGridLayout.java -text
designer/src/com/fr/design/mainframe/ReportComponent.java -text
designer/src/com/fr/design/mainframe/ReportComponentCardPane.java -text
designer/src/com/fr/design/mainframe/ReportComponentComposite.java -text
designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java -text
designer/src/com/fr/design/mainframe/SheetNameTabPane.java -text
designer/src/com/fr/design/mainframe/WorkBookModelAdapter.java -text
designer/src/com/fr/design/mainframe/WorkBookUndoState.java -text
designer/src/com/fr/design/mainframe/WorkSheetDesigner.java -text
designer/src/com/fr/design/mainframe/bbs/BBSBrowserDialog.java -text
designer/src/com/fr/design/mainframe/bbs/BBSConstants.java -text
designer/src/com/fr/design/mainframe/bbs/BBSDialog.java -text
designer/src/com/fr/design/mainframe/bbs/BBSGuestPane.java -text
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java -text
designer/src/com/fr/design/mainframe/bbs/DisplayThread.java -text
designer/src/com/fr/design/mainframe/bbs/ExitLabel.java -text
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java -text
designer/src/com/fr/design/mainframe/bbs/UserInfoPane.java -text
designer/src/com/fr/design/mainframe/bbs/bbs.properties -text
designer/src/com/fr/design/mainframe/bbs/images/switch.png -text
designer/src/com/fr/design/mainframe/cell/CellElementEditPane.java -text
designer/src/com/fr/design/mainframe/cell/QuickEditorRegion.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/CellPresentPane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/CellStylePane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/style/CustomStylePane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/style/PredefinedStylePane.java -text
designer/src/com/fr/design/mainframe/cell/settingpane/style/StylePane.java -text
designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java -text
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java -text
designer/src/com/fr/design/mainframe/form/FormReportComponentComposite.java -text
designer/src/com/fr/design/mainframe/form/FormTabPane.java -text
designer/src/com/fr/design/module/DesignerModule.java -text
designer/src/com/fr/design/parameter/ParameterDefinitePane.java -text
designer/src/com/fr/design/parameter/WorkBookParameterReader.java -text
designer/src/com/fr/design/present/BarCodePane.java -text
designer/src/com/fr/design/present/CellWriteAttrPane.java -text
designer/src/com/fr/design/present/ColumnRowTableModel.java -text
designer/src/com/fr/design/present/ConditionAttributesGroupPane.java -text
designer/src/com/fr/design/present/CurrencyLinePane.java -text
designer/src/com/fr/design/present/PresentPane.java -text
designer/src/com/fr/design/present/StyleArrayPane.java -text
designer/src/com/fr/design/report/CustomVerifyJobPane.java -text
designer/src/com/fr/design/report/ExcelExportPane.java -text
designer/src/com/fr/design/report/LayerReportPane.java -text
designer/src/com/fr/design/report/PDFExportPane.java -text
designer/src/com/fr/design/report/PageSetupPane.java -text
designer/src/com/fr/design/report/ReportBackgroundPane.java -text
designer/src/com/fr/design/report/ReportColumnsPane.java -text
designer/src/com/fr/design/report/ReportExportAttrPane.java -text
designer/src/com/fr/design/report/ReportStylePane.java -text
designer/src/com/fr/design/report/RichTextEditingPane.java -text
designer/src/com/fr/design/report/RichTextPane.java -text
designer/src/com/fr/design/report/RowColumnPane.java -text
designer/src/com/fr/design/report/SelectImagePane.java -text
designer/src/com/fr/design/report/SubReportPane.java -text
designer/src/com/fr/design/report/UnitFieldPane.java -text
designer/src/com/fr/design/report/ValueVerifierEditPane.java -text
designer/src/com/fr/design/report/VerifierListPane.java -text
designer/src/com/fr/design/report/VerifyJobListPane.java -text
designer/src/com/fr/design/report/WordExportPane.java -text
designer/src/com/fr/design/report/WriteShortCutsPane.java -text
designer/src/com/fr/design/report/freeze/ColSpinner.java -text
designer/src/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java -text
designer/src/com/fr/design/report/freeze/FreezeAndRepeatPane.java -text
designer/src/com/fr/design/report/freeze/FreezePagePane.java -text
designer/src/com/fr/design/report/freeze/FreezeWriteColPane.java -text
designer/src/com/fr/design/report/freeze/FreezeWriteRowPane.java -text
designer/src/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java -text
designer/src/com/fr/design/report/freeze/RepeatColPane.java -text
designer/src/com/fr/design/report/freeze/RepeatRowPane.java -text
designer/src/com/fr/design/report/freeze/RowSpinner.java -text
designer/src/com/fr/design/report/freeze/UICapitalLetterField.java -text
designer/src/com/fr/design/report/freeze/UIIntNumberField.java -text
designer/src/com/fr/design/report/share/ConfuseTabledataAction.java -text
designer/src/com/fr/design/report/share/ConfusionInfo.java -text
designer/src/com/fr/design/report/share/ConfusionManagerPane.java -text
designer/src/com/fr/design/report/share/ConfusionTableDataPane.java -text
designer/src/com/fr/design/report/share/ShareButton.java -text
designer/src/com/fr/design/report/share/shareToolTip.html -text
designer/src/com/fr/design/style/BorderUtils.java -text
designer/src/com/fr/design/style/StylePane.java -text
designer/src/com/fr/design/webattr/AbstractEditToolBarPane.java -text
designer/src/com/fr/design/webattr/CommonPane.java -text
designer/src/com/fr/design/webattr/DragToolBarPane.java -text
designer/src/com/fr/design/webattr/EditReportServerParameterPane.java -text
designer/src/com/fr/design/webattr/EditToolBar.java -text
designer/src/com/fr/design/webattr/ErrorTemplatePane.java -text
designer/src/com/fr/design/webattr/EventPane.java -text
designer/src/com/fr/design/webattr/FToolBar.java -text
designer/src/com/fr/design/webattr/NameOptionSelection.java -text
designer/src/com/fr/design/webattr/PageToolBarPane.java -text
designer/src/com/fr/design/webattr/PageWebSettingPane.java -text
designer/src/com/fr/design/webattr/ReportSelectToolBarPane.java -text
designer/src/com/fr/design/webattr/ReportServerPrinterPane.java -text
designer/src/com/fr/design/webattr/ReportWebAttrPane.java -text
designer/src/com/fr/design/webattr/ReportWebWidgetConstants.java -text
designer/src/com/fr/design/webattr/ReportWriteAttrPane.java -text
designer/src/com/fr/design/webattr/ServerPrinterPane.java -text
designer/src/com/fr/design/webattr/SettingToolBar.java -text
designer/src/com/fr/design/webattr/ToolBarButton.java -text
designer/src/com/fr/design/webattr/ToolBarDragPane.java -text
designer/src/com/fr/design/webattr/ToolBarPane.java -text
designer/src/com/fr/design/webattr/ViewToolBarPane.java -text
designer/src/com/fr/design/webattr/ViewWebSettingPane.java -text
designer/src/com/fr/design/webattr/WebCssPane.java -text
designer/src/com/fr/design/webattr/WebJsPane.java -text
designer/src/com/fr/design/webattr/WebSettingPane.java -text
designer/src/com/fr/design/webattr/WidgetManagerPane.java -text
designer/src/com/fr/design/webattr/WidgetToolBarPane.java -text
designer/src/com/fr/design/webattr/WriteToolBarPane.java -text
designer/src/com/fr/design/webattr/WriteWebSettingPane.java -text
designer/src/com/fr/design/widget/CellWidgetCardPane.java -text
designer/src/com/fr/design/widget/DataModify.java -text
designer/src/com/fr/design/widget/EventCreator.java -text
designer/src/com/fr/design/widget/Operator.java -text
designer/src/com/fr/design/widget/UserDefinedWidgetConfigPane.java -text
designer/src/com/fr/design/widget/ValueWidgetPane.java -text
designer/src/com/fr/design/widget/WidgetConfigPane.java -text
designer/src/com/fr/design/widget/WidgetDefinePaneFactory.java -text
designer/src/com/fr/design/widget/WidgetEventPane.java -text
designer/src/com/fr/design/widget/WidgetPane.java -text
designer/src/com/fr/design/widget/ui/AbstractDataModify.java -text
designer/src/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java -text
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java -text
designer/src/com/fr/design/widget/ui/ButtonGroupDictPane.java -text
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java -text
designer/src/com/fr/design/widget/ui/CheckBoxDictPane.java -text
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java -text
designer/src/com/fr/design/widget/ui/ComboBoxDefinePane.java -text
designer/src/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java -text
designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java -text
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/ListEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java -text
designer/src/com/fr/design/widget/ui/NoneWidgetDefinePane.java -text
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java -text
designer/src/com/fr/design/widget/ui/PasswordDefinePane.java -text
designer/src/com/fr/design/widget/ui/RadioDefinePane.java -text
designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java -text
designer/src/com/fr/design/widget/ui/TextAreaDefinePane.java -text
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/UserEditorDefinePane.java -text
designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java -text
designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java -text
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java -text
designer/src/com/fr/design/widget/ui/btn/AppendRowButtonDefinePane.java -text
designer/src/com/fr/design/widget/ui/btn/ButtonDetailPaneFactory.java -text
designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java -text
designer/src/com/fr/design/widget/ui/btn/DefaultButtonDetailPane.java -text
designer/src/com/fr/design/widget/ui/btn/DefaultButtonStylePane.java -text
designer/src/com/fr/design/widget/ui/btn/DefineAppendColumnRowPane.java -text
designer/src/com/fr/design/widget/ui/btn/DefineDeleteColumnRowPane.java -text
designer/src/com/fr/design/widget/ui/btn/DeleteRowButtonDefinePane.java -text
designer/src/com/fr/design/widget/ui/btn/FreeButtonDetailPane.java -text
designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java -text
designer/src/com/fr/design/write/submit/DefaultSubmit.java -text
designer/src/com/fr/design/write/submit/SmartInsertDBManipulationInWidgetEventPane.java -text
designer/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java -text
designer/src/com/fr/design/write/submit/SmartInsertDMLJobPane.java -text
designer/src/com/fr/design/write/submit/SubmiterListPane.java -text
designer/src/com/fr/grid/AbstractGridHeaderMouseHandler.java -text
designer/src/com/fr/grid/BaseGridComponent.java -text
designer/src/com/fr/grid/CellElementPainter.java -text
designer/src/com/fr/grid/DrawFlowRect.java -text
designer/src/com/fr/grid/Grid.java -text
designer/src/com/fr/grid/GridColumn.java -text
designer/src/com/fr/grid/GridColumnMouseHandler.java -text
designer/src/com/fr/grid/GridColumnUI.java -text
designer/src/com/fr/grid/GridCorner.java -text
designer/src/com/fr/grid/GridCornerMouseHandler.java -text
designer/src/com/fr/grid/GridHeader.java -text
designer/src/com/fr/grid/GridKeyAction.java -text
designer/src/com/fr/grid/GridKeyListener.java -text
designer/src/com/fr/grid/GridMouseAdapter.java -text
designer/src/com/fr/grid/GridRow.java -text
designer/src/com/fr/grid/GridRowMouseHandler.java -text
designer/src/com/fr/grid/GridRowUI.java -text
designer/src/com/fr/grid/GridUI.java -text
designer/src/com/fr/grid/GridUtils.java -text
designer/src/com/fr/grid/IntelliElements.java -text
designer/src/com/fr/grid/KeyEventWork.java -text
designer/src/com/fr/grid/dnd/ElementCasePaneDropTarget.java -text
designer/src/com/fr/grid/event/CellEditorEvent.java -text
designer/src/com/fr/grid/event/CellEditorListener.java -text
designer/src/com/fr/grid/event/FloatEditorEvent.java -text
designer/src/com/fr/grid/event/FloatEditorListener.java -text
designer/src/com/fr/grid/event/package.html -text
designer/src/com/fr/grid/selection/CellSelection.java -text
designer/src/com/fr/grid/selection/FloatSelection.java -text
designer/src/com/fr/grid/selection/Selection.java -text
designer/src/com/fr/poly/JPolyBlockPane.java -text
designer/src/com/fr/poly/PolyArea.java -text
designer/src/com/fr/poly/PolyBlockProperPane.java -text
designer/src/com/fr/poly/PolyBlockProperTable.java -text
designer/src/com/fr/poly/PolyComponetsBar.java -text
designer/src/com/fr/poly/PolyConstants.java -text
designer/src/com/fr/poly/PolyDesignUI.java -text
designer/src/com/fr/poly/PolyDesigner.java -text
designer/src/com/fr/poly/PolyDesignerLayout.java -text
designer/src/com/fr/poly/PolyEditorLayout.java -text
designer/src/com/fr/poly/PolyUtils.java -text
designer/src/com/fr/poly/actions/DeleteBlockAction.java -text
designer/src/com/fr/poly/creator/BlockCreator.java -text
designer/src/com/fr/poly/creator/BlockEditor.java -text
designer/src/com/fr/poly/creator/BlockEditorLayout.java -text
designer/src/com/fr/poly/creator/ChartBlockCreator.java -text
designer/src/com/fr/poly/creator/ChartBlockEditor.java -text
designer/src/com/fr/poly/creator/ECBlockCreator.java -text
designer/src/com/fr/poly/creator/ECBlockEditor.java -text
designer/src/com/fr/poly/creator/ECBlockPane.java -text
designer/src/com/fr/poly/creator/PolyElementCasePane.java -text
designer/src/com/fr/poly/group/PolyBoundsGroup.java -text
designer/src/com/fr/poly/group/PolyNameGroup.java -text
designer/src/com/fr/poly/hanlder/BlockForbiddenWindow.java -text
designer/src/com/fr/poly/hanlder/BlockOperationMouseHandler.java -text
designer/src/com/fr/poly/hanlder/BottomCornerMouseHanlder.java -text
designer/src/com/fr/poly/hanlder/ColumnOperationMouseHandler.java -text
designer/src/com/fr/poly/hanlder/DataEditingListener.java -text
designer/src/com/fr/poly/hanlder/PolyDesignerDropTarget.java -text
designer/src/com/fr/poly/hanlder/RowOperationMouseHandler.java -text
designer/src/com/fr/poly/model/AddedData.java -text
designer/src/com/fr/poly/model/AddingData.java -text
designer/src/com/fr/quickeditor/CellQuickEditor.java -text
designer/src/com/fr/quickeditor/ChartQuickEditor.java -text
designer/src/com/fr/quickeditor/FloatQuickEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellDScolumnEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellStringQuickEditor.java -text
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java -text
designer/src/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java -text
designer/src/com/fr/quickeditor/floatquick/FloatStringQuickEditor.java -text
designer/src/com/fr/start/BISplashPane.java -text
designer/src/com/fr/start/CollectUserInformationDialog.java -text
designer/src/com/fr/start/Designer.java -text
designer/src/com/fr/start/Designer4BI.java -text
designer/src/com/fr/start/Designer4Debug.java -text
designer/src/com/fr/start/ReportSplashPane.java -text
designer_chart/.classpath -text designer_chart/.classpath -text
designer_chart/.project -text designer_chart/.project -text
designer_chart/designer_chart.iml -text designer_chart/designer_chart.iml -text

1
.gitignore vendored

@ -1 +1,2 @@
designer/bin
designer_chart/bin designer_chart/bin

52
designer/.classpath

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/form"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/engine"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<classpathentry kind="lib" path="/lib/3rd.jar"/>
<classpathentry kind="lib" path="/lib/junit.jar"/>
<classpathentry kind="lib" path="/lib/ojdbc14.jar"/>
<classpathentry kind="lib" path="/lib/poi2007_fat.jar"/>
<classpathentry kind="lib" path="/lib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/lib/sqljdbc.jar"/>
<classpathentry kind="lib" path="/lib/jetty/activation.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-el.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-logging.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-compiler.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-runtime.jar"/>
<classpathentry kind="lib" path="/lib/jetty/javax.servlet.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jaxrpc.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mail.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-remote.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-tools.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jmx.jar"/>
<classpathentry kind="lib" path="/lib/jetty/saaj.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xml-apis.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xmlParserAPIs.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-base"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartattr"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartdata"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartglyph"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-web"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-page"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-view"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-write"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-remote"/>
<classpathentry combineaccessrules="false" kind="src" path="/designer_chart"/>
<classpathentry combineaccessrules="false" kind="src" path="/designer_form"/>
<classpathentry kind="lib" path="/lib/swt.jar"/>
<classpathentry kind="lib" path="/lib/sqlite-jdbc.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
designer/.project

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>designer</name> <comment/> <projects/> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments/> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription>

21
designer/designer.iml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/../../env/WebReport/WEB-INF/classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="jdk1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="base" />
<orderEntry type="module" module-name="base-basic" />
<orderEntry type="module" module-name="base-calculate" />
<orderEntry type="module" module-name="base-data" />
<orderEntry type="module" module-name="base-file" />
<orderEntry type="module" module-name="base-performance" />
<orderEntry type="module" module-name="base-stable" />
<orderEntry type="module" module-name="designer_base" />
<orderEntry type="module" module-name="engine" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

56
designer/src/com/fr/design/actions/ButtonGroupAction.java

@ -0,0 +1,56 @@
package com.fr.design.actions;
import javax.swing.Icon;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.mainframe.ElementCasePane;
public abstract class ButtonGroupAction extends ElementCaseAction{
protected Icon[] iconArray;
protected Integer[] valueArray;
private UIButtonGroup<Integer> group;
protected ButtonGroupAction(ElementCasePane t, Icon[] iconArray, Integer[] valueArray) {
super(t);
this.iconArray = iconArray;
this.valueArray = valueArray;
}
protected Integer getSelectedValue() {
if(getSelectedIndex() < 0 || getSelectedIndex() >= valueArray.length) {
return valueArray[0];
}
return valueArray[getSelectedIndex()];
}
private int getSelectedIndex() {
return createToolBarComponent().getSelectedIndex();
}
protected void setSelectedIndex(int value) {
int index = -1;
for(int i = 0; i < valueArray.length; i++) {
if(value == valueArray[i]) {
index = i;
break;
}
}
if(value == -1 && createToolBarComponent().hasClick()) {
index = getSelectedIndex();
createToolBarComponent().setClickState(false);
}
createToolBarComponent().removeActionListener(this);
createToolBarComponent().setSelectedIndex(index);
createToolBarComponent().addActionListener(this);
}
@Override
public UIButtonGroup<Integer> createToolBarComponent() {
if(group == null) {
group = new UIButtonGroup<Integer>(iconArray, valueArray);
group.addActionListener(this);
}
return group;
}
}

34
designer/src/com/fr/design/actions/CellSelectionAction.java

@ -0,0 +1,34 @@
package com.fr.design.actions;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
public abstract class CellSelectionAction extends ElementCaseAction {
protected CellSelectionAction(ElementCasePane t) {
super(t);
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane ePane = this.getEditingComponent();
Selection s = ePane.getSelection();
// TODO ALEX_SEP instanceof i hate it
if (s instanceof CellSelection) {
return executeActionReturnUndoRecordNeededWithCellSelection((CellSelection)s);
}
return false;
}
protected abstract boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs);
@Override
public void update() {
super.update();
if (this.isEnabled()) {
this.setEnabled(this.getEditingComponent().getSelection() instanceof CellSelection);
}
}
}

33
designer/src/com/fr/design/actions/ElementCaseAction.java

@ -0,0 +1,33 @@
package com.fr.design.actions;
//ElementCaseAction应该有GridSelectionChangeListener,就从悬浮元素和单元格来讲,就必须有了,用来判断这些ElementCaseAction是否可以编辑,当然还可以做些其他事情
//
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener;
public abstract class ElementCaseAction extends TemplateComponentAction<ElementCasePane> {
protected ElementCaseAction(ElementCasePane t) {
super(t);
t.addSelectionChangeListener(new SelectionListener() {
@Override
public void selectionChanged(SelectionEvent e) {
update();
if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) {
Selection selection = getEditingComponent().getSelection();
if (selection instanceof CellSelection) {
CellSelection cellselection = (CellSelection) selection;
//样式处理
getEditingComponent().setCellNeedTOFormat(cellselection);
}
}
}
});
}
}

37
designer/src/com/fr/design/actions/FloatSelectionAction.java

@ -0,0 +1,37 @@
package com.fr.design.actions;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
public abstract class FloatSelectionAction extends ElementCaseAction {
protected FloatSelectionAction(ElementCasePane t) {
super(t);
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane ePane = this.getEditingComponent();
Selection s = ePane.getSelection();
// TODO ALEX_SEP instanceof i hate it
if (s instanceof FloatSelection) {
return executeActionReturnUndoRecordNeededWithFloatSelection((FloatSelection)s);
}
return false;
}
protected abstract boolean executeActionReturnUndoRecordNeededWithFloatSelection(FloatSelection fs);
@Override
public void update() {
super.update();
if (this.isEnabled()) {
this.setEnabled(this.getEditingComponent().getSelection() instanceof FloatSelection);
}
}
}

9
designer/src/com/fr/design/actions/JWorkBookAction.java

@ -0,0 +1,9 @@
package com.fr.design.actions;
import com.fr.design.mainframe.JWorkBook;
public abstract class JWorkBookAction extends JTemplateAction<JWorkBook> {
protected JWorkBookAction(JWorkBook jwb) {
super(jwb);
}
}

26
designer/src/com/fr/design/actions/PresentCheckBoxAction.java

@ -0,0 +1,26 @@
package com.fr.design.actions;
import com.fr.design.gui.imenu.UICheckBoxMenuItem;
import com.fr.design.mainframe.ElementCasePane;
public abstract class PresentCheckBoxAction extends ElementCaseAction {
protected PresentCheckBoxAction(ElementCasePane t) {
super(t);
}
@Override
public UICheckBoxMenuItem createMenuItem() {
Object object = this.getValue(UICheckBoxMenuItem.class.getName());
if (object == null) {
object = createCheckBoxMenuItem(this);
this.putValue(UICheckBoxMenuItem.class.getName(), object);
}
// isSelected.
((UICheckBoxMenuItem) object).setSelected(this.isSelected());
return (UICheckBoxMenuItem) object;
}
public abstract boolean isSelected();
}

9
designer/src/com/fr/design/actions/ReportComponentAction.java

@ -0,0 +1,9 @@
package com.fr.design.actions;
import com.fr.design.mainframe.ReportComponent;
public abstract class ReportComponentAction<T extends ReportComponent> extends TemplateComponentAction<T> {
protected ReportComponentAction(T tc) {
super(tc);
}
}

100
designer/src/com/fr/design/actions/cell/AbstractCellElementAction.java

@ -0,0 +1,100 @@
package com.fr.design.actions.cell;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.stable.ReportConstants;
// TODO ALEX_SEP 这个类与AbstractCellAction有什么关系?
public abstract class AbstractCellElementAction extends CellSelectionAction {
protected AbstractCellElementAction(ElementCasePane t) {
super(t);
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
final ElementCasePane ePane = this.getEditingComponent();
final TemplateElementCase tplEC = ePane.getEditingElementCase();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
tplEC.addCellElement(editCellElement);
}
if (tplEC != null) {
SheetUtils.calculateDefaultParent(tplEC);
}
final CellSelection finalCS = cs;
final BasicPane bp = populateBasicPane(editCellElement);
BasicDialog dialog = bp.showWindow(DesignerContext.getDesignerFrame());
dialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
// 需要先行后列地增加新元素。
for (int j = 0; j < finalCS.getRowSpan(); j++) {
for (int i = 0; i < finalCS.getColumnSpan(); i++) {
int column = i + finalCS.getColumn();
int row = j + finalCS.getRow();
TemplateCellElement editCellElement = tplEC.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
tplEC.addCellElement(editCellElement);
}
// alex:不加这一句话会导致跨行跨列的格子被多次update
if (editCellElement.getColumn() != column || editCellElement.getRow() != row) {
continue;
}
updateBasicPane(bp, editCellElement);
// update cell attributes
if (isNeedShinkToFit()) {
// shink to fit.(如果value是String)
Object editElementValue = editCellElement.getValue();
if (editElementValue != null && (editElementValue instanceof String || editElementValue instanceof Number)) {
// TODO ALEX_SEP 暂时用FIT_DEFAULT替代,不取reportsetting里面的设置,因为也不知道是应该放在report里面还是elementcase里面
GridUtils.shrinkToFit(ReportConstants.AUTO_SHRINK_TO_FIT_DEFAULT, tplEC, editCellElement);
}
}
}
}
ePane.fireTargetModified();
}
});
//控件设置记住dlg,提交入库智能添加单元格后可以show出来
DesignerContext.setReportWritePane(dialog);
dialog.setVisible(true);
return false;
}
/**
* 初始化对话框
*
* @param cellElement
* @return
*/
protected abstract BasicPane populateBasicPane(TemplateCellElement cellElement);
/**
* 更新对话框之后改变值
*
* @param cellElement
* @return
*/
protected abstract void updateBasicPane(BasicPane basicPane, TemplateCellElement cellElement);
/**
* if isNeedShinkToFitplease override this method
*
* @return isNeedShinkToFit
*/
protected boolean isNeedShinkToFit() {
return false;
}
}

85
designer/src/com/fr/design/actions/cell/BorderAction.java

@ -0,0 +1,85 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.actions.core.ActionUtils;
import com.fr.design.style.BorderUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Border.
*/
public class BorderAction extends ElementCaseAction implements ChangeListener {
private CellBorderStyle oldCellBorderStyle;
public BorderAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Format_A-Border"));
}
public void stateChanged(ChangeEvent e) {
this.actionPerformedUndoable();
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
Object object = this.getValue(UIToolbarBorderButton.class.getName());
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
if (object != null && object instanceof UIToolbarBorderButton) {
oldCellBorderStyle = ((UIToolbarBorderButton) object).getCellBorderStyle();
return this.update(reportPane);
}
return false;
}
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIToolbarBorderButton.class.getName());
if (object == null || !(object instanceof UIToolbarBorderButton)) {
UIToolbarBorderButton borderStylePane = new UIToolbarBorderButton(BaseUtils.readIcon("/com/fr/design/images/m_format/noboder.png"), this.getEditingComponent());
this.putValue(UIToolbarBorderButton.class.getName(), borderStylePane);
borderStylePane.setEnabled(this.isEnabled());
borderStylePane.set4Toolbar();
// peter:产生tooltip
borderStylePane.setToolTipText(ActionUtils.createButtonToolTipText(this));
borderStylePane.setCellBorderStyle(new CellBorderStyle());
borderStylePane.addStyleChangeListener(this);
return borderStylePane;
}
return (JComponent) object;
}
public boolean update(ElementCasePane elementCasePane) {
if (oldCellBorderStyle.isNoneBorderStyle()) {
//无边框格式
return BorderUtils.updateCellBorderStyle(elementCasePane, oldCellBorderStyle);
}
return BorderUtils.update(elementCasePane, oldCellBorderStyle);
}
@Override
public void update() {
this.setEnabled(true);
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
this.setEnabled(false);
return;
}
}
}

22
designer/src/com/fr/design/actions/cell/CellAttributeAction.java

@ -0,0 +1,22 @@
package com.fr.design.actions.cell;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
/**
* Cell Attribute.
*/
public class CellAttributeAction extends CellAttributeTableAction {
public CellAttributeAction() {
this.setMenuKeySet(KeySetUtils.CELL_OTHER_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
// this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellAttr.png"));
}
@Override
protected String getID() {
return Inter.getLocText("Datasource-Other_Attributes");
}
}

23
designer/src/com/fr/design/actions/cell/CellAttributeTableAction.java

@ -0,0 +1,23 @@
package com.fr.design.actions.cell;
import java.awt.event.ActionEvent;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.CellElementPropertyPane;
/**
* 所有的CellAttributeTableAction都是指向单元格属性表的,点了就自动跳转到单元格属性表
*
* @author zhou
* @since 2012-5-23下午4:19:48
*/
public abstract class CellAttributeTableAction extends UpdateAction {
protected abstract String getID();
@Override
public void actionPerformed(ActionEvent e) {
CellElementPropertyPane.getInstance().GoToPane(getID());
}
}

24
designer/src/com/fr/design/actions/cell/CellExpandAttrAction.java

@ -0,0 +1,24 @@
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
public class CellExpandAttrAction extends CellAttributeTableAction{
public CellExpandAttrAction() {
super();
this.setMenuKeySet(KeySetUtils.CELL_EXPAND_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
}
@Override
public String getID() {
return Inter.getLocText("ExpandD-Expand_Attribute");
}
}

72
designer/src/com/fr/design/actions/cell/CellWidgetAttrAction.java

@ -0,0 +1,72 @@
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.CellWriteAttrPane;
import com.fr.design.dialog.BasicPane;
import com.fr.form.ui.Widget;
import com.fr.general.FRLogger;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.privilege.finegrain.WidgetPrivilegeControl;
import com.fr.report.cell.TemplateCellElement;
/**
* Cell Widget Attribute.
*/
public class CellWidgetAttrAction extends AbstractCellElementAction {
public CellWidgetAttrAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.CELL_WIDGET_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/modified.png"));
}
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
CellWriteAttrPane pane = new CellWriteAttrPane(this.getEditingComponent());
//got simple cell element from column and row.
pane.populate(cellElement);
return pane;
}
@Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
CellWriteAttrPane pane = (CellWriteAttrPane) bp;
if (cellElement.getWidget() == null) {
pane.update(cellElement);
return;
}
try {
Widget oldWidget = (Widget) cellElement.getWidget().clone();
pane.update(cellElement);
//这边需要重新设置权限细粒度的hashset是因为Update是直接生成一个新的来update的,所以以前里面的hashset都没有了
Widget newWidget = cellElement.getWidget();
if (newWidget.getClass() == oldWidget.getClass()) {
newWidget.setWidgetPrivilegeControl((WidgetPrivilegeControl) oldWidget.getWidgetPrivilegeControl().clone());
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
@Override
protected boolean isNeedShinkToFit() {
return true;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
Selection sel = ePane.getSelection();
if (sel instanceof CellSelection) {
this.setEnabled(true);
} else {
this.setEnabled(false);
}
}
}

1
designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java

File diff suppressed because one or more lines are too long

37
designer/src/com/fr/design/actions/cell/ConditionAttributesAction.java

@ -0,0 +1,37 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.present.ConditionAttributesGroupPane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.TemplateCellElement;
/**
* Condition Attributes.
*/
public class ConditionAttributesAction extends AbstractCellElementAction {
public ConditionAttributesAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.CONDITION_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/highlight.png"));
}
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
ConditionAttributesGroupPane pane = new ConditionAttributesGroupPane();
pane.populate(cellElement.getHighlightGroup());
return pane;
}
@Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
cellElement.setHighlightGroup(((ConditionAttributesGroupPane)bp).updateHighlightGroup());
}
}

41
designer/src/com/fr/design/actions/cell/EditCellAction.java

@ -0,0 +1,41 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ElementCaseAction;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* EditCellAction.
*/
public class EditCellAction extends ElementCaseAction {
public EditCellAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Edit"));
this.setMnemonic('I');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/edit.png"));
}
@Override
public void actionPerformed(ActionEvent evt) {
ElementCasePane reportPane = getEditingComponent();
if(reportPane.isSelectedOneCell()){
reportPane.getGrid().startEditing();
}else{
Toolkit.getDefaultToolkit().beep();
}
}
// TODO ALEX_SEP 这里的undo redo又是怎么回事呢?
@Override
public boolean executeActionReturnUndoRecordNeeded() {
return false;
}
}

52
designer/src/com/fr/design/actions/cell/FloatStyleAction.java

@ -0,0 +1,52 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportStylePane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Cell Style.
*/
public class FloatStyleAction extends ElementCaseAction {
boolean okreturn = false;
public FloatStyleAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.GLOBAL_STYLE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
}
/**
* 执行动作
* @return 成功返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
final ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
final ReportStylePane reportStylePane = new ReportStylePane();
final BasicDialog styleDialog = reportStylePane.showWindow(SwingUtilities.getWindowAncestor(reportPane));
reportStylePane.populate(reportPane);
styleDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
reportStylePane.update(reportPane);
FloatStyleAction.this.okreturn = true;
}
});
styleDialog.setVisible(true);
return okreturn;
}
}

153
designer/src/com/fr/design/actions/cell/GlobalStyleMenuDef.java

@ -0,0 +1,153 @@
package com.fr.design.actions.cell;
/**
* richer:global style menu
*/
import com.fr.base.BaseUtils;
import com.fr.base.ConfigManager;
import com.fr.base.NameStyle;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef;
import com.fr.design.style.StylePane;
import com.fr.general.Inter;
import com.fr.base.ConfigManagerProvider;
import com.fr.stable.StringUtils;
import com.fr.stable.pinyin.PinyinHelper;
import java.awt.event.ActionEvent;
import java.util.Iterator;
public class GlobalStyleMenuDef extends MenuDef {
private static final int MAX_LENTH = 12;
private ElementCasePane ePane;
public GlobalStyleMenuDef(ElementCasePane ePane) {
this.ePane = ePane;
this.setMenuKeySet(KeySetUtils.GLOBAL_STYLE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setIconPath("/com/fr/design/images/m_web/style.png");
}
/**
* 更新菜单项
*/
public void updateMenu() {
UIMenu createdMenu = this.createJMenu();
createdMenu.removeAll();
ConfigManagerProvider configManager = ConfigManager.getProviderInstance();
Iterator iterator = configManager.getStyleNameIterator();
while (iterator.hasNext()) {
String name = (String) iterator.next();
NameStyle nameStyle = NameStyle.getInstance(name);
UpdateAction.UseMenuItem useMenuItem = new GlobalStyleSelection(ePane, nameStyle).createUseMenuItem();
useMenuItem.setNameStyle(nameStyle);
createdMenu.add(useMenuItem);
}
createdMenu.addSeparator();
createdMenu.add(new CustomStyleAction(Inter.getLocText("FR-Engine_Custom")));
}
/**
* 控制自定义样式名称的长度
*
* @param longName 名字
* @return 控制之后的名字
*/
public static String judgeChina(String longName) {
//neil:bug 1623 控制自定义样式名称的长度,只显示前12个字符,每个英文算1个字符,每个汉字算2个字符
Integer index = 0;
StringBuffer sBuffer = new StringBuffer();
for (int i = 0; i < longName.length(); i++) {
String bb = longName.substring(i, i + 1); //生成一个Pattern,同时编译一个正则表达式
boolean cc = PinyinHelper.isChinese(bb.charAt(0));
if (index == MAX_LENTH) {
sBuffer.append("..");
break;
}
if ((index == MAX_LENTH - 1 && cc)) {
continue;
}
if (cc) {
index = index + 2;
} else {
index = index + 1;
}
sBuffer.append(bb);
if (index > MAX_LENTH) {
sBuffer.append("..");
break;
}
}
return sBuffer.toString();
}
public static class CustomStyleAction extends UpdateAction {
public CustomStyleAction(String name) {
this.setName(name);
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
}
/**
* 动作
*
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
CellElementPropertyPane.getInstance().GoToPane(new String[]{Inter.getLocText("FR-Engine_Style"), Inter.getLocText("FR-Engine_Custom")});
}
}
public static class GlobalStyleSelection extends ElementCaseAction {
private NameStyle nameStyle;
public GlobalStyleSelection(ElementCasePane t, NameStyle nameStyle) {
super(t);
setName(StringUtils.EMPTY);
//重复画了一次,不需要icon
// this.setName(nameStyle == null ? "" : nameStyle.getName());
// this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
this.setNameStyle(nameStyle);
}
public NameStyle getNameStyle() {
return this.nameStyle;
}
public void setNameStyle(NameStyle nameStyle) {
this.nameStyle = nameStyle;
}
/**
* 执行动作返回
* @return 是返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
StylePane stylePane = new StylePane();
if (StringUtils.isEmpty(this.getName())) {
stylePane.setGlobalStyle(this.getNameStyle());
} else {
stylePane.setGlobalStyle(NameStyle.getInstance(this.getName()));
}
stylePane.updateGlobalStyle(getEditingComponent());
return true;
}
}
}

84
designer/src/com/fr/design/actions/cell/NewPresentAction.java

@ -0,0 +1,84 @@
package com.fr.design.actions.cell;
import com.fr.base.present.Present;
import com.fr.design.actions.PresentCheckBoxAction;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.TemplateCellElement;
import com.fr.stable.StableUtils;
public class NewPresentAction extends PresentCheckBoxAction {
private String itemName = null;
public NewPresentAction(ElementCasePane t, String title, String name) {
super(t);
this.setName(title);
this.itemName = name;
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
if (!ComparatorUtils.equals(this.itemName, "NOPRESENT")) {
CellElementPropertyPane.getInstance().GoToPane(Inter.getLocText("Present"), this.itemName);
} else {
TemplateCellElement ce = getSelectedCellElement();
// 只有原来ce设置了形态的情况下才有undo操作
if (ce != null && ce.getPresent() != null) {
ce.setPresent(null);
return true;
} else {
return false;
}
}
return false;
}
@Override
public boolean isSelected() {
return hasCurrentPresentSet();
}
// TODO ALEX_SEP enable有没有可能也通过这个方法来解决呢?
private TemplateCellElement getSelectedCellElement() {
ElementCasePane ePane = this.getEditingComponent();
Selection sel = ePane.getSelection();
if (sel instanceof CellSelection) {
return (TemplateCellElement) ePane.getEditingElementCase().getCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow());
}
return null;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
Selection sel = ePane.getSelection();
if (sel instanceof CellSelection) {
this.setEnabled(true);
} else {
this.setEnabled(false);
}
}
public boolean hasCurrentPresentSet() {
TemplateCellElement ce = getSelectedCellElement();
if (ce != null) {
Present currentPresent = ce.getPresent();
try {
Class clazz = GeneralUtils.classForName(itemName);
if (itemName.equals(currentPresent.getClass().getName())) {
return StableUtils.classInstanceOf(currentPresent.getClass(), clazz);
}
} catch (Exception e) {
return "NOPRESENT".equals(itemName) && currentPresent == null;
}
}
return false;
}
}

33
designer/src/com/fr/design/actions/cell/StyleAction.java

@ -0,0 +1,33 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell;
import java.awt.event.ActionEvent;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
public class StyleAction extends UpdateAction {
public StyleAction() {
this.setMenuKeySet(KeySetUtils.GLOBAL_STYLE);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cell.png"));
}
/**
* 动作
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
CellElementPropertyPane.getInstance().GoToPane(new String[] { Inter.getLocText("Style"), Inter.getLocText("Custom") });
}
}

308
designer/src/com/fr/design/actions/cell/UIToolbarBorderButton.java

@ -0,0 +1,308 @@
package com.fr.design.actions.cell;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JSeparator;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UICombinationButton;
import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.icon.BorderIcon;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.BorderUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.stable.Constants;
import com.fr.design.style.BorderPane;
import com.fr.design.style.color.TransparentPane;
import com.fr.design.utils.gui.GUICoreUtils;
/**
* 这个Pane用来显示常用边框和设置自定义边框
*
* @author richer
*
*/
public class UIToolbarBorderButton extends UICombinationButton implements PopupHider {
private EventListenerList styleChangeListenerList = new EventListenerList();
private boolean isCanBeNull = false;
private ElementCasePane reportPane;
private JPopupMenu popupWin;
public UIToolbarBorderButton(Icon icon, ElementCasePane reportPane) {
super(new UIButton(icon), new UIButton(BaseUtils.readIcon("/com/fr/design/images/gui/popup.gif")));
this.reportPane = reportPane;
}
public CellBorderStyle getCellBorderStyle() {
return this.cellBorderStyle;
}
public void setCellBorderStyle(CellBorderStyle cellBorderStyle) {
this.cellBorderStyle = cellBorderStyle;
this.leftButton.setIcon(new BorderIcon(cellBorderStyle));
fireStyleStateChanged();
}
@Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (!enabled) {
cellBorderStyle = null;
}
leftButton.setEnabled(enabled);
rightButton.setEnabled(enabled);
}
@Override
public void setToolTipText(String tooltipText) {
super.setToolTipText(tooltipText);
leftButton.setToolTipText(tooltipText);
rightButton.setToolTipText(tooltipText);
}
private void showPopupMenu() {
if (popupWin != null && popupWin.isVisible()) {
hidePopupMenu();
return;
}
if (!this.isEnabled()) {
return;
}
popupWin = this.getActionPopupMenu();
GUICoreUtils.showPopupMenu(popupWin, this, 0, this.getSize().height);
}
protected JPopupMenu getActionPopupMenu() {
if (this.popupWin == null) {
this.popupWin = new BorderStyleControlWindow(this.isCanBeNull());
}
return popupWin;
}
protected void leftButtonClickEvent() {
UIToolbarBorderButton.this.cellBorderStyle = ((BorderIcon)getLeftButton().getIcon()).cellBorderStyle;
UIToolbarBorderButton.this.fireStyleStateChanged();
}
@Override
protected void rightButtonClickEvent() {
showPopupMenu();
}
class BorderStyleControlWindow extends JPopupMenu {
/**
* Constructor
*/
public BorderStyleControlWindow(boolean isSupportTransparent) {
this.initComponents(isSupportTransparent);
}
public void initComponents(boolean isSupportTransparent) {
setLightWeightPopupEnabled(JPopupMenu.getDefaultLightWeightPopupEnabled());
this.setLayout(FRGUIPaneFactory.createBorderLayout());
setBorderPainted(true);
setBorder(UIManager.getBorder("PopupMenu.border"));
setOpaque(false);
setDoubleBuffered(true);
setFocusable(false);
this.add(new NormalBorderPane(isSupportTransparent, UIToolbarBorderButton.this), BorderLayout.CENTER);
this.pack();
}
}
// richer:常用边框线类型展现面板
class NormalBorderPane extends TransparentPane {
PopupHider popupHider;
public NormalBorderPane(boolean isSupportTransparent, PopupHider popupHider) {
super(isSupportTransparent);
this.popupHider = popupHider;
}
@Override
public void initCenterPaneChildren(JPanel centerPane) {
JPanel menuColorPane = new /**/JPanel();
centerPane.add(menuColorPane);
menuColorPane.setLayout(new /**/GridLayout(3, 4, 2, 2));
for (int i = 0; i < borderStyleArray.length; i++) {
final UIButton borderStyleCell = new UIButton(new BorderIcon(borderStyleArray[i]));
borderStyleCell.set4ToolbarButton();
borderStyleCell.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
UIButton toolBarButton = (UIButton) e.getSource();
if (toolBarButton.getIcon() instanceof BorderIcon) {
BorderIcon borderIcon = (BorderIcon) toolBarButton.getIcon();
UIToolbarBorderButton.this.setCellBorderStyle(borderIcon.cellBorderStyle);
hidePopupMenu();
} else {
UIToolbarBorderButton.this.setCellBorderStyle(borderStyleArray[0]);
}
}
});
borderStyleCell.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
borderStyleCell.setBorder(BorderFactory.createEtchedBorder());
}
@Override
public void mouseExited(MouseEvent e) {
borderStyleCell.setBorder(null);
}
});
borderStyleCell.setToolTipText(BorderStyleTooltips[i]);
menuColorPane.add(borderStyleCell);
}
centerPane.add(Box.createVerticalStrut(5));
centerPane.add(new JSeparator());
centerPane.add(Box.createVerticalStrut(5));
}
@Override
public void doTransparent() {
UIToolbarBorderButton.this.setCellBorderStyle(null);
popupHider.hidePopupMenu();
}
@Override
public void customButtonPressed() {
popupHider.hidePopupMenu();
final BorderPane borderPane = new BorderPane();
BasicDialog borderDialog = borderPane.showWindow(SwingUtilities.getWindowAncestor(reportPane));
Object[] fourObjectArray = BorderUtils.createCellBorderObject(reportPane);
if (fourObjectArray != null && fourObjectArray.length == 4) {
borderPane.populate((CellBorderStyle) fourObjectArray[0], ((Boolean) fourObjectArray[1]).booleanValue(),
((Integer) fourObjectArray[2]).intValue(), (Color) fourObjectArray[3]);
}
borderDialog.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
CellBorderStyle cellBorderStyle = borderPane.update();
UIToolbarBorderButton.this.setCellBorderStyle(cellBorderStyle);
}
});
borderDialog.setVisible(true);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Border");
}
}
/**
* Adds a new StyleChangeListener
*/
public void addStyleChangeListener(ChangeListener changeListener) {
styleChangeListenerList.add(ChangeListener.class, changeListener);
}
/**
* Removes an old StyleChangeListener.
*/
public void removeColorChangeListener(ChangeListener changeListener) {
styleChangeListenerList.remove(ChangeListener.class, changeListener);
}
/**
*
*/
public void fireStyleStateChanged() {
Object[] listeners = styleChangeListenerList.getListenerList();
ChangeEvent e = null;
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
if (e == null) {
e = new ChangeEvent(this);
}
((ChangeListener) listeners[i + 1]).stateChanged(e);
}
}
}
public boolean isCanBeNull() {
return this.isCanBeNull;
}
public void setCanBeNull(boolean isCanBeNull) {
this.isCanBeNull = isCanBeNull;
}
private CellBorderStyle cellBorderStyle = new CellBorderStyle();
private static final CellBorderStyle[] borderStyleArray = {
new CellBorderStyle(),
new CellBorderStyle(Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_THIN, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black,
Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_DOUBLE, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_THICK, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_THIN, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_DOUBLE, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_THICK, Color.black,
Constants.LINE_NONE, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_THIN, Color.black,
Constants.LINE_THIN, Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_THIN),
new CellBorderStyle(Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_THIN, Color.black, Constants.LINE_THIN, Color.black,
Constants.LINE_THIN, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE),
new CellBorderStyle(Color.black, Constants.LINE_THICK, Color.black, Constants.LINE_THICK, Color.black, Constants.LINE_THICK, Color.black,
Constants.LINE_THICK, Color.black, Constants.LINE_NONE, Color.black, Constants.LINE_NONE) };
private static final String[] BorderStyleTooltips = { Inter.getLocText("NO_Border_Line"), Inter.getLocText("Bottom_Border_Line"),
Inter.getLocText("Left_Border_Line"), Inter.getLocText("Right_Border_Line"), Inter.getLocText("Double_Bottom_BorderLine"),
Inter.getLocText("Thick_Bottom_Border_Line"), Inter.getLocText("Top_Bottom_Border_Line"),
Inter.getLocText("Top_And_Double_Bottom_Border_Line"), Inter.getLocText("Top_And_Thick_Bottom_Border_Line"),
Inter.getLocText("All_Border_Line"), Inter.getLocText("Out_Border_Line"), Inter.getLocText("Out_Thick_Border_Line") };
@Override
public void hidePopupMenu() {
if (popupWin != null) {
popupWin.setVisible(false);
}
popupWin = null;
}
}

82
designer/src/com/fr/design/actions/cell/style/AbstractStyleAction.java

@ -0,0 +1,82 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
/**
* Abstract cellstyle.
*/
public abstract class AbstractStyleAction extends ElementCaseAction implements StyleActionInterface {
protected AbstractStyleAction(ElementCasePane t) {
super(t);
}
@Override
public abstract Style executeStyle(Style style, Style defStyle);
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
return ReportActionUtils.executeAction(this, reportPane);
}
/**
* Update Style.
*
* @param style the updated style.
*/
@Override
public void updateStyle(Style style) {
// peter:这个方法默认情况下什么都不做.
}
public boolean isFontStye() {
return true;
}
@Override
public void update() {
// james:应该从Action中的ReportPane拿Style,而不是从reportFrame中拿
this.setEnabled(true);
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
this.setEnabled(false);
return;
}
if (isFontStye()) {
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase();
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
if (selectedFloat == null) {
//有情况是撤销worksheet里面的元素撤消了,但是reportpane里面的selection没有变
reportPane.setSelection(new CellSelection());
return;
}
Object value = selectedFloat.getValue();
if (value instanceof BaseChartCollection) {
this.setEnabled(false);
return;
}
}
}
// 更新Style
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
}
}

111
designer/src/com/fr/design/actions/cell/style/AlignmentAction.java

@ -0,0 +1,111 @@
package com.fr.design.actions.cell.style;
import javax.swing.Icon;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.constants.UIConstants;
import com.fr.design.actions.ButtonGroupAction;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
public class AlignmentAction extends ButtonGroupAction implements StyleActionInterface {
public AlignmentAction(ElementCasePane t, Icon[] iconArray,
Integer[] valueArray) {
super(t, iconArray, valueArray);
}
/**
* executeStyle
*
* @param style
* @param selectedStyle
* @return style
*/
public Style executeStyle(Style style, Style selectedStyle) {
return style.deriveHorizontalAlignment(getSelectedValue());
}
/**
* 更新Style
*
* @param style style
*/
public void updateStyle(Style style) {
setSelectedIndex(BaseUtils.getAlignment4Horizontal(style));
}
/**
* executeActionReturnUndoRecordNeeded
*
* @return
*/
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
return ReportActionUtils.executeAction(this, reportPane);
}
/**
* update
*/
public void update() {
super.update();
//peter:如果当前没有ReportFrame,不需要继续.
if (!this.isEnabled()) {
return;
}
//got simple cell element from row and column
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
this.setEnabled(false);
return;
}
Selection cs = reportPane.getSelection();
TemplateElementCase tplEC = reportPane.getEditingElementCase();
if (tplEC != null && cs instanceof FloatSelection) {
FloatElement selectedFloat = tplEC.getFloatElement(((FloatSelection) cs).getSelectedFloatName());
Object value = selectedFloat.getValue();
if (value instanceof BaseChartCollection) {
this.setEnabled(false);
return;
}
}
this.updateStyle(ReportActionUtils.getCurrentStyle(reportPane));
}
/**
* 创建工具条且有提示
*
* @return
*/
public UIButtonGroup<Integer> createToolBarComponent() {
UIButtonGroup<Integer> group = super.createToolBarComponent();
if (group != null) {
group.setForToolBarButtonGroup(true);
group.setAllToolTips(new String[]{Inter.getLocText("StyleAlignment-Left"), Inter.getLocText("Center"), Inter.getLocText("StyleAlignment-Right")});
}
for (int i = 0; i < 3; i++) {
group.getButton(i).setRoundBorder(true, UIConstants.ARC);
group.getButton(i).setBorderPainted(true);
}
return group;
}
}

91
designer/src/com/fr/design/actions/cell/style/ReportFontBoldAction.java

@ -0,0 +1,91 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.design.actions.ToggleButtonUpdateAction;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.GUICoreUtils;
/**
* Bold.
*/
public class ReportFontBoldAction extends AbstractStyleAction implements ToggleButtonUpdateAction {
private UIToggleButton button;
protected Style style;
public ReportFontBoldAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-bold"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
}
/**
* 根据按钮状态获取格式
*
* @param style
* @param defStyle
* @return
*/
@Override
public Style executeStyle(Style style, Style defStyle) {
createToolBarComponent().setSelected(!createToolBarComponent().isSelected());
if (createToolBarComponent().isSelected()) {
setSelectedFont(style);
createToolBarComponent().setSelected(false);
} else {
setUnselectedFont(style);
createToolBarComponent().setSelected(true);
}
return this.style;
}
protected void setSelectedFont(Style style) {
this.style = StyleUtils.boldReportFont(style);
}
protected void setUnselectedFont(Style style) {
this.style = StyleUtils.unBoldReportFont(style);
}
/**
* Update Style.
*/
@Override
public void updateStyle(Style style) {
if (style == null) {
return;
}
FRFont frFont = style.getFRFont();
if (frFont == null) {
return;
}
createToolBarComponent().setSelected(isStyle(frFont));
}
protected boolean isStyle(FRFont frFont) {
return frFont.isBold();
}
/**
* Gets component on toolbar.
*
* @return the created components on toolbar.
*/
@Override
public UIToggleButton createToolBarComponent() {
if (button == null) {
button = GUICoreUtils.createToolBarComponent(this);
button.setEventBannded(true);
}
return button;
}
}

68
designer/src/com/fr/design/actions/cell/style/ReportFontForegroundAction.java

@ -0,0 +1,68 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import java.awt.Color;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.design.actions.core.ActionUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.style.color.UIToolbarColorButton;
/**
* Foreground.
*/
public class ReportFontForegroundAction extends AbstractStyleAction implements ChangeListener {
public ReportFontForegroundAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Foreground"));
}
public void stateChanged(ChangeEvent evt) {
this.actionPerformedUndoable();
}
@Override
public Style executeStyle(Style style, Style defStyle) {
Object object = this.getValue(UIToolbarColorButton.class.getName());
if (object != null && object instanceof UIToolbarColorButton) {
Color selectedColor = ((UIToolbarColorButton) object).getColor();
if (style.getFRFont() != null &&
ComparatorUtils.equals(selectedColor, style.getFRFont())) {
return style;
}
style = StyleUtils.setReportFontForeground(style, selectedColor);
}
return style;
}
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIToolbarColorButton.class.getName());
if (object == null || !(object instanceof UIToolbarColorButton)) {
UIToolbarColorButton tbButton = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"));
this.putValue(UIToolbarColorButton.class.getName(), tbButton);
tbButton.set4Toolbar();
tbButton.setEnabled(this.isEnabled());
tbButton.addColorChangeListener(this);
//peter:产生tooltip
tbButton.setToolTipText(ActionUtils.createButtonToolTipText(this));
return tbButton;
}
return (JComponent) object;
}
}

39
designer/src/com/fr/design/actions/cell/style/ReportFontItalicAction.java

@ -0,0 +1,39 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Bold.
*/
public class ReportFontItalicAction extends ReportFontBoldAction {
public ReportFontItalicAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-italic"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
}
protected void setSelectedFont (Style style) {
this.style = StyleUtils.italicReportFont(style);
}
protected void setUnselectedFont (Style style) {
this.style = StyleUtils.unItalicReportFont(style);
}
protected boolean isStyle(FRFont frFont) {
return frFont.isItalic();
}
}

104
designer/src/com/fr/design/actions/cell/style/ReportFontNameAction.java

@ -0,0 +1,104 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import java.awt.Dimension;
import javax.swing.ComboBoxModel;
import javax.swing.JComponent;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.base.core.StyleUtils;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Font name..
*/
public class ReportFontNameAction extends AbstractStyleAction {
public ReportFontNameAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-Family"));
}
@Override
public Style executeStyle(Style style, Style defStyle) {
Object object = this.getValue(UIComboBox.class.getName());
if (object != null && object instanceof UIComboBox) {
String selectedFontName = (String) ((UIComboBox) object).getSelectedItem();
//这两个if 语句的意思是:如果传过来的cellStyle.getFRFont() 即不为空也和原来的被选择的相同。则不改变。
// 首先判断是否为空,如果空出错。
//然后将它们的类型均转化为delCellStyle相同。然后再将之判断是否与选择的相同否。如不同则转化为相同。
if (ComparatorUtils.equals(style.getFRFont().getName(), defStyle.getFRFont().getName())) {
style = StyleUtils.setReportFontName(style, defStyle.getFRFont().getName());
}
if (ComparatorUtils.equals(selectedFontName, style.getFRFont().getName())) {
return style;
}
style = StyleUtils.setReportFontName(style, selectedFontName);
}
return style;
}
public void setFontName(String fontName) {
Object object = this.getValue(UIComboBox.class.getName());
if (object != null && object instanceof UIComboBox) {
UIComboBox comboBox = (UIComboBox) object;
ComboBoxModel comboBoxModel = comboBox.getModel();
for (int i = 0; i < comboBoxModel.getSize(); i++) {
Object item = comboBoxModel.getElementAt(i);
if (ComparatorUtils.equals(item, fontName)) {
//设置新Font Name
comboBox.removeActionListener(this);
comboBox.setSelectedIndex(i);
comboBox.addActionListener(this);
break;
}
}
}
}
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIComboBox.class.getName());
if (object == null || !(object instanceof UIComboBox)) {
UIComboBox itemComponent = new UIComboBox(Utils.getAvailableFontFamilyNames4Report());
this.putValue(UIComboBox.class.getName(), itemComponent);
//设置最佳宽度.
itemComponent.setPreferredSize(new Dimension(
Math.min(140, itemComponent.getPreferredSize().width),
itemComponent.getPreferredSize().height));
itemComponent.setEnabled(this.isEnabled());
itemComponent.addActionListener(this);
return itemComponent;
}
return (UIComboBox) object;
}
/**
* Update Style.
*/
@Override
public void updateStyle(Style style) {
if (style == null) {
return;
}
FRFont frFont = style.getFRFont();
if (frFont == null) {
return;
}
this.setFontName(frFont.getFamily());
}
}

127
designer/src/com/fr/design/actions/cell/style/ReportFontSizeAction.java

@ -0,0 +1,127 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import java.awt.Dimension;
import java.util.Vector;
import javax.swing.JComponent;
import com.fr.base.Style;
import com.fr.base.Utils;
import com.fr.base.core.StyleUtils;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
/**
* Font size.
*/
public class ReportFontSizeAction extends AbstractStyleAction {
private static final int MAX_FONT_SIZE = 100;
public ReportFontSizeAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-Size"));
}
/**
* 应用选中的样式
*
* @param style 之前的样式
* @param defStyle 选中的样式
*
* @return 更改后的样式
*
* @date 2015-1-22-下午4:54:00
*
*/
public Style executeStyle(Style style, Style defStyle) {
Object object = this.getValue(UIComboBox.class.getName());
if (object != null && object instanceof UIComboBox) {
Object value = ((UIComboBox) object).getSelectedItem();
float selectedFontSize;
selectedFontSize = Utils.round5(Float.parseFloat(value.toString()));
if (style.getFRFont().getSize() == defStyle.getFRFont().getSize()) {
style = StyleUtils.setReportFontSize(style, defStyle.getFRFont().getSize());
}
if (selectedFontSize == style.getFRFont().getSize()) {
return style;
}
style = StyleUtils.setReportFontSize(style, selectedFontSize);
}
return style;
}
public void setFontSize(float size) {
Object object = this.getValue(UIComboBox.class.getName());
if (object != null && object instanceof UIComboBox) {
UIComboBox comboBox = (UIComboBox) object;
//先和以前的Font Size比较.
if (ComparatorUtils.equals(comboBox.getSelectedItem(), size)) {
return;
}
//设置新Font Size
comboBox.removeActionListener(this);
comboBox.setSelectedItem(size + "");
comboBox.addActionListener(this);
}
}
/**
* 创建工具栏组件
*
* @return 组件
*
* @date 2015-1-22-下午4:53:29
*
*/
public JComponent createToolBarComponent() {
Object object = this.getValue(UIComboBox.class.getName());
if (object == null || !(object instanceof UIComboBox)) {
Vector<Integer> integerList = new Vector<Integer>();
for (int i = 1; i < MAX_FONT_SIZE; i++) {
integerList.add(i);
}
UIComboBox itemComponent = new UIComboBox(integerList);
this.putValue(UIComboBox.class.getName(), itemComponent);
itemComponent.setMinimumSize(new Dimension(50, 20));
itemComponent.setPreferredSize(new Dimension(50, 20));
itemComponent.setEnabled(this.isEnabled());
itemComponent.addActionListener(this);
//需求字体大小可编辑
itemComponent.setEditable(true);
return itemComponent;
}
return (JComponent) object;
}
/**
* 更新样式
*
* @param style 样式
*
*/
@Override
public void updateStyle(Style style) {
if (style == null) {
return;
}
FRFont frFont = style.getFRFont();
if (frFont == null) {
return;
}
setFontSize(Utils.round5(frFont.getSize2D()));
}
}

38
designer/src/com/fr/design/actions/cell/style/ReportFontUnderlineAction.java

@ -0,0 +1,38 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.core.StyleUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.stable.Constants;
/**
* Bold.
*/
public class ReportFontUnderlineAction extends ReportFontBoldAction {
public ReportFontUnderlineAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("FRFont-Underline"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png"));
}
protected void setSelectedFont (Style style) {
this.style = StyleUtils.setReportFontUnderline(style, true);
}
protected void setUnselectedFont (Style style) {
this.style = StyleUtils.setReportFontUnderline(style, false);
}
protected boolean isStyle(FRFont frFont) {
return frFont.getUnderline() != Constants.LINE_NONE;
}
}

17
designer/src/com/fr/design/actions/cell/style/StyleActionInterface.java

@ -0,0 +1,17 @@
package com.fr.design.actions.cell.style;
import com.fr.base.Style;
/**
* peter:这个方法只是在编辑Style的时候使用.
*/
public interface StyleActionInterface {
public Style executeStyle(Style style2Mod, Style selectedStyle);
/**
* Update Style.
*
* @param style style
*/
public void updateStyle(Style style);
}

77
designer/src/com/fr/design/actions/cell/style/StyleBackgroundAction.java

@ -0,0 +1,77 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.cell.style;
import java.awt.Color;
import javax.swing.JComponent;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.base.background.ColorBackground;
import com.fr.design.actions.core.ActionUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.style.color.UIToolbarColorButton;
/**
* Background.
*/
public class StyleBackgroundAction extends AbstractStyleAction implements ChangeListener {
public StyleBackgroundAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Background"));
}
public void stateChanged(ChangeEvent evt) {
this.actionPerformedUndoable();
}
@Override
public Style executeStyle(Style style, Style defStyle) {
Object object = this.getValue(UIToolbarColorButton.class.getName());
if (object != null && object instanceof UIToolbarColorButton) {
Color selectedColor = ((UIToolbarColorButton) object).getColor();
if (style.getBackground() != null &&
style.getBackground() instanceof ColorBackground &&
ComparatorUtils.equals(selectedColor,
((ColorBackground) style.getBackground()).getColor())) {
return style;
}
style = style.deriveBackground(ColorBackground.getInstance(selectedColor));
}
return style;
}
@Override
public boolean isFontStye() {
return false;
}
@Override
public JComponent createToolBarComponent() {
Object object = this.getValue(UIToolbarColorButton.class.getName());
if (object == null || !(object instanceof UIToolbarColorButton)) {
UIToolbarColorButton tbButton = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/background.png"));
tbButton.set4Toolbar();
this.putValue(UIToolbarColorButton.class.getName(), tbButton);
tbButton.setEnabled(this.isEnabled());
tbButton.setColor(Color.WHITE);
tbButton.addColorChangeListener(this);
//peter:产生tooltip
tbButton.setToolTipText(ActionUtils.createButtonToolTipText(this));
return tbButton;
}
return (JComponent) object;
}
}

20
designer/src/com/fr/design/actions/columnrow/AbstractColumnRowIndexAction.java

@ -0,0 +1,20 @@
package com.fr.design.actions.columnrow;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
public abstract class AbstractColumnRowIndexAction extends CellSelectionAction {
private int index = 0;
protected AbstractColumnRowIndexAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t);
this.index = indexOfColumnOrRow;
}
/**
* Return index.
*/
public int getIndex() {
return this.index;
}
}

38
designer/src/com/fr/design/actions/columnrow/CancelColumnAction.java

@ -0,0 +1,38 @@
package com.fr.design.actions.columnrow;
import com.fr.page.ReportPageAttrProvider;
import com.fr.design.actions.CellSelectionAction;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
public class CancelColumnAction extends CellSelectionAction{
public CancelColumnAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Cancel_Repeat_Attributes"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
if (report.getReportPageAttr() == null) {
return false;
}
int[] columns = cs.getSelectedColumns();
ReportPageAttrProvider pageAttr = report.getReportPageAttr();
int i = columns[0];
if (i == pageAttr.getRepeatHeaderColumnFrom() || i == pageAttr.getRepeatHeaderColumnTo()) {
pageAttr.setRepeatHeaderColumnFrom(-1);
pageAttr.setRepeatHeaderColumnTo(-1);
}
if (i == pageAttr.getRepeatFooterColumnFrom() || i == pageAttr.getRepeatFooterColumnTo()) {
pageAttr.setRepeatFooterColumnFrom(-1);
pageAttr.setRepeatFooterColumnTo(-1);
}
return true;
}
}

40
designer/src/com/fr/design/actions/columnrow/CancelRowAction.java

@ -0,0 +1,40 @@
package com.fr.design.actions.columnrow;
import com.fr.page.ReportPageAttrProvider;
import com.fr.design.actions.CellSelectionAction;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
public class CancelRowAction extends CellSelectionAction {
public CancelRowAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Cancel_Repeat_Attributes"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] rows = cs.getSelectedRows();
if (report.getReportPageAttr() == null) {
return false;
}
ReportPageAttrProvider pageAttr = report.getReportPageAttr();
int i = rows[0];
if (i == pageAttr.getRepeatHeaderRowFrom() || i == pageAttr.getRepeatHeaderRowTo()) {
pageAttr.setRepeatHeaderRowFrom(-1);
pageAttr.setRepeatHeaderRowTo(-1);
}
if (i == pageAttr.getRepeatFooterRowFrom() || i == pageAttr.getRepeatFooterRowTo()) {
pageAttr.setRepeatFooterRowFrom(-1);
pageAttr.setRepeatFooterRowTo(-1);
}
return true;
}
}

29
designer/src/com/fr/design/actions/columnrow/ColumnHideAction.java

@ -0,0 +1,29 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNIT;
public class ColumnHideAction extends AbstractColumnRowIndexAction {
public ColumnHideAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText("Hide"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] cols = cs.getSelectedColumns();
for (int i = 0; i < cols.length; i++) {
report.setColumnWidth(cols[i], UNIT.ZERO);
}
ePane.fireTargetModified();
ePane.repaint();
return false;
}
}

47
designer/src/com/fr/design/actions/columnrow/ColumnRowRepeatAction.java

@ -0,0 +1,47 @@
package com.fr.design.actions.columnrow;
import com.fr.page.ReportPageAttrProvider;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.bridge.StableFactory;
public abstract class ColumnRowRepeatAction extends CellSelectionAction {
public ColumnRowRepeatAction(ElementCasePane t) {
super(t);
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] indices;
if (isColumn()) {
indices = cs.getSelectedColumns();
} else {
indices = cs.getSelectedRows();
}
doReportPageAttrSet(isColumn(), isFoot(), report, indices[0], indices[indices.length - 1]);
return true;
}
protected abstract boolean isColumn();
protected abstract boolean isFoot();
private void doReportPageAttrSet(boolean isColumn, boolean isFoot, ElementCase elementCase, int from, int to) {
ReportPageAttrProvider reportPageAttr = elementCase.getReportPageAttr();
if (reportPageAttr == null) {
reportPageAttr = (ReportPageAttrProvider) StableFactory.createXmlObject(ReportPageAttrProvider.XML_TAG);
elementCase.setReportPageAttr(reportPageAttr);
}
reportPageAttr.setRepeatFromTo(isFoot, isColumn, from, to);
}
}

120
designer/src/com/fr/design/actions/columnrow/ColumnRowSizingAction.java

@ -0,0 +1,120 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.design.DesignerEnvManager;
import com.fr.design.gui.frpane.UnitInputPane;
import com.fr.design.gui.frpane.UnitInputPane.ValueNotChangeException;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.unit.CM;
import com.fr.stable.unit.INCH;
import com.fr.stable.unit.MM;
import com.fr.stable.unit.PT;
import com.fr.stable.unit.UNIT;
/**
* @author richer
* @since 6.5.3
*/
public abstract class ColumnRowSizingAction extends AbstractColumnRowIndexAction {
protected ColumnRowSizingAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
final ElementCasePane ePane = this.getEditingComponent();
final ElementCase report = ePane.getEditingElementCase();
final UnitInputPane uPane = new UnitInputPane(3,title4UnitInputPane()) {
@Override
protected String title4PopupWindow() {
return ColumnRowSizingAction.this.title4UnitInputPane();
}
};
UNIT len = getShowLen(report, cs);
populateNumberDialog(uPane, len);
final CellSelection finalCS = cs;
uPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
try {
float newHeight = (float) uPane.update();
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
UNIT len;
if (unitType == Constants.UNIT_CM) {
len = new CM(newHeight);
} else if (unitType == Constants.UNIT_INCH) {
len = new INCH(newHeight);
} else if (unitType == Constants.UNIT_PT) {
len = new PT(newHeight);
} else {
len = new MM(newHeight);
}
updateAction(report, len, finalCS);
} catch (ValueNotChangeException e) {
// nothing
}
ePane.fireTargetModified();
}
}).setVisible(true);
return false;
}
protected void populateNumberDialog(final UnitInputPane uPane, UNIT unit) {
int unitType = DesignerEnvManager.getEnvManager().getReportLengthUnit();
float va;
if (unitType == Constants.UNIT_CM) {
va = unit.toCMValue4Scale2();
uPane.setUnitText(Inter.getLocText("Unit_CM"));
} else if (unitType == Constants.UNIT_INCH) {
va = unit.toINCHValue4Scale3();
uPane.setUnitText(Inter.getLocText("Unit_INCH"));
} else if (unitType == Constants.UNIT_PT) {
va = unit.toPTValue4Scale2();
uPane.setUnitText(Inter.getLocText("Unit_PT"));
} else {
va = unit.toMMValue4Scale2();
uPane.setUnitText(Inter.getLocText("Unit_MM"));
}
uPane.populate(va);
}
protected abstract String title4UnitInputPane();
protected abstract void updateAction(ElementCase report, UNIT len, CellSelection cs);
protected abstract UNIT getShowLen(ElementCase report, CellSelection cs);
protected abstract UNIT getIndexLen(int index, ElementCase report);
protected UNIT getSelectedCellsLen(int[] cells, ElementCase report){
int length = ArrayUtils.getLength(cells);
UNIT temp = null;
for (int i = 0; i < length; i++) {
UNIT current = getIndexLen(cells[i], report);
if (temp == null) {
temp = current;
continue;
}
if (temp.subtract(current).not_equal_zero()){
return UNIT.ZERO;
}
}
return getIndexLen(this.getIndex(), report);
}
}

46
designer/src/com/fr/design/actions/columnrow/ColumnWidthAction.java

@ -0,0 +1,46 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNIT;
/**
* Column width.
*/
public class ColumnWidthAction extends ColumnRowSizingAction {
public ColumnWidthAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText("Utils-Column_Width") + "...");
this.setMnemonic('C');
}
@Override
protected String title4UnitInputPane() {
return Inter.getLocText("Utils-Column_Width");
}
@Override
protected void updateAction(ElementCase report, UNIT len, CellSelection cs) {
int[] columns = cs.getSelectedColumns();
for (int i = 0; i < columns.length; i++) {
report.setColumnWidth(columns[i], len);
}
}
protected UNIT getIndexLen(int index, ElementCase report){
return report.getColumnWidth(index);
}
@Override
protected UNIT getShowLen(ElementCase report, CellSelection cs) {
int[] columns = cs.getSelectedColumns();
return getSelectedCellsLen(columns, report);
}
}

36
designer/src/com/fr/design/actions/columnrow/DSColumnAdvancedAction.java

@ -0,0 +1,36 @@
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.actions.cell.AbstractCellElementAction;
import com.fr.design.dscolumn.DSColumnAdvancedPane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.TemplateCellElement;
public class DSColumnAdvancedAction extends AbstractCellElementAction {
private boolean returnValue=false;
private TemplateCellElement editCellElement;
public DSColumnAdvancedAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Advanced"));
this.setMnemonic('A');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
}
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
this.editCellElement = cellElement;
DSColumnAdvancedPane dSColumnAdvancedPane = new DSColumnAdvancedPane();
dSColumnAdvancedPane.populate(cellElement);
return dSColumnAdvancedPane;
}
@Override
protected void updateBasicPane(BasicPane basicPane,
TemplateCellElement cellElement) {
((DSColumnAdvancedPane)basicPane).update(editCellElement);
}
}

88
designer/src/com/fr/design/actions/columnrow/DSColumnBasicAction.java

@ -0,0 +1,88 @@
package com.fr.design.actions.columnrow;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.dscolumn.DSColumnBasicPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
public class DSColumnBasicAction extends CellSelectionAction {
public DSColumnBasicAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Basic"));
// this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
final ElementCasePane reportPane = this.getEditingComponent();
final DSColumnBasicPane dsColumnBasicPane = new DSColumnBasicPane();
BasicDialog dSColumnBasicDialog = dsColumnBasicPane.showWindow(SwingUtilities.getWindowAncestor(reportPane));
// Got editCellElement.
TemplateCellElement editCellElement = null;
// got simple cell element from column and row.
final TemplateElementCase report = reportPane.getEditingElementCase();
editCellElement = report.getTemplateCellElement(cs.getColumn(), cs.getRow());
dsColumnBasicPane.putElementcase(getEditingComponent());
dsColumnBasicPane.putCellElement(editCellElement);
// alex:如果是线性报表,这时还要计算一下默认父格是什么z
if (report != null) {
SheetUtils.calculateDefaultParent(report);
}
dsColumnBasicPane.populate(null, editCellElement);
final CellSelection finalCS = cs;
dSColumnBasicDialog.addDialogActionListener(new CellElementDialogActionListenr(editCellElement) {
@Override
public void doOk() {
// 需要先行后列地增加新元素。
for (int j = 0; j < finalCS.getRowSpan(); j++) {
for (int i = 0; i < finalCS.getColumnSpan(); i++) {
int column = i + finalCS.getColumn();
int row = j + finalCS.getRow();
editCellElement = report.getTemplateCellElement(column, row);
if (editCellElement == null) {
editCellElement = new DefaultTemplateCellElement(column, row);
report.addCellElement(editCellElement);
}
// update cell attributes
dsColumnBasicPane.update(editCellElement);
}
}
reportPane.fireTargetModified();
}
});
dSColumnBasicDialog.setVisible(true);
return false;
}
public static class CellElementDialogActionListenr extends DialogActionAdapter {
TemplateCellElement editCellElement;
public CellElementDialogActionListenr(TemplateCellElement editCellElement) {
this.editCellElement = editCellElement;
}
}
}

36
designer/src/com/fr/design/actions/columnrow/DSColumnConditionAction.java

@ -0,0 +1,36 @@
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.actions.cell.AbstractCellElementAction;
import com.fr.design.dscolumn.DSColumnConditionsPane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.TemplateCellElement;
public class DSColumnConditionAction extends AbstractCellElementAction {
private boolean returnValue = false;
private TemplateCellElement editCellElement;
public DSColumnConditionAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Filter"));
this.setMnemonic('E');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/expand/cellAttr.gif"));
}
@Override
protected BasicPane populateBasicPane(TemplateCellElement cellElement) {
DSColumnConditionsPane dSColumnConditionsPane = new DSColumnConditionsPane();
dSColumnConditionsPane.populate(DesignTableDataManager.getEditingTableDataSource(), cellElement);
return dSColumnConditionsPane;
}
@Override
protected void updateBasicPane(BasicPane bp, TemplateCellElement cellElement) {
((DSColumnConditionsPane) bp).update(cellElement);
}
}

62
designer/src/com/fr/design/actions/columnrow/DeleteColumnAction.java

@ -0,0 +1,62 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
/**
* Delete Column
*/
public class DeleteColumnAction extends CellSelectionAction {
public DeleteColumnAction(ElementCasePane t) {
this(t, DELETE_COLUMN.getMenuName());
}
public DeleteColumnAction(ElementCasePane t, String name) {
super(t);
this.setName(name);
this.setMnemonic(DELETE_COLUMN.getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/deleteColumn.png"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
// 删掉多行
int[] columns = cs.getSelectedColumns();
for (int i = 0; i < columns.length; i++) {
report.removeColumn(columns[i] - i);
}
return true;
}
public static final MenuKeySet DELETE_COLUMN= new MenuKeySet() {
@Override
public char getMnemonic() {
return 'D';
}
@Override
public String getMenuName() {
return Inter.getLocText("Column");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

63
designer/src/com/fr/design/actions/columnrow/DeleteRowAction.java

@ -0,0 +1,63 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
/**
* Delete Row
*/
public class DeleteRowAction extends CellSelectionAction {
public DeleteRowAction(ElementCasePane t) {
this(t, DELETE_ROW.getMenuName());
}
public DeleteRowAction(ElementCasePane t, String name) {
super(t);
this.setName(name);
this.setMnemonic(DELETE_ROW.getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/deleteRow.png"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
// 删掉多行
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
report.removeRow(rows[i] - i);
}
return true;
}
public static final MenuKeySet DELETE_ROW = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'D';
}
@Override
public String getMenuName() {
return Inter.getLocText("Row");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

24
designer/src/com/fr/design/actions/columnrow/FootColumnAction.java

@ -0,0 +1,24 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
public class FootColumnAction extends ColumnRowRepeatAction {
public FootColumnAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Set_Column_Title_End"));
// this.setMnemonic('F');
}
@Override
protected boolean isColumn() {
return true;
}
@Override
protected boolean isFoot() {
return true;
}
}

23
designer/src/com/fr/design/actions/columnrow/FootRowAction.java

@ -0,0 +1,23 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
public class FootRowAction extends ColumnRowRepeatAction {
public FootRowAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Set_Row_Title_End"));
// this.setMnemonic('F');
}
@Override
protected boolean isColumn() {
return false;
}
@Override
protected boolean isFoot() {
return true;
}
}

23
designer/src/com/fr/design/actions/columnrow/HeadColumnAction.java

@ -0,0 +1,23 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
public class HeadColumnAction extends ColumnRowRepeatAction {
public HeadColumnAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Set_Column_Title_Start"));
}
@Override
protected boolean isColumn() {
return true;
}
@Override
protected boolean isFoot() {
return false;
}
}

24
designer/src/com/fr/design/actions/columnrow/HeadRowAction.java

@ -0,0 +1,24 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
public class HeadRowAction extends ColumnRowRepeatAction {
public HeadRowAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Set_Row_Title_Start"));
// this.setMnemonic('H');
}
@Override
protected boolean isColumn() {
return false;
}
@Override
protected boolean isFoot() {
return false;
}
}

62
designer/src/com/fr/design/actions/columnrow/InsertColumnAction.java

@ -0,0 +1,62 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
/**
* Insert Column
*/
public class InsertColumnAction extends CellSelectionAction {
public InsertColumnAction(ElementCasePane t) {
this(t, INSERT_COLUMN.getMenuName());
}
public InsertColumnAction(ElementCasePane t, String name) {
super(t);
this.setName(name);
this.setMnemonic(INSERT_COLUMN.getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/insertColumn.png"));
}
public static final MenuKeySet INSERT_COLUMN = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'I';
}
@Override
public String getMenuName() {
return Inter.getLocText("Column");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] columns = cs.getSelectedColumns();
for (int i = 0; i < columns.length; i++) {
report.insertColumn(columns[i]);
}
return true;
}
}

62
designer/src/com/fr/design/actions/columnrow/InsertRowAction.java

@ -0,0 +1,62 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.base.BaseUtils;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import javax.swing.*;
/**
* Insert Row
*/
public class InsertRowAction extends CellSelectionAction {
public InsertRowAction(ElementCasePane t) {
this(t,INSERT_ROW.getMenuName());
}
public InsertRowAction(ElementCasePane t, String name) {
super(t);
this.setName(name);
this.setMnemonic(INSERT_ROW.getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/insertRow.png"));
}
public static final MenuKeySet INSERT_ROW = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'I';
}
@Override
public String getMenuName() {
return Inter.getLocText("Row");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
report.insertRow(rows[i]);
}
return true;
}
}

57
designer/src/com/fr/design/actions/columnrow/ResetColumnHideAction.java

@ -0,0 +1,57 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNITConstants;
public class ResetColumnHideAction extends AbstractColumnRowIndexAction {
public ResetColumnHideAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText(new String[]{"MConfig-CancelButton", "Hide"}));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] columns = cs.getSelectedColumns();
boolean ischanged = false;
for (int column : columns) {
if (report.getColumnWidth(column).equal_zero()) {
report.setColumnWidth(column, UNITConstants.DEFAULT_COL_WIDTH);
ischanged = true;
}
}
if (ischanged) {
ePane.repaint();
ePane.fireTargetModified();
}
return false;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
Selection s = ePane.getSelection();
if (s instanceof CellSelection) {
CellSelection cs = (CellSelection)s;
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
if (report.getColumnWidth(i).equal_zero()) {
this.setEnabled(true);
return;
}
}
}
this.setEnabled(false);
}
}

57
designer/src/com/fr/design/actions/columnrow/ResetRowHideAction.java

@ -0,0 +1,57 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNITConstants;
public class ResetRowHideAction extends AbstractColumnRowIndexAction {
public ResetRowHideAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText(new String[]{"MConfig-CancelButton", "Hide"}));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] rows = cs.getSelectedRows();
boolean ischanged = false;
for (int row : rows) {
if (report.getRowHeight(row).equal_zero()) {
report.setRowHeight(row, UNITConstants.DEFAULT_ROW_HEIGHT);
ischanged = true;
}
}
if (ischanged) {
ePane.repaint();
ePane.fireTargetModified();
}
return false;
}
@Override
public void update() {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
Selection s = ePane.getSelection();
if (s instanceof CellSelection) {
CellSelection cs = (CellSelection)s;
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
if (report.getRowHeight(i).equal_zero()) {
this.setEnabled(true);
return;
}
}
}
this.setEnabled(false);
}
}

47
designer/src/com/fr/design/actions/columnrow/RowHeightAction.java

@ -0,0 +1,47 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNIT;
/**
* Row height
*/
public class RowHeightAction extends ColumnRowSizingAction {
public RowHeightAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText("Utils-Row_Height") + "...");
this.setMnemonic('R');
}
@Override
protected String title4UnitInputPane() {
return Inter.getLocText("Utils-Row_Height");
}
@Override
protected void updateAction(ElementCase report, UNIT len, CellSelection cs) {
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
report.setRowHeight(rows[i], len);
}
}
@Override
protected UNIT getShowLen(ElementCase report, CellSelection cs) {
int[] rows = cs.getSelectedRows();
return getSelectedCellsLen(rows, report);
}
protected UNIT getIndexLen(int index, ElementCase report){
return report.getRowHeight(index);
}
}

29
designer/src/com/fr/design/actions/columnrow/RowHideAction.java

@ -0,0 +1,29 @@
package com.fr.design.actions.columnrow;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.elementcase.ElementCase;
import com.fr.stable.unit.UNIT;
public class RowHideAction extends AbstractColumnRowIndexAction {
public RowHideAction(ElementCasePane t, int indexOfColumnOrRow) {
super(t, indexOfColumnOrRow);
this.setName(Inter.getLocText("Hide"));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
int[] rows = cs.getSelectedRows();
for (int i = 0; i < rows.length; i++) {
report.setRowHeight(rows[i], UNIT.ZERO);
}
ePane.fireTargetModified();
ePane.repaint();
return false;
}
}

33
designer/src/com/fr/design/actions/edit/DeleteAction.java

@ -0,0 +1,33 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ElementCaseAction;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Delete Row, Column or FloatElement..
*/
public class DeleteAction extends ElementCaseAction {
/**
* Constructor
*/
public DeleteAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Delete") + "...");
this.setMnemonic('D');
//Richie:删除菜单图标
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/delete.png"));
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane ePane = getEditingComponent();
return ePane.getSelection().triggerDeleteAction(ePane);
}
}

70
designer/src/com/fr/design/actions/edit/EditFloatElementNameAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.edit;
import javax.swing.SwingUtilities;
import com.fr.design.actions.FloatSelectionAction;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.FloatSelection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
public class EditFloatElementNameAction extends FloatSelectionAction {
public EditFloatElementNameAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText(new String[]{"Set", "Float_Element_Name"}));
}
@Override
protected boolean executeActionReturnUndoRecordNeededWithFloatSelection(
FloatSelection fs) {
final ElementCasePane reportPane = getEditingComponent();
final ElementCase report = reportPane.getEditingElementCase();
//p:获得最后一个选中的悬浮元素.
final FloatElement selectedFloatElement = report.getFloatElement(fs.getSelectedFloatName());
final NamePane pane = new NamePane();
pane.populate(selectedFloatElement.getName());
BasicDialog nameDialog = pane.showSmallWindow(SwingUtilities.getWindowAncestor(reportPane),new DialogActionAdapter() {
@Override
public void doOk() {
String name = pane.update();
if (report.getFloatElement(name) == null) {
selectedFloatElement.setName(name);
}
reportPane.setSelection(new FloatSelection(name));
}
});
nameDialog.setVisible(true);
return true;
}
class NamePane extends BasicPane{
private UITextField jtext;
public NamePane() {
jtext = new UITextField(15);
this.add(jtext);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Set", "Float_Element_Name"});
}
public void populate(String name) {
jtext.setText(name);
}
public String update() {
return jtext.getText();
}
}
}

113
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -0,0 +1,113 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit;
import java.awt.Color;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.base.Style;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.actions.utils.ReportActionUtils.IterAction;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.Constants;
/**
* HyperlinkAction.
*/
public class HyperlinkAction extends ElementCaseAction {
private boolean b;
public HyperlinkAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.HYPER_LINK);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png"));
}
/**
* 计算Action,
* @return 返回是否需要记录undo
*/
public boolean executeActionReturnUndoRecordNeeded() {
b = true;
ElementCasePane reportPane = this.getEditingComponent();
if (reportPane == null) {
return false;
}
final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
final HyperlinkGroupPane pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane();
pane.populate(nameHyperlinks);
final Selection sel = reportPane.getSelection();
BasicDialog dialog = pane.showWindow(SwingUtilities.getWindowAncestor(reportPane));
dialog.addDialogActionListener(new DialogActionAdapter() {
public void doOk() {
super.doOk();
final NameJavaScriptGroup updateNameHyperlinks = pane.updateJSGroup();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new IterAction() {
public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont();
if (updateNameHyperlinks.size() > 0) {
frFont = frFont.applyForeground(Color.blue);
frFont = frFont.applyUnderline(Constants.LINE_THIN);
} else {
frFont = frFont.applyForeground(Color.black);
frFont = frFont.applyUnderline(Constants.LINE_NONE);
}
editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
editCellElement.setNameHyperlinkGroup(updateNameHyperlinks);
}
});
}
}
public void doCancel() {
b = false;
}
});
dialog.setVisible(true);
return b;
}
private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) {
NameJavaScriptGroup nameHyperlinks = null;
final Selection sel = reportPane.getSelection();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
nameHyperlinks = selectedFloatElement.getNameHyperlinkGroup();
} else {
CellElement editCellElement = report.getCellElement(((CellSelection)sel).getColumn(), ((CellSelection)sel).getRow());
if (editCellElement != null) {
nameHyperlinks = editCellElement.getNameHyperlinkGroup();
}
}
return nameHyperlinks;
}
}

17
designer/src/com/fr/design/actions/edit/clear/ClearAction.java

@ -0,0 +1,17 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.clear;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.mainframe.ElementCasePane;
/**
* @author richer
* @since 6.5.3
*/
public abstract class ClearAction extends ElementCaseAction {
protected ClearAction(ElementCasePane t) {
super(t);
}
}

31
designer/src/com/fr/design/actions/edit/clear/ClearAllAction.java

@ -0,0 +1,31 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.clear;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Clear all.
*/
public class ClearAllAction extends ClearAction {
/**
* Constructor
*/
public ClearAllAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Clear_All"));
this.setMnemonic('A');
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.clearAll();
}
}

31
designer/src/com/fr/design/actions/edit/clear/ClearContentsAction.java

@ -0,0 +1,31 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.clear;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Clear contents.
*/
public class ClearContentsAction extends ClearAction {
/**
* Constructor
*/
public ClearContentsAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Clear_Contents"));
this.setMnemonic('C');
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.clearContents();
}
}

31
designer/src/com/fr/design/actions/edit/clear/ClearFormatsAction.java

@ -0,0 +1,31 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.clear;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
/**
* Clear formats.
*/
public class ClearFormatsAction extends ClearAction {
/**
* Constructor
*/
public ClearFormatsAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Clear_Formats"));
this.setMnemonic('F');
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.clearFormats();
}
}

27
designer/src/com/fr/design/actions/edit/clear/ClearWidgetAction.java

@ -0,0 +1,27 @@
package com.fr.design.actions.edit.clear;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
//:jackie 用于清除控件
public class ClearWidgetAction extends ClearAction {
/**
* Constructor
*/
public ClearWidgetAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("Widget"));
this.setMnemonic('W');
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.clearWidget();
}
}

46
designer/src/com/fr/design/actions/edit/merge/MergeCellAction.java

@ -0,0 +1,46 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.merge;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.mainframe.ElementCasePane;
/**
* merge cell..
*/
public class MergeCellAction extends ElementCaseAction {
/**
* Constructor
*/
public MergeCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.MERGE_CELL);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/merge.png"));
}
/**
* 执行动作
* @return 是则返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.mergeCell();
}
@Override
public void update() {
super.update();
ElementCasePane reportPane = getEditingComponent();
this.setEnabled(reportPane.canMergeCell());
}
}

45
designer/src/com/fr/design/actions/edit/merge/UnmergeCellAction.java

@ -0,0 +1,45 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.merge;
import com.fr.base.BaseUtils;
import com.fr.design.actions.ElementCaseAction;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.mainframe.ElementCasePane;
/**
* unmerge cell..
*/
public class UnmergeCellAction extends ElementCaseAction {
/**
* Constructor
*/
public UnmergeCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.UNMERGE_CELL);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/unmerge.png"));
}
@Override
public void update() {
super.update();
ElementCasePane reportPane = getEditingComponent();
this.setEnabled(reportPane.canUnMergeCell());
}
/**
* 执行动作
* @return 是则返回true
*/
public boolean executeActionReturnUndoRecordNeeded() {
ElementCasePane reportPane = getEditingComponent();
if (reportPane == null) {
return false;
}
return reportPane.unMergeCell();
}
}

31
designer/src/com/fr/design/actions/edit/order/AbstractFloatElementOrderAction.java

@ -0,0 +1,31 @@
package com.fr.design.actions.edit.order;
import com.fr.design.actions.FloatSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.FloatSelection;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
/**
* FloatElement order.
*/
public abstract class AbstractFloatElementOrderAction extends FloatSelectionAction {
protected AbstractFloatElementOrderAction(ElementCasePane t) {
super(t);
}
@Override
public boolean executeActionReturnUndoRecordNeededWithFloatSelection(FloatSelection fs) {
ElementCasePane ePane = getEditingComponent();
ElementCase report = ePane.getEditingElementCase();
//p:获得最后一个选中的悬浮元素.
FloatElement selectedFloatElement = report.getFloatElement(fs.getSelectedFloatName());
orderWithSelectedFloatElement(report, selectedFloatElement);
return true;
}
public abstract void orderWithSelectedFloatElement(ElementCase report, FloatElement floatElement);
}

32
designer/src/com/fr/design/actions/edit/order/BringFloatElementForwardAction.java

@ -0,0 +1,32 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.order;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
/**
* Bring FloatElement forward.
*/
public class BringFloatElementForwardAction extends AbstractFloatElementOrderAction {
/**
* Constructor.
*/
public BringFloatElementForwardAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Bring_Forward"));
this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/bringForward.png"));
}
@Override
public void orderWithSelectedFloatElement(ElementCase report,
FloatElement floatElement) {
report.bringFloatElementForward(floatElement);
}
}

32
designer/src/com/fr/design/actions/edit/order/BringFloatElementToFrontAction.java

@ -0,0 +1,32 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.order;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
/**
* Bring FloatElement to front.
*/
public class BringFloatElementToFrontAction extends AbstractFloatElementOrderAction {
/**
* Constructor.
*/
public BringFloatElementToFrontAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Bring_to_Front"));
this.setMnemonic('t');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/bringToFront.png"));
}
@Override
public void orderWithSelectedFloatElement(ElementCase report,
FloatElement floatElement) {
report.bringFloatElementToFront(floatElement);
}
}

33
designer/src/com/fr/design/actions/edit/order/SendFloatElementBackwardAction.java

@ -0,0 +1,33 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.order;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
/**
* Send FloatElement backward.
*/
public class SendFloatElementBackwardAction extends AbstractFloatElementOrderAction {
/**
* Constructor
*/
public SendFloatElementBackwardAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Send_Backward"));
this.setMnemonic('B');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/sendBackward.png"));
}
@Override
public void orderWithSelectedFloatElement(ElementCase report,
FloatElement floatElement) {
report.sendFloatElementBackward(floatElement);
}
}

32
designer/src/com/fr/design/actions/edit/order/SendFloatElementToBackAction.java

@ -0,0 +1,32 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.edit.order;
import com.fr.base.BaseUtils;
import com.fr.general.Inter;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.ElementCase;
/**
* Send FloatElement to back.
*/
public class SendFloatElementToBackAction extends AbstractFloatElementOrderAction {
/**
* Constructor
*/
public SendFloatElementToBackAction(ElementCasePane t) {
super(t);
this.setName(Inter.getLocText("M_Edit-Send_to_Back"));
this.setMnemonic('K');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/sendToBack.png"));
}
@Override
public void orderWithSelectedFloatElement(ElementCase report,
FloatElement floatElement) {
report.sendFloatElementToBack(floatElement);
}
}

42
designer/src/com/fr/design/actions/file/export/AbstractExcelExportAction.java

@ -0,0 +1,42 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.ExcelUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.main.TemplateWorkBook;
/**
* Export excel.
*/
public abstract class AbstractExcelExportAction extends AbstractExportAction {
/**
* Constructor
*/
protected AbstractExcelExportAction(JWorkBook jwb) {
super(jwb);
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return new ChooseFileFilter(new String[]{"zip"}, "ZIP");
} else {
return new ChooseFileFilter(new String[]{"xls", "xlsx"}, Inter.getLocText("Export-Excel"));
}
}
@Override
protected String getDefaultExtension() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return "zip";
} else {
return ExcelUtils.checkPOIJarExist() ? "xlsx" : "xls";
}
}
}

184
designer/src/com/fr/design/actions/file/export/AbstractExportAction.java

@ -0,0 +1,184 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.FRContext;
import com.fr.base.Parameter;
import com.fr.page.PageSetProvider;
import com.fr.design.actions.JWorkBookAction;
import com.fr.design.gui.iprogressbar.FRProgressBar;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.parameter.ParameterInputPane;
import com.fr.design.dialog.DialogActionAdapter;
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 com.fr.io.exporter.*;
import com.fr.main.TemplateWorkBook;
import com.fr.main.impl.WorkBook;
import com.fr.report.ReportHelper;
import com.fr.report.core.ReportUtils;
import com.fr.report.report.Report;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.ActorConstants;
import com.fr.stable.ActorFactory;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.FileOutputStream;
import java.util.Map;
/**
* Abstract export action.
*/
public abstract class AbstractExportAction extends JWorkBookAction {
protected AbstractExportAction(JWorkBook jwb) {
super(jwb);
}
private FRProgressBar progressbar;
protected WorkBook getTemplateWorkBook() {
return this.getEditingComponent().getTarget();
}
/**
* 执行方法
*/
public void actionPerformed(ActionEvent e) {
JWorkBook jwb = this.getEditingComponent();
FILE editingFILE = jwb.getEditingFILE();
DesignerFrame designerFrame = DesignerContext.getDesignerFrame();
// 弹出参数
final java.util.Map parameterMap = new java.util.HashMap();
final TemplateWorkBook tpl = getTemplateWorkBook();
Parameter[] parameters = tpl.getParameters();
if (parameters != null && parameters.length > 0) {// 检查Parameter.
final ParameterInputPane pPane = new ParameterInputPane(
parameters);
pPane.showSmallWindow(designerFrame, new DialogActionAdapter() {
@Override
public void doOk() {
parameterMap.putAll(pPane.update());
}
}).setVisible(true);
}
// 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, tpl, parameterMap), designerFrame,
Inter.getLocText("Exporting"), "", 0, 100)).start();
}
}
private SwingWorker createExportWork(FILE file, final TemplateWorkBook tpl, final Map parameterMap) {
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, tpl, parameterMap);
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 TemplateWorkBook tpl, final Map parameterMap) throws Exception {
final Exporter exporter = AbstractExportAction.this.getExporter();
if (exporter instanceof AppExporter) {
AppExporter appExporter = (AppExporter) exporter;
if (exporter instanceof ExcelExporter || exporter instanceof CSVExporter
|| exporter instanceof PDFExporter || exporter instanceof WordExporter) {
ReportHelper.clearFormulaResult(tpl);// 清空rpt中的公式计算结果
appExporter.export(fileOutputStream, tpl.execute(parameterMap, ActorFactory.getActor(ActorConstants.TYPE_PAGE)
));
} else {
ReportHelper.clearFormulaResult(tpl);// 清空currentReport中的公式计算结果
PageSetProvider pageSet = tpl.execute(parameterMap, ActorFactory.getActor(ActorConstants.TYPE_PAGE)).generateReportPageSet(
ReportUtils.getPaperSettingListFromWorkBook(tpl)).traverse4Export();
appExporter.export(fileOutputStream, pageSet);
pageSet.release();
}
} else if (exporter instanceof EmbeddedTableDataExporter) {
((EmbeddedTableDataExporter) exporter).export(fileOutputStream, (WorkBook) tpl, parameterMap);
}
}
/*
* 这边判断是否有层式报表有层式需要使用大数据量导出
*/
protected boolean hasLayerReport(TemplateWorkBook tpl) {
if (tpl == null) {
return false;
}
for (int i = 0; i < tpl.getReportCount(); i++) {
Report r = tpl.getReport(i);
if (r instanceof WorkSheet) {
if (((WorkSheet) r).getLayerReportAttr() != null) {
return true;
}
}
}
return false;
}
protected abstract ChooseFileFilter getChooseFileFilter();
protected abstract String getDefaultExtension();
protected abstract Exporter getExporter();
}

55
designer/src/com/fr/design/actions/file/export/CSVExportAction.java

@ -0,0 +1,55 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.CSVExporter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.LargeDataPageCSVExporter;
import com.fr.main.TemplateWorkBook;
/**
* Export CSV.
*/
public class CSVExportAction extends AbstractExportAction {
/**
* Constructor
*/
public CSVExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.CSV_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/csv.png"));
}
@Override
protected Exporter getExporter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return new LargeDataPageCSVExporter();
} else {
return new CSVExporter();
}
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"csv"}, Inter.getLocText("Export-CSV"));
}
@Override
protected String getDefaultExtension() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return "zip";
} else {
return "csv";
}
}
}

42
designer/src/com/fr/design/actions/file/export/EmbeddedExportExportAction.java

@ -0,0 +1,42 @@
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.EmbeddedTableDataExporter;
import com.fr.io.exporter.Exporter;
/**
* Export Embedded.
*/
public class EmbeddedExportExportAction extends AbstractExportAction {
/**
* Constructor
*/
public EmbeddedExportExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.EMBEDDED_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/oem/logo.png"));
}
@Override
protected Exporter getExporter() {
return new EmbeddedTableDataExporter();
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"cpt"},
Inter.getLocText("Export-Template(embedded_data)"));
}
@Override
protected String getDefaultExtension() {
return "cpt";
}
}

33
designer/src/com/fr/design/actions/file/export/ExcelExportAction.java

@ -0,0 +1,33 @@
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.io.exporter.ExcelExporter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.LargeDataPageExcelExporter;
import com.fr.main.TemplateWorkBook;
import com.fr.report.core.ReportUtils;
public class ExcelExportAction extends AbstractExcelExportAction {
/**
* Constructor
*/
public ExcelExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.SIMPLE_EXCEL_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png"));
}
@Override
protected Exporter getExporter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return new LargeDataPageExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(tpl), false);
} else {
return new ExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(tpl));
}
}
}

44
designer/src/com/fr/design/actions/file/export/PDFExportAction.java

@ -0,0 +1,44 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.PDFExporter;
/**
* Export pdf
*/
public class PDFExportAction extends AbstractExportAction {
/**
* Constructor
*/
public PDFExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.PDF_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pdf.png"));
}
@Override
protected Exporter getExporter() {
return new PDFExporter();
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"pdf"}, Inter.getLocText("Export-PDF"));
}
@Override
protected String getDefaultExtension() {
return "pdf";
}
}

31
designer/src/com/fr/design/actions/file/export/PageExcelExportAction.java

@ -0,0 +1,31 @@
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.LargeDataPageExcelExporter;
import com.fr.io.exporter.PageExcelExporter;
import com.fr.main.TemplateWorkBook;
import com.fr.report.core.ReportUtils;
public class PageExcelExportAction extends AbstractExcelExportAction {
public PageExcelExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.PAGE_EXCEL_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png"));
}
@Override
protected Exporter getExporter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
if (hasLayerReport(tpl)) {
return new LargeDataPageExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(tpl), true);
} else {
return new PageExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(tpl));
}
}
}

39
designer/src/com/fr/design/actions/file/export/PageToSheetExcelExportAction.java

@ -0,0 +1,39 @@
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.PageToSheetExcelExporter;
import com.fr.main.TemplateWorkBook;
import com.fr.report.core.ReportUtils;
public class PageToSheetExcelExportAction extends AbstractExcelExportAction {
public PageToSheetExcelExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.PAGETOSHEET_EXCEL_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png"));
}
@Override
protected Exporter getExporter() {
TemplateWorkBook tpl = this.getTemplateWorkBook();
return new PageToSheetExcelExporter(ReportUtils.getPaperSettingListFromWorkBook(tpl));
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"xls"}, Inter.getLocText("Export-Excel"));
}
@Override
protected String getDefaultExtension() {
return "xls";
}
}

44
designer/src/com/fr/design/actions/file/export/SVGExportAction.java

@ -0,0 +1,44 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.SVGExporter;
/**
* Export SVG
*/
public class SVGExportAction extends AbstractExportAction {
/**
* Constructor
*/
public SVGExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.SVG_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+"...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/svg.png"));
}
@Override
protected Exporter getExporter() {
return new SVGExporter();
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"svg"}, Inter.getLocText("Export-SVG"));
}
@Override
protected String getDefaultExtension() {
return "svg";
}
}

43
designer/src/com/fr/design/actions/file/export/TextExportAction.java

@ -0,0 +1,43 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.TextExporter;
/**
* Export Text.
*/
public class TextExportAction extends AbstractExportAction {
/**
* Constructor
*/
public TextExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.TEXT_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/text.png"));
}
@Override
protected Exporter getExporter() {
return new TextExporter();
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"txt"}, Inter.getLocText("Export-Text"));
}
@Override
protected String getDefaultExtension() {
return "txt";
}
}

43
designer/src/com/fr/design/actions/file/export/WordExportAction.java

@ -0,0 +1,43 @@
/*
* * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.file.export;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.menu.KeySetUtils;
import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.Inter;
import com.fr.io.exporter.Exporter;
import com.fr.io.exporter.WordExporter;
/**
* Export excel.
*/
public class WordExportAction extends AbstractExportAction {
/**
* Constructor
*/
public WordExportAction(JWorkBook jwb) {
super(jwb);
this.setMenuKeySet(KeySetUtils.WORD_EXPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/word.png"));
}
@Override
protected Exporter getExporter() {
return new WordExporter();
}
@Override
protected ChooseFileFilter getChooseFileFilter() {
return new ChooseFileFilter(new String[]{"doc"}, Inter.getLocText("Export-Word"));
}
@Override
protected String getDefaultExtension() {
return "doc";
}
}

18
designer/src/com/fr/design/actions/file/newReport/NewOEMWorkBookAction.java

@ -0,0 +1,18 @@
package com.fr.design.actions.file.newReport;
import com.fr.base.BaseUtils;
import javax.swing.*;
/**
* @author richie
* @date 2015-06-16
* @since 8.0
*/
public class NewOEMWorkBookAction extends NewWorkBookAction {
@Override
protected Icon icon() {
return BaseUtils.readIcon("/com/fr/plugin/oem/images/newoemcpt.png");
}
}

34
designer/src/com/fr/design/actions/file/newReport/NewPolyReportAction.java

@ -0,0 +1,34 @@
package com.fr.design.actions.file.newReport;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JPolyWorkBook;
import com.fr.general.Inter;
public class NewPolyReportAction extends UpdateAction {
public NewPolyReportAction() {
this.setName(Inter.getLocText("M-New_Multi_Report"));
this.setMnemonic('F');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/formExport.png"));
this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK));
}
/**
* Action触发后
*
* @param e 触发的事件
*
* @date 2015-2-5-上午11:43:13
*
*/
public void actionPerformed(ActionEvent e) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JPolyWorkBook());
}
}

54
designer/src/com/fr/design/actions/file/newReport/NewWorkBookAction.java

@ -0,0 +1,54 @@
package com.fr.design.actions.file.newReport;
import com.fr.base.BaseUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JWorkBook;
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;
public class NewWorkBookAction extends UpdateAction {
public NewWorkBookAction() {
this.setMenuKeySet(NEW_WORK_BOOK);
this.setName(getMenuKeySet().getMenuKeySetName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(icon());
this.setAccelerator(getMenuKeySet().getKeyStroke());
}
protected Icon icon() {
return BaseUtils.readIcon("/com/fr/design/images/buttonicon/newcpts.png");
}
/**
* 动作
* @param e 事件
*/
public void actionPerformed(ActionEvent e) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JWorkBook());
}
public static final MenuKeySet NEW_WORK_BOOK = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'N';
}
@Override
public String getMenuName() {
return Inter.getLocText("M-New_WorkBook");
}
@Override
public KeyStroke getKeyStroke() {
return KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_MASK);
}
};
}

17
designer/src/com/fr/design/actions/form/AbastractFormECAction.java

@ -0,0 +1,17 @@
package com.fr.design.actions.form;
import com.fr.design.actions.TemplateComponentAction;
import com.fr.design.mainframe.form.FormElementCasePaneDelegate;
public class AbastractFormECAction <T extends FormElementCasePaneDelegate> extends TemplateComponentAction<T>{
protected AbastractFormECAction(T t) {
super(t);
}
@Override
public boolean executeActionReturnUndoRecordNeeded() {
return false;
}
}

47
designer/src/com/fr/design/actions/form/FormECBackgroundAction.java

@ -0,0 +1,47 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.form;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.form.FormElementCasePaneDelegate;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportBackgroundPane;
import com.fr.design.dialog.DialogActionAdapter;
/**
* Background action.
*/
public class FormECBackgroundAction extends AbastractFormECAction<FormElementCasePaneDelegate>{
public FormECBackgroundAction(FormElementCasePaneDelegate rc) {
super(rc);
this.setMenuKeySet(KeySetUtils.REPORT_BACKGROUND);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/background.png"));
}
/**
* 执行动作
* @return 是否执行成功
*/
public boolean executeActionReturnUndoRecordNeeded() {
final FormElementCasePaneDelegate elementCasePane = this.getEditingComponent();
if (elementCasePane == null) {
return false;
}
final ReportBackgroundPane bPane = new ReportBackgroundPane();
bPane.populate(elementCasePane.getReportSettings());
bPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
bPane.update(elementCasePane.getReportSettings());
elementCasePane.fireTargetModified();
}
}).setVisible(true);
return false;
}
}

52
designer/src/com/fr/design/actions/form/FormECColumnsAction.java

@ -0,0 +1,52 @@
package com.fr.design.actions.form;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.form.FormElementCasePaneDelegate;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.ReportColumnsPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.report.stable.WorkSheetAttr;
import com.fr.report.worksheet.FormElementCase;
public class FormECColumnsAction extends AbastractFormECAction<FormElementCasePaneDelegate>{
public FormECColumnsAction(FormElementCasePaneDelegate t) {
super(t);
this.setMenuKeySet(KeySetUtils.EC_COLUMNS);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/form/toolbar/ec_columns.png"));
}
/**
* 执行动作
*
* @return 是否执行成功
*/
public boolean executeActionReturnUndoRecordNeeded() {
final FormElementCasePaneDelegate jws = this.getEditingComponent();
if (jws == null) {
return false;
}
final FormElementCase elementCase = jws.getTarget();
final ReportColumnsPane cPane = new ReportColumnsPane();
WorkSheetAttr attr = elementCase.getWorkSheetAttr();
int rowCount = elementCase.getRowCount();
int colCount = elementCase.getColumnCount();
cPane.populate(attr, rowCount, colCount);
cPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
// bug:64173 重新生成一个workSheetAttr,否则会受到之前属性的干扰
WorkSheetAttr attr = new WorkSheetAttr();
elementCase.setWorkSheetAttr(attr);
cPane.update(attr);
jws.fireTargetModified();
}
}).setVisible(true);
return false;
}
}

55
designer/src/com/fr/design/actions/form/FormECFrozenAction.java

@ -0,0 +1,55 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.form;
import javax.swing.SwingUtilities;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.form.FormElementCasePaneDelegate;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.freeze.FormECRepeatAndFreezeSettingPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.report.worksheet.FormElementCase;
/**
* 表单报表块冻结
*/
public class FormECFrozenAction extends AbastractFormECAction<FormElementCasePaneDelegate>{
private boolean returnValue;
public FormECFrozenAction(FormElementCasePaneDelegate t) {
super(t);
this.setMenuKeySet(KeySetUtils.EC_FROZEN);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/form/toolbar/ec_frozen.png"));
}
/**
* 执行动作
*
* @return 是否执行成功
*/
public boolean executeActionReturnUndoRecordNeeded() {
FormElementCasePaneDelegate jws = getEditingComponent();
if (jws == null) {
return false;
}
final FormElementCase fc = jws.getTarget();
final FormECRepeatAndFreezeSettingPane attrPane = new FormECRepeatAndFreezeSettingPane();
attrPane.populate(fc.getReportPageAttr());
BasicDialog dlg = attrPane.showWindow(SwingUtilities.getWindowAncestor(jws));
dlg.addDialogActionListener(new DialogActionAdapter() {
@Override
public void doOk() {
fc.setReportPageAttr(attrPane.update());
returnValue = true;
}
});
dlg.setVisible(true);
return returnValue;
}
}

51
designer/src/com/fr/design/actions/insert/cell/AbstractCellAction.java

@ -0,0 +1,51 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import com.fr.design.actions.CellSelectionAction;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.report.core.SheetUtils;
import com.fr.report.elementcase.TemplateElementCase;
/**
* Cell.
*/
public abstract class AbstractCellAction extends CellSelectionAction {
protected AbstractCellAction(ElementCasePane t) {
super(t);
}
public abstract Class getCellValueClass();
/*
* TODO ALEX_SEP 这里的返回boolean量表示模板是否改变,导致很多很多的方法的boolean返回值都是这个意思
*
* 感觉有点浪费
*/
@Override
protected boolean executeActionReturnUndoRecordNeededWithCellSelection(
CellSelection cs) {
ElementCasePane ePane = this.getEditingComponent();
//got simple cell element from column and row.
TemplateElementCase report = ePane.getEditingElementCase();
//alex:如果是线性报表,这时还要计算一下默认父格是什么
if (report != null && this instanceof DSColumnCellAction) {
SheetUtils.calculateDefaultParent(report);
}
return ePane.getGrid().startCellEditingAt_DEC(
cs.getColumn(),
cs.getRow(),
this.getCellValueClass(), false
);
}
@Override
public void update() {
super.update();
ElementCasePane ePane = this.getEditingComponent();
this.setEnabled(ePane.isSelectedOneCell());
}
}

48
designer/src/com/fr/design/actions/insert/cell/BiasCellAction.java

@ -0,0 +1,48 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.report.cell.painter.BiasTextPainter;
/**
* Bias
*/
public class BiasCellAction extends AbstractCellAction {
public BiasCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_SLOPE_LINE);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/bias.png"));
}
public static final MenuKeySet INSERT_SLOPE_LINE = new MenuKeySet() {
@Override
public char getMnemonic() {
//之前是S, 跟子报表subreport重复了
return 'X';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Slope_Line");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
public Class getCellValueClass() {
return BiasTextPainter.class;
}
}

48
designer/src/com/fr/design/actions/insert/cell/ChartCellAction.java

@ -0,0 +1,48 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.design.actions.core.ActionUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import javax.swing.*;
/**
* .
*/
public class ChartCellAction extends AbstractCellAction {
public ChartCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_CHART);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/chart.png"));
}
public static final MenuKeySet INSERT_CHART = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'C';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Chart");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
public Class getCellValueClass() {
return ActionUtils.getChartCollectionClass();
}
}

21
designer/src/com/fr/design/actions/insert/cell/DSColumnCellAction.java

@ -0,0 +1,21 @@
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.report.cell.cellattr.core.group.DSColumn;
public class DSColumnCellAction extends AbstractCellAction {
public DSColumnCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(KeySetUtils.INSERT_DATA_COLUMN);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/bindColumn.png"));
}
@Override
public Class getCellValueClass() {
return DSColumn.class;
}
}

44
designer/src/com/fr/design/actions/insert/cell/FormulaCellAction.java

@ -0,0 +1,44 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.base.Formula;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import javax.swing.*;
public class FormulaCellAction extends AbstractCellAction {
public FormulaCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_FORMULA);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png"));
}
public static final MenuKeySet INSERT_FORMULA = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'F';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Formula");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
public Class getCellValueClass() {
return Formula.class;
}
}

46
designer/src/com/fr/design/actions/insert/cell/GeneralCellAction.java

@ -0,0 +1,46 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import javax.swing.*;
/**
*
*/
public class GeneralCellAction extends AbstractCellAction {
public GeneralCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_TEXT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/text.png"));
}
public static final MenuKeySet INSERT_TEXT = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'T';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Text");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
public Class getCellValueClass() {
return String.class;
}
}

47
designer/src/com/fr/design/actions/insert/cell/ImageCellAction.java

@ -0,0 +1,47 @@
/*
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/
package com.fr.design.actions.insert.cell;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Image
*/
public class ImageCellAction extends AbstractCellAction {
public ImageCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_IMAGE);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/image.png"));
}
public static final MenuKeySet INSERT_IMAGE = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'I';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Image");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
@Override
public Class getCellValueClass() {
return Image.class;
}
}

61
designer/src/com/fr/design/actions/insert/cell/RichTextCellAction.java

@ -0,0 +1,61 @@
package com.fr.design.actions.insert.cell;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.report.cell.cellattr.core.RichText;
public class RichTextCellAction extends AbstractCellAction {
public RichTextCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_RICHTEXT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon(
"/com/fr/design/images/m_insert/richtext.png"));
}
@Override
public Class getCellValueClass() {
return RichText.class;
}
/**
* equals 比较
* @param object
* @return true false
*/
@Override
public boolean equals(Object object) {
if (this == object){
return true;
}
if (!(object instanceof RichTextCellAction)){
return false;
}
return ComparatorUtils.equals(this.getEditingComponent(),((RichTextCellAction)object).getEditingComponent());
}
private static final MenuKeySet INSERT_RICHTEXT = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'R';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_RichText");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

62
designer/src/com/fr/design/actions/insert/cell/SubReportCellAction.java

@ -0,0 +1,62 @@
package com.fr.design.actions.insert.cell;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.report.cell.cellattr.core.SubReport;
public class SubReportCellAction extends AbstractCellAction {
public SubReportCellAction(ElementCasePane t) {
super(t);
this.setMenuKeySet(INSERT_SUB_REPORT);
this.setName(getMenuKeySet().getMenuKeySetName()+ "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon(
"/com/fr/design/images/m_insert/subReport.png"));
}
public static final MenuKeySet INSERT_SUB_REPORT = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'S';
}
@Override
public String getMenuName() {
return Inter.getLocText("M_Insert-Sub_Report");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
/**
* equals 比较
* @param object
* @return true false
*/
@Override
public boolean equals(Object object) {
if (this == object){
return true;
}
if (!(object instanceof SubReportCellAction)){
return false;
}
return ComparatorUtils.equals(this.getEditingComponent(),((SubReportCellAction)object).getEditingComponent());
}
@Override
public Class getCellValueClass() {
return SubReport.class;
}
}

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

Loading…
Cancel
Save