Browse Source

移动

master
svnadmin 9 years ago
parent
commit
057ae876b5
  1. 528
      .gitattributes
  2. 1
      .gitignore
  3. 20
      designer_chart/.classpath
  4. 1
      designer_chart/.project
  5. 25
      designer_chart/designer_chart.iml
  6. 188
      designer_chart/src/com/fr/design/ChartEnvManager.java
  7. 211
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  8. 55
      designer_chart/src/com/fr/design/chart/ChartAxisFactory.java
  9. 22
      designer_chart/src/com/fr/design/chart/ChartCommonWizardPane.java
  10. 170
      designer_chart/src/com/fr/design/chart/ChartComponentPane.java
  11. 128
      designer_chart/src/com/fr/design/chart/ChartControlPane.java
  12. 102
      designer_chart/src/com/fr/design/chart/ChartDialog.java
  13. 132
      designer_chart/src/com/fr/design/chart/ChartPlotFactory.java
  14. 76
      designer_chart/src/com/fr/design/chart/ChartSwingUtils.java
  15. 186
      designer_chart/src/com/fr/design/chart/ChartTypePane.java
  16. 20
      designer_chart/src/com/fr/design/chart/ChartWizardPane.java
  17. 40
      designer_chart/src/com/fr/design/chart/FactoryObject.java
  18. 29
      designer_chart/src/com/fr/design/chart/axis/AxisStyleObject.java
  19. 17
      designer_chart/src/com/fr/design/chart/axis/AxisStylePane.java
  20. 63
      designer_chart/src/com/fr/design/chart/axis/BinaryChartStyleAxisPane.java
  21. 63
      designer_chart/src/com/fr/design/chart/axis/ChartAlertLinePane.java
  22. 20
      designer_chart/src/com/fr/design/chart/axis/ChartAlertValueInTopBottomPane.java
  23. 229
      designer_chart/src/com/fr/design/chart/axis/ChartAlertValuePane.java
  24. 87
      designer_chart/src/com/fr/design/chart/axis/ChartStyleAxisPane.java
  25. 19
      designer_chart/src/com/fr/design/chart/axis/CustomChartStyleAxisPane.java
  26. 28
      designer_chart/src/com/fr/design/chart/axis/GanntChartStyleAxisPane.java
  27. 193
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  28. 26
      designer_chart/src/com/fr/design/chart/axis/RadarChartStyleAxisPane.java
  29. 42
      designer_chart/src/com/fr/design/chart/axis/TernaryChartStyleAxisPane.java
  30. 25
      designer_chart/src/com/fr/design/chart/axis/ValueChartStyleAxisPane.java
  31. 26
      designer_chart/src/com/fr/design/chart/axis/XYChartStyleAxisPane.java
  32. 59
      designer_chart/src/com/fr/design/chart/comp/BorderAttriPane.java
  33. 123
      designer_chart/src/com/fr/design/chart/demo/GlyphDemo.java
  34. 86
      designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java
  35. 52
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java
  36. 49
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  37. 97
      designer_chart/src/com/fr/design/chart/gui/ActiveGlyphFactory.java
  38. 322
      designer_chart/src/com/fr/design/chart/gui/ChartComponent.java
  39. 79
      designer_chart/src/com/fr/design/chart/gui/ChartWidgetOption.java
  40. 161
      designer_chart/src/com/fr/design/chart/gui/active/ActiveGlyph.java
  41. 38
      designer_chart/src/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java
  42. 43
      designer_chart/src/com/fr/design/chart/gui/active/AxisActiveGlyph.java
  43. 19
      designer_chart/src/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java
  44. 39
      designer_chart/src/com/fr/design/chart/gui/active/ChartActiveGlyph.java
  45. 44
      designer_chart/src/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java
  46. 53
      designer_chart/src/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java
  47. 30
      designer_chart/src/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java
  48. 18
      designer_chart/src/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java
  49. 30
      designer_chart/src/com/fr/design/chart/gui/active/LegendActiveGlyph.java
  50. 34
      designer_chart/src/com/fr/design/chart/gui/active/PlotActiveGlyph.java
  51. 18
      designer_chart/src/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java
  52. 18
      designer_chart/src/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java
  53. 35
      designer_chart/src/com/fr/design/chart/gui/active/TextActiveGlyph.java
  54. 43
      designer_chart/src/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java
  55. 19
      designer_chart/src/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java
  56. 47
      designer_chart/src/com/fr/design/chart/gui/active/action/ChartComponentAction.java
  57. 27
      designer_chart/src/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java
  58. 33
      designer_chart/src/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java
  59. 31
      designer_chart/src/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java
  60. 26
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java
  61. 26
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSeriesAttrAction.java
  62. 33
      designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSheetAction.java
  63. 32
      designer_chart/src/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java
  64. 32
      designer_chart/src/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java
  65. 32
      designer_chart/src/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java
  66. 81
      designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java
  67. 155
      designer_chart/src/com/fr/design/chart/report/GisMapDataPane.java
  68. 69
      designer_chart/src/com/fr/design/chart/report/GisMapDataPane4Chart.java
  69. 301
      designer_chart/src/com/fr/design/chart/report/GisMapReportDataContentPane.java
  70. 350
      designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane.java
  71. 341
      designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane4Chart.java
  72. 76
      designer_chart/src/com/fr/design/chart/report/MapCubeDataPane.java
  73. 68
      designer_chart/src/com/fr/design/chart/report/MapCubeDataPane4Chart.java
  74. 309
      designer_chart/src/com/fr/design/chart/report/MapCubeLayerPane.java
  75. 130
      designer_chart/src/com/fr/design/chart/report/MapCubeSetDataPane.java
  76. 139
      designer_chart/src/com/fr/design/chart/report/MapDataPane.java
  77. 133
      designer_chart/src/com/fr/design/chart/report/MapDataPane4Chart.java
  78. 106
      designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane.java
  79. 113
      designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane4Chart.java
  80. 202
      designer_chart/src/com/fr/design/chart/report/MapMoreReportIndexPane.java
  81. 209
      designer_chart/src/com/fr/design/chart/report/MapMoreTableIndexPane.java
  82. 74
      designer_chart/src/com/fr/design/chart/report/MapReportCubeDataPane.java
  83. 233
      designer_chart/src/com/fr/design/chart/report/MapReportDataSinglePane.java
  84. 62
      designer_chart/src/com/fr/design/chart/report/MapReportEditor.java
  85. 32
      designer_chart/src/com/fr/design/chart/report/MapReportRenderer.java
  86. 113
      designer_chart/src/com/fr/design/chart/report/MapSinglePane.java
  87. 79
      designer_chart/src/com/fr/design/chart/report/MapSinglePane4Chart.java
  88. 110
      designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane.java
  89. 93
      designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane4Chart.java
  90. 271
      designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane.java
  91. 268
      designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane4Chart.java
  92. 23
      designer_chart/src/com/fr/design/chart/series/PlotSeries/AbstrctMapAttrEditPane.java
  93. 217
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapCustomPane.java
  94. 250
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java
  95. 1
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java
  96. 763
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java
  97. 86
      designer_chart/src/com/fr/design/chart/series/PlotSeries/MapSelectShape.java
  98. 1
      designer_chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java
  99. 173
      designer_chart/src/com/fr/design/chart/series/PlotStyle/ChartSelectDemoPane.java
  100. 27
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java
  101. Some files were not shown because too many files have changed in this diff Show More

528
.gitattributes vendored

@ -1 +1,529 @@
* text=auto !eol
designer_chart/.classpath -text
designer_chart/.project -text
designer_chart/designer_chart.iml -text
designer_chart/src/com/fr/design/ChartEnvManager.java -text
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java -text
designer_chart/src/com/fr/design/chart/ChartAxisFactory.java -text
designer_chart/src/com/fr/design/chart/ChartCommonWizardPane.java -text
designer_chart/src/com/fr/design/chart/ChartComponentPane.java -text
designer_chart/src/com/fr/design/chart/ChartControlPane.java -text
designer_chart/src/com/fr/design/chart/ChartDialog.java -text
designer_chart/src/com/fr/design/chart/ChartPlotFactory.java -text
designer_chart/src/com/fr/design/chart/ChartSwingUtils.java -text
designer_chart/src/com/fr/design/chart/ChartTypePane.java -text
designer_chart/src/com/fr/design/chart/ChartWizardPane.java -text
designer_chart/src/com/fr/design/chart/FactoryObject.java -text
designer_chart/src/com/fr/design/chart/axis/AxisStyleObject.java -text
designer_chart/src/com/fr/design/chart/axis/AxisStylePane.java -text
designer_chart/src/com/fr/design/chart/axis/BinaryChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/ChartAlertLinePane.java -text
designer_chart/src/com/fr/design/chart/axis/ChartAlertValueInTopBottomPane.java -text
designer_chart/src/com/fr/design/chart/axis/ChartAlertValuePane.java -text
designer_chart/src/com/fr/design/chart/axis/ChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/CustomChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/GanntChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java -text
designer_chart/src/com/fr/design/chart/axis/RadarChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/TernaryChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/ValueChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/axis/XYChartStyleAxisPane.java -text
designer_chart/src/com/fr/design/chart/comp/BorderAttriPane.java -text
designer_chart/src/com/fr/design/chart/demo/GlyphDemo.java -text
designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java -text
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java -text
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java -text
designer_chart/src/com/fr/design/chart/gui/ActiveGlyphFactory.java -text
designer_chart/src/com/fr/design/chart/gui/ChartComponent.java -text
designer_chart/src/com/fr/design/chart/gui/ChartWidgetOption.java -text
designer_chart/src/com/fr/design/chart/gui/active/ActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/AxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/ChartActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/DataSeriesActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/LegendActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/PlotActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/TextActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/ChartComponentAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetAnalysisLineStyleAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetAxisStyleAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetChartStyleAciton.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataLabelStyleAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSeriesAttrAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetDataSheetAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetLegendStyleAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetPlotStyleAction.java -text
designer_chart/src/com/fr/design/chart/gui/active/action/SetTitleStyleAction.java -text
designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java -text
designer_chart/src/com/fr/design/chart/report/GisMapDataPane.java -text
designer_chart/src/com/fr/design/chart/report/GisMapDataPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/GisMapReportDataContentPane.java -text
designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane.java -text
designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapCubeDataPane.java -text
designer_chart/src/com/fr/design/chart/report/MapCubeDataPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapCubeLayerPane.java -text
designer_chart/src/com/fr/design/chart/report/MapCubeSetDataPane.java -text
designer_chart/src/com/fr/design/chart/report/MapDataPane.java -text
designer_chart/src/com/fr/design/chart/report/MapDataPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane.java -text
designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapMoreReportIndexPane.java -text
designer_chart/src/com/fr/design/chart/report/MapMoreTableIndexPane.java -text
designer_chart/src/com/fr/design/chart/report/MapReportCubeDataPane.java -text
designer_chart/src/com/fr/design/chart/report/MapReportDataSinglePane.java -text
designer_chart/src/com/fr/design/chart/report/MapReportEditor.java -text
designer_chart/src/com/fr/design/chart/report/MapReportRenderer.java -text
designer_chart/src/com/fr/design/chart/report/MapSinglePane.java -text
designer_chart/src/com/fr/design/chart/report/MapSinglePane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane.java -text
designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane4Chart.java -text
designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane.java -text
designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane4Chart.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/AbstrctMapAttrEditPane.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapCustomPane.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapImageEditPane.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapSelectShape.java -text
designer_chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java -text
designer_chart/src/com/fr/design/chart/series/PlotStyle/ChartSelectDemoPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/ChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/ChartConditionPaneFactory.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/ConditionTrendLinePane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataLabelContentsPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataLabelStylePane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesAttrCustomPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesAttrPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesCustomConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/GanttPlotChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAlphaPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelAxisPositionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelBackgroundPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelBorderAttrPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelBorderPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelColorPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelContentsPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LabelLineStylePane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/LineMarkerTypePane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/MapPlotChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/PiePlotChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/TooltipContentsPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/TrendLineControlPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/TrendLinePane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/XYPlotChartConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/AreaDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/Bar2DDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/Bar3DDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/BubbleDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/DataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/GanttDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/LineDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MapDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/MeterDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/PieDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/RadarDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/RangeDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/StockDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/dlp/XYDataLabelPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/Area3DPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/AreaPlotDataSeriesCondtionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/Bar2DTrendLineDSConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/Bar3DPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/BarPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/BubblePlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPopAttrPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperPoplinkPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/CustomPlot4AreaConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/CustomPlot4BarNoTrendLineConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/CustomPlot4BarTrendLineConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/CustomPlot4LineConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/CustomPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/DataSeriesConditionPaneFactory.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/Donut2DPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/GanttPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/LinePlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/MapPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/MeterPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/Pie3DPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/PiePlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/RadarPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/StockPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chart/series/SeriesCondition/impl/XYScatterPlotDataSeriesConditionPane.java -text
designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java -text
designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java -text
designer_chart/src/com/fr/design/gui/xcombox/ComboBoxUseEditor.java -text
designer_chart/src/com/fr/design/gui/xcombox/MarkerComboBox.java -text
designer_chart/src/com/fr/design/images/add.png -text
designer_chart/src/com/fr/design/images/chart.png -text
designer_chart/src/com/fr/design/images/copyjs.png -text
designer_chart/src/com/fr/design/images/del.png -text
designer_chart/src/com/fr/design/images/exportimg.png -text
designer_chart/src/com/fr/design/images/newchart_normal.png -text
designer_chart/src/com/fr/design/images/newchart_over.png -text
designer_chart/src/com/fr/design/images/newchart_press.png -text
designer_chart/src/com/fr/design/images/splash4Chart.png -text
designer_chart/src/com/fr/design/images/toolbar/area/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/area/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/area/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/area/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/area/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/area/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/area/2_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/area/2_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/area/2_over.png -text
designer_chart/src/com/fr/design/images/toolbar/area/3_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/area/3_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/area/3_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/2_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/2_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/2_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/3_gary.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/3_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/3_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/3_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/4_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/4_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/4_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/5_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/5_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/5_over.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/6_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/6_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bar/6_over.png -text
designer_chart/src/com/fr/design/images/toolbar/border.png -text
designer_chart/src/com/fr/design/images/toolbar/bubble/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/bubble/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/bubble/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/2_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/2_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/2_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/3_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/3_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/3_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/4_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/4_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/4_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/5_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/5_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/5_over.png -text
designer_chart/src/com/fr/design/images/toolbar/column/6_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/column/6_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/column/6_over.png -text
designer_chart/src/com/fr/design/images/toolbar/custom/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/custom/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/custom/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/donut/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/funnel/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/funnel/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/funnel/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/gantt/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/gantt/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/gantt/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/gis/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/line/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/line/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/line/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/map/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/map/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/map/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/2_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/2_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/meter/2_over.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/1_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/1_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/pie/1_over.png -text
designer_chart/src/com/fr/design/images/toolbar/radar/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/radar/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/radar/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/range/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/range/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/range/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/stock/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/stock/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/stock/0_over.png -text
designer_chart/src/com/fr/design/images/toolbar/xyscatter/0_gray.png -text
designer_chart/src/com/fr/design/images/toolbar/xyscatter/0_normal.png -text
designer_chart/src/com/fr/design/images/toolbar/xyscatter/0_over.png -text
designer_chart/src/com/fr/design/mainframe/AbstractChartDataPane4Chart.java -text
designer_chart/src/com/fr/design/mainframe/AbstractMapPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/ChartAndWidgetPropertyPane.java -text
designer_chart/src/com/fr/design/mainframe/ChartArea.java -text
designer_chart/src/com/fr/design/mainframe/ChartDesigner.java -text
designer_chart/src/com/fr/design/mainframe/ChartDesignerPropertyPane.java -text
designer_chart/src/com/fr/design/mainframe/ChartDesignerUI.java -text
designer_chart/src/com/fr/design/mainframe/ChartPropertyPane.java -text
designer_chart/src/com/fr/design/mainframe/ChartToolBarPane.java -text
designer_chart/src/com/fr/design/mainframe/ChartUndoState.java -text
designer_chart/src/com/fr/design/mainframe/DesignerFrame4Chart.java -text
designer_chart/src/com/fr/design/mainframe/GisMapPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/JChart.java -text
designer_chart/src/com/fr/design/mainframe/MapArrayPane.java -text
designer_chart/src/com/fr/design/mainframe/MapEditPane.java -text
designer_chart/src/com/fr/design/mainframe/MapPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/MiddleChartPropertyPane.java -text
designer_chart/src/com/fr/design/mainframe/PlotToolBarFactory.java -text
designer_chart/src/com/fr/design/mainframe/TargetComponentContainer.java -text
designer_chart/src/com/fr/design/mainframe/ToolTip4Chart.java -text
designer_chart/src/com/fr/design/mainframe/actions/AbstractExportAction4JChart.java -text
designer_chart/src/com/fr/design/mainframe/actions/ChartDownLoadWorker.java -text
designer_chart/src/com/fr/design/mainframe/actions/ChartFeedBackAciton.java -text
designer_chart/src/com/fr/design/mainframe/actions/ChartUpdateAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/ChartWebAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/ExcelExportAction4Chart.java -text
designer_chart/src/com/fr/design/mainframe/actions/JChartAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/NewChartAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/OpenChartAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/PDFExportAction4Chart.java -text
designer_chart/src/com/fr/design/mainframe/actions/PNGExportAction4Chart.java -text
designer_chart/src/com/fr/design/mainframe/actions/UpdateOnlineAction.java -text
designer_chart/src/com/fr/design/mainframe/actions/UpdateVersion.java -text
designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/AttributeChange.java -text
designer_chart/src/com/fr/design/mainframe/chart/ChartDesignEditPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/ChartHyperEditPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/PaneTitleConstants.java -text
designer_chart/src/com/fr/design/mainframe/chart/UpdateOnLinePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDesignerDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDesignerOtherPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartOtherPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartStylePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/StylePane4Chart.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/UIEditLabel.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/CalculateComboBox.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ChartDesignDataLoadPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/DataContentsPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/EmbbeddDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ExcelDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ImportSetChartDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/JSONDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/PresentComboBox.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/ReportDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/BubblePlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/GanttPlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/MeterPlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/PiePlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/StockPlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/report/XYScatterPlotReportDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/BubblePlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/Factory4TableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/GanttPlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/PiePlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/StockPlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/XYScatterPlotTableDataContentPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartConditionAttrPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerConditionAttrPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartDesignerInteractivePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartSwitchPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/other/TimeSwitchPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/AbstractChartTabPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAccColorPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAxisLabelPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAxisLineStylePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAxisTitleNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAxisTitlePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartAxisValueTypePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartBackgroundNoImagePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartBackgroundPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartBeautyPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartBorderPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4GisPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDataPointLabel4MapPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartPreFillStylePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoColorPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrNoFontSizePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/DateAxisValuePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/analysisline/ChartAnalysisLinePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAxisAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartPlotAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartWholeAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/DefaultAxisAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/Plot3DAxisAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/RadarAxisAreaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartAxisUsePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartPercentValueNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartPercentValuePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartRadarPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartSecondValueNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartSecondValuePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValueNoFormulaPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/datalabel/ChartDataLabelPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/datalabel/ChartLabelFontPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/datasheet/ChartDatasheetPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/legend/AutoSelectedPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/legend/ChartLegendPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Area3DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AreaSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Bar2DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Bar3DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/BubbleSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneNumFiled.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithFormula.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CombinedBar2DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CombinedBubbleSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CombinedPie2DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CustomDefaultSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CustomSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/CustomTypeConditionSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Donut2DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/FunnelSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/LineSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapColorPickerPaneWithFormula.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MapSeriesPane4ChartDesigner.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/MeterSeriesPane4ChartDesigner.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Pie2DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/Pie3DSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/RadarSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/RangeSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/SeriesPane4ChartDesigner.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/StockSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane4Map.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/XYScatterSeriesPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/title/ChartTitlePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/style/title/ChartTitlePaneNoFormula.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractBarPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AreaPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/AreaPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/BarPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/BubblePlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/BubblePlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartDesignerImagePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ColumnPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/CustomPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/CustomPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/DonutPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/DonutPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/FunnelPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/GanttPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/GanttPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/LinePlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/MapPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/MeterPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/PiePlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/PiePlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/PlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/RadarPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/RadarPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/RangePlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/RangePlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/StockPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/StockPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/UserDefinedChartTypePane.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/XYSCatterPlotPane4ToolBar.java -text
designer_chart/src/com/fr/design/mainframe/chart/gui/type/XYScatterPlotPane.java -text
designer_chart/src/com/fr/design/mainframe/exporter/ExcelExporter4Chart.java -text
designer_chart/src/com/fr/design/mainframe/exporter/Exporter4Chart.java -text
designer_chart/src/com/fr/design/mainframe/exporter/ImageExporter4Chart.java -text
designer_chart/src/com/fr/design/mainframe/exporter/PdfExporter4Chart.java -text
designer_chart/src/com/fr/design/module/ChartDesignerModule.java -text
designer_chart/src/com/fr/design/module/ChartHyperlinkGroup.java -text
designer_chart/src/com/fr/design/module/ChartPreStyleAction.java -text
designer_chart/src/com/fr/design/module/ChartPreStyleManagerPane.java -text
designer_chart/src/com/fr/design/module/ChartPreStylePane.java -text
designer_chart/src/com/fr/design/module/ChartStartModule.java -text
designer_chart/src/com/fr/design/module/FormHyperlinkGroup.java -text
designer_chart/src/com/fr/file/FILEChooserPane4Chart.java -text
designer_chart/src/com/fr/start/ChartSplashPane.java -text
designer_chart/src/com/fr/start/Designer4Chart.java -text

1
.gitignore vendored

@ -0,0 +1 @@
designer_chart/bin

20
designer_chart/.classpath

@ -0,0 +1,20 @@
<?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 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" kind="src" path="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<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-chartglyph"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-web"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartdata"/>
<classpathentry kind="lib" path="/lib/3rd.jar" sourcepath="/lookandfeel"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<classpathentry kind="lib" path="/lib/poi2007_fat.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

1
designer_chart/.project

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>designer_chart</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>

25
designer_chart/designer_chart.iml

@ -0,0 +1,25 @@
<?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="chart-base" />
<orderEntry type="module" module-name="chart-chartattr" />
<orderEntry type="module" module-name="chart-chartdata" />
<orderEntry type="module" module-name="chart-chartglyph" />
<orderEntry type="module" module-name="chart-web" />
<orderEntry type="module" module-name="designer_base" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

188
designer_chart/src/com/fr/design/ChartEnvManager.java

@ -0,0 +1,188 @@
package com.fr.design;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils;
import com.fr.general.IOUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.*;
import java.io.*;
import java.util.Date;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class ChartEnvManager implements XMLReadable, XMLWriter {
public static final String ACTIVE_KEY = "RXWY-A25421-K58F47757-7373";
private static final int ONE_MONTH_SECOND = 30*24*60*60;//30天,以秒为单位
private static final int MS =1000;
boolean isPushUpdateAuto = true; //是否自动推送更新
private String activationKey = null;
private static ChartEnvManager chartEnvManager;
private Date lastCheckDate;
private long checkTimeSpan =ONE_MONTH_SECOND;
/**
* DesignerEnvManager.
*/
public static ChartEnvManager getEnvManager() {
if(chartEnvManager == null){
chartEnvManager = new ChartEnvManager();
try {
XMLTools.readFileXML(chartEnvManager, chartEnvManager.getDesignerEnvFile());
}catch (Exception exp){
FRContext.getLogger().error(exp.getMessage(), exp);
}
}
return chartEnvManager;
}
private static File envFile = new File(ProductConstants.getEnvHome() + File.separator + ProductConstants.APP_NAME + "ChartEnv.xml");
private File getEnvFile() {
return envFile;
}
private File getDesignerEnvFile() {
File envFile = getEnvFile();
if (!envFile.exists()) {
createEnvFile(envFile);
}
return envFile;
}
private void createEnvFile(File envFile) {
try {
FileWriter fileWriter = new FileWriter(envFile);
StringReader stringReader = new StringReader("<?xml version=\"1.0\" encoding=\"UTF-8\" ?><Env></Env>");
Utils.copyCharTo(stringReader, fileWriter);
stringReader.close();
fileWriter.close();
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
/**
* 返回激活码
*/
public String getActivationKey() {
return activationKey;
}
/**
* 设置激活码
*/
public void setActivationKey(String activationKey) {
this.activationKey = activationKey;
}
public void setPushUpdateAuto(boolean isPushUpdateAuto){
this.isPushUpdateAuto = isPushUpdateAuto;
if(!this.isPushUpdateAuto){
lastCheckDate = new Date();
}
}
/**
* 是否设置了自动推送图表设计器在线更行
* @return 是则返回true
*/
public boolean isPushUpdateAuto(){
return isPushUpdateAuto;
}
/**
*在设置不自动推送在线更新的情况下每30天自动检测一次
* @return 是否需要检测
*/
public boolean isOverOneMonth(){
return !isPushUpdateAuto && ((new Date().getTime()-lastCheckDate.getTime())/MS>=checkTimeSpan);
}
/***
* 重新设置最新检查的日期
*/
public void resetCheckDate(){
this.lastCheckDate = new Date();
}
@Override
public void readXML(XMLableReader reader) {
if (reader.isChildNode()) {
String name = reader.getTagName();
if(ComparatorUtils.equals(name,"ChartAttributes")){
activationKey = reader.getAttrAsString("activationKey",null);
isPushUpdateAuto = reader.getAttrAsBoolean("isPushUpdateAuto",true);
checkTimeSpan = reader.getAttrAsLong("checkTimeSpan",ONE_MONTH_SECOND);
String date = reader.getAttrAsString("lastCheckDate", null);
if(!StringUtils.isEmpty(date)){
lastCheckDate = DateUtils.string2Date(date,true);
} else {
lastCheckDate = new Date();
}
}
}
}
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG("ChartDesigner");
writer.startTAG("ChartAttributes").attr("activationKey",activationKey)
.attr("isPushUpdateAuto",isPushUpdateAuto)
.attr("checkTimeSpan",checkTimeSpan)
.attr("lastCheckDate", DateUtils.getDate2LStr(lastCheckDate))
.end();
writer.end();
}
/**
* 保存设计器的配置文件, 该文件不在env的resource目录下
* 而是在Consts.getEnvHome() + File.separator + Consts.APP_NAME
*
*
* @date 2014-9-29-上午11:04:23
*/
public void saveXMLFile() {
File xmlFile = this.getDesignerEnvFile();
if (xmlFile == null) {
return;
}
if (!xmlFile.getParentFile().exists()) {//建立目录.
StableUtils.mkdirs(xmlFile.getParentFile());
}
String tempName = xmlFile.getName() + ProjectConstants.TEMP_SUFFIX;
File tempFile = new File(xmlFile.getParentFile(), tempName);
writeTempFile(tempFile);
IOUtils.renameTo(tempFile, xmlFile);
}
private void writeTempFile(File tempFile){
try{
OutputStream fout = new FileOutputStream(tempFile);
XMLTools.writeOutputStreamXML(this, fout);
fout.flush();
fout.close();
}catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
}
}
}

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

@ -0,0 +1,211 @@
package com.fr.design;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chartinterface.*;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.file.XMLFileManager;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext;
import com.fr.plugin.PluginCollector;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginMessage;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils;
import com.fr.stable.fun.Authorize;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import com.fr.stable.plugin.PluginSimplify;
import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Created by eason on 14/12/29.
*/
public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider {
private static ClassLoader loader = Thread.currentThread().getContextClassLoader();
private static ChartTypeInterfaceManager classManager = null;
private static LinkedHashMap<String, IndependentChartUIProvider> chartTypeInterfaces = new LinkedHashMap<String, IndependentChartUIProvider>();
public synchronized static ChartTypeInterfaceManager getInstance() {
if (classManager == null) {
classManager = new ChartTypeInterfaceManager();
chartTypeInterfaces.clear();
classManager.readDefault();
classManager.readXMLFile();
}
return classManager;
}
static {
GeneralContext.addEnvChangedListener(new EnvChangedListener() {
public void envChanged() {
ChartTypeInterfaceManager.envChanged();
}
});
}
private synchronized static void envChanged() {
classManager = null;
}
private static void readDefault() {
chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
}
public String getIconPath(String plotID) {
return chartTypeInterfaces.get(plotID).getIconPath();
}
/**
* 增加界面接口定义
*
* @param className 类名
* @param plotID 标志ID
*/
public void addChartInterface(String className, String plotID, PluginSimplify simplify) {
if (StringUtils.isNotBlank(className)) {
try {
Class<?> clazz = loader.loadClass(className);
Authorize authorize = clazz.getAnnotation(Authorize.class);
if (authorize != null) {
PluginLicenseManager.getInstance().registerPaid(authorize, simplify);
}
IndependentChartUIProvider provider = (IndependentChartUIProvider) clazz.newInstance();
if (PluginCollector.getCollector().isError(provider, IndependentChartUIProvider.CURRENT_API_LEVEL, simplify.getPluginName()) || !containsChart(plotID)) {
PluginMessage.remindUpdate(className);
} else if (!chartTypeInterfaces.containsKey(plotID)) {
chartTypeInterfaces.put(plotID, provider);
}
} catch (ClassNotFoundException e) {
FRLogger.getLogger().error("class not found:" + e.getMessage());
} catch (IllegalAccessException | InstantiationException e) {
FRLogger.getLogger().error("object create error:" + e.getMessage());
}
}
}
//UI对应的chart如果没有加载,UI也不必加进去了
private boolean containsChart(String plotID) {
return ChartTypeManager.getInstance().containsPlot(plotID);
}
/**
* 把所有的pane加到list里
*
* @param paneList pane容器
*/
public void addPlotTypePaneList(List<FurtherBasicBeanPane<? extends Chart>> paneList) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
IndependentChartUIProvider creator = (IndependentChartUIProvider) entry.getValue();
paneList.add(creator.getPlotTypePane());
}
}
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) {
return chartTypeInterfaces.get(plotID).getAttrPaneArray(listener);
}
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(plot.getPlotID()).getTableDataSourcePane(plot, parent);
}
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {
return chartTypeInterfaces.get(plot.getPlotID()).getReportDataSourcePane(plot, parent);
}
public ConditionAttributesPane getPlotConditionPane(Plot plot) {
return chartTypeInterfaces.get(plot.getPlotID()).getPlotConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {
return chartTypeInterfaces.get(plot.getPlotID()).getPlotSeriesPane(parent, plot);
}
/**
* 是否使用默认的界面为了避免界面来回切换
*
* @param plotID 序号
* @return 是否使用默认的界面
*/
public boolean isUseDefaultPane(String plotID) {
if (chartTypeInterfaces.containsKey(plotID)) {
return chartTypeInterfaces.get(plotID).isUseDefaultPane();
}
return true;
}
public void readXML(XMLableReader reader) {
readXML(reader, null, PluginSimplify.NULL);
}
@Override
public void readXML(XMLableReader reader, List<String> extraChartDesignInterfaceList, PluginSimplify simplify) {
if (reader.isChildNode()) {
String tagName = reader.getTagName();
if (extraChartDesignInterfaceList != null) {
extraChartDesignInterfaceList.add(tagName);
}
if (IndependentChartUIProvider.XML_TAG.equals(tagName)) {
addChartInterface(reader.getAttrAsString("class", ""), reader.getAttrAsString("plotID", ""), simplify);
}
}
}
/**
* 文件名
*
* @return 文件名
*/
public String fileName() {
return "chart.xml";
}
@Override
public void writeXML(XMLPrintWriter writer) {
}
}

55
designer_chart/src/com/fr/design/chart/ChartAxisFactory.java

@ -0,0 +1,55 @@
package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.CategoryAxis;
import com.fr.chart.chartattr.RadarAxis;
import com.fr.chart.chartattr.ValueAxis;
import com.fr.design.mainframe.chart.gui.style.axis.*;
import com.fr.general.ComparatorUtils;
import java.util.HashMap;
import java.util.Map;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午11:19
*/
public class ChartAxisFactory {
private static final String PERCENT = "Percent";
private static final String SECOND = "Second";
private static Map<String, Class<? extends ChartAxisUsePane>> map = new HashMap<String, Class<? extends ChartAxisUsePane>>();
static {
map.put(ValueAxis.class.getName(), ChartValuePane.class);
map.put(RadarAxis.class.getName(), ChartRadarPane.class);
map.put(CategoryAxis.class.getName(), ChartCategoryPane.class);
map.put(ValueAxis.class.getName() + PERCENT, ChartPercentValuePane.class);
map.put(ValueAxis.class.getName() + SECOND, ChartSecondValuePane.class);
}
private ChartAxisFactory() {
}
public static ChartAxisUsePane createAxisStylePane(Axis axis, String axisType) {
String clsName = axis.getClass().getName();
if (axis.isPercentage()) {
clsName += PERCENT;
} else if(ComparatorUtils.equals(axisType, "secondAxis")) {
clsName += SECOND;
}
Class<? extends ChartAxisUsePane> cls = map.get(clsName);
try {
return cls.newInstance();
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
return new ChartCategoryPane();
}
}

22
designer_chart/src/com/fr/design/chart/ChartCommonWizardPane.java

@ -0,0 +1,22 @@
package com.fr.design.chart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
public abstract class ChartCommonWizardPane extends ChartWizardPane {
private static final long serialVersionUID = 2467967841657570498L;
@Override
public void populate(ChartCollection cc) {
if (cc == null) {
return;
}
populate(cc.getSelectedChart());
}
public abstract void populate(Chart chart);
public abstract void update(Chart oldChart);
}

170
designer_chart/src/com/fr/design/chart/ChartComponentPane.java

@ -0,0 +1,170 @@
package com.fr.design.chart;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.border.AbstractBorder;
import javax.swing.border.Border;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.layout.FRGUIPaneFactory;
/**
* 存放ChartComponent, 可调整大小的Pane.
*/
public class ChartComponentPane extends JPanel implements MouseMotionListener, MouseListener {
private static final long serialVersionUID = -77093070905580457L;
// 给设计界面加一个边框,方便拖拽
private static final int BORDER_STYLE = 10;
private List<PropertyChangeAdapter> listeners = new ArrayList<PropertyChangeAdapter>();
private List<PropertyChangeAdapter> slisteners = new ArrayList<PropertyChangeAdapter>();
private ChartComponent chartComponent;
private boolean select = false;
public ChartComponentPane(ChartComponent chartComponent) {
initComponents(chartComponent);
}
private void initComponents(ChartComponent chartComponent) {
this.chartComponent = chartComponent;
this.chartComponent.setLocation(this.getLocation());
this.setBorder(designBorder);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.chartComponent.addStopEditingListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() {
stopEditing();
}
});
this.add(chartComponent);
this.addMouseListener(this);
this.addMouseMotionListener(this);
}
public void addSizeChangedListener(PropertyChangeAdapter l) {
slisteners.add(l);
}
public void addStopListener(PropertyChangeAdapter l) {
listeners.add(l);
}
private void stopEditing() {
fireChanged(listeners);
}
private Border designBorder = new AbstractBorder() {
private static final long serialVersionUID = 1802897702350872754L;
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Color oldColor = g.getColor();
g.setColor(new Color(157, 228, 245));
for (int i = 0; i < BORDER_STYLE; i++) {
g.drawRect(x + i, y + i, width - i - i - 1, height - i - i - 1);
}
g.setColor(oldColor);
}
@Override
public Insets getBorderInsets(Component c) {
return new Insets(0, 0, BORDER_STYLE, BORDER_STYLE);
}
};
@Override
public void mouseDragged(MouseEvent e) {
if (select) {
if (this.getCursor() == Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)) {
this.setSize(e.getX(), getSize().height);
this.setPreferredSize(new Dimension(e.getX(), getSize().height));
} else if (this.getCursor() == Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)) {
this.setSize(getSize().width, e.getY());
this.setPreferredSize(new Dimension(getSize().width, e.getY()));
} else if (this.getCursor() == Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR)) {
this.setSize(e.getX(), e.getY());
this.setPreferredSize(new Dimension(e.getX(), e.getY()));
}
}
fireSizeChanged();
super.repaint();
}
public void mouseMoved(MouseEvent e) {
Rectangle rect = this.getBounds();
if (atCorner(e, rect)) {
setCursor(Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR));
} else if (atBottomLine(e, rect)) {
setCursor(Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR));
} else if (atRightLine(e, rect)) {
setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
} else {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
private boolean atBottomLine(MouseEvent e, Rectangle rect) {
return e.getY() < rect.height && e.getY() > rect.height - BORDER_STYLE;
}
private boolean atRightLine(MouseEvent e, Rectangle rect) {
return e.getX() < rect.width && e.getX() > rect.width - BORDER_STYLE;
}
private boolean atCorner(MouseEvent e, Rectangle rect) {
return atBottomLine(e, rect) && atRightLine(e, rect);
}
public void mouseClicked(MouseEvent e) {
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
}
public void mousePressed(MouseEvent e) {
if (this.getCursor() == Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR)
|| this.getCursor() == Cursor.getPredefinedCursor(Cursor.S_RESIZE_CURSOR)
|| this.getCursor() == Cursor.getPredefinedCursor(Cursor.SE_RESIZE_CURSOR)) {
this.select = true;
}
}
public void mouseReleased(MouseEvent e) {
this.select = false;
this.repaint();
}
private void fireSizeChanged() {
fireChanged(slisteners);
}
private void fireChanged(List<PropertyChangeAdapter> ls) {
for (int len = ls.size(), i = len; i > 0; i--) {
ls.get(i - 1).propertyChange();
}
}
}

128
designer_chart/src/com/fr/design/chart/ChartControlPane.java

@ -0,0 +1,128 @@
package com.fr.design.chart;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.controlpane.JControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import java.awt.*;
import java.util.HashMap;
/**
* 管理图表类型Pane
* @author kunsnat: ChartComponent移出.
*/
public class ChartControlPane extends JControlPane {
private static final long serialVersionUID = 7336270815128413184L;
public ChartControlPane() {
super();
// 重新设定大小. 因为JControlPane默认的(450,450) 不适合图表这边 @ChartSize
// this.setPreferredSize(new Dimension(770, 520));
}
@Override
public NameableCreator[] createNameableCreators() {
return new NameableCreator[] {
new NameObjectCreator(Inter.getLocText("Chart"), Chart.class, ChartTypeUpdatePane.class)
};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Chart-Manage_Chart_Type");
}
public void populate(ChartCollection cc) {
if(cc == null)return;
NameObject[] nameObjects = new NameObject[cc.getChartCount()];
for (int i = 0; i < nameObjects.length; i++) {
nameObjects[i] = new NameObject(cc.getChartName(i), cc.getChart(i));
}
populate(nameObjects);
// kunsnat: 选中当前图表选中的name
String chartSelectedName = cc.getChartName(cc.getSelectedIndex() < cc.getChartCount() ? cc.getSelectedIndex() : 0);
setSelectedName(chartSelectedName);
}
public void update(ChartCollection cc) {
HashMap namesChart = new HashMap();// 暂存判断是否有必要更新
for(int i = 0; i < cc.getChartCount(); i++) {
try {
namesChart.put(cc.getChartName(i), cc.getChart(i).clone());
} catch (CloneNotSupportedException e) {
}
}
Nameable[] nameables = update();
if (nameables.length == 0 || cc == null) {
return;
}
cc.removeAllNameObject();
String select = getSelectedName();
for (int i = 0; i < nameables.length; i++) {
if (nameables[i] instanceof NameObject && ((NameObject)nameables[i]).getObject() instanceof Chart) {
NameObject no = (NameObject)nameables[i];
String name = no.getName();
Chart chart = (Chart)no.getObject();
if(namesChart.containsKey(name)) {
Chart tmpChart = (Chart)namesChart.get(name);
if(chart.getPlot() != null && tmpChart.getPlot() != null
&& chart.getPlot().match4GUI(tmpChart.getPlot())) {
chart = tmpChart;// 代替之前做过编辑的Chart
}
}
cc.addNamedChart(name, chart);
if(no.getName().equals(select)) {
cc.setSelectedIndex(i);
}
}
}
}
/*
* alex:继承UpdatePane的ChartTypePane
*/
public static class ChartTypeUpdatePane extends BasicBeanPane<Chart> {
private static final long serialVersionUID = -7058348930816218415L;
private Chart editing;
private ChartTypePane typePane;
public ChartTypeUpdatePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
typePane = new ChartTypePane();
this.add(typePane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return "Chart Type";
}
@Override
public void populateBean(Chart ob) {
editing = ob;
typePane.populate(ob);
}
@Override
public Chart updateBean() {
typePane.update(editing);
return editing;
}
}
}

102
designer_chart/src/com/fr/design/chart/ChartDialog.java

@ -0,0 +1,102 @@
package com.fr.design.chart;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.chart.MiddleChartDialog;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.dialog.BasicDialog;
import com.fr.general.Inter;
import com.fr.design.utils.gui.GUICoreUtils;
/**
* 封装一层 图表新建的对话框, 配合属性表确定: 先单独只要一种图表类型的对话框.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-1-7 下午07:29:15
*/
public class ChartDialog extends MiddleChartDialog {
private BaseChartCollection cc;
private UIButton ok;
private UIButton cancel;
public ChartDialog(Frame owner) {
super(owner);
initComponent();
}
public ChartDialog(Dialog owner) {
super(owner);
initComponent();
}
private void initComponent() {
this.setLayout(new BorderLayout());
final ChartTypePane chartTypePane = new ChartTypePane();
setTitle(Inter.getLocText("M-Popup_ChartType"));
this.applyClosingAction();
this.applyEscapeAction();
this.setBasicDialogSize(BasicDialog.DEFAULT);
this.add(chartTypePane, BorderLayout.CENTER);
JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
this.add(buttonPane, BorderLayout.SOUTH);
ok = new UIButton(Inter.getLocText("OK"));
cancel = new UIButton(Inter.getLocText("Cancel"));
buttonPane.add(ok);
buttonPane.add(cancel);
ok.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
chartTypePane.update((ChartCollection)cc);
doOK();
}
});
cancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doCancel();
}
});
GUICoreUtils.setWindowCenter(getOwner(), this);
}
/**
* 不处理
*/
public void checkValid() throws Exception {
}
/**
* 更新新建的图表 ChartCollection
*/
public void populate(BaseChartCollection cc) {
if (cc == null) {
return;
}
this.cc = cc;
}
/**
* 返回当前正在编辑的图表ChartCollection
*/
public BaseChartCollection getChartCollection() {
return this.cc;
}
}

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

@ -0,0 +1,132 @@
package com.fr.design.chart;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.*;
import com.fr.design.chart.axis.*;
import com.fr.design.chart.series.SeriesCondition.dlp.*;
import com.fr.design.mainframe.chart.gui.style.axis.*;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-2
* Time : 上午11:27
*/
public class ChartPlotFactory {
private static Map<String, FactoryObject> map = new HashMap<String, FactoryObject>();
private static Map<String, Class> axisPane = new HashMap<String, Class>(){
{
put(ChartValuePane.class.getName(), ChartValueNoFormulaPane.class);
put(ChartSecondValuePane.class.getName(), ChartSecondValueNoFormulaPane.class);
put(ChartPercentValuePane.class.getName(), ChartPercentValueNoFormulaPane.class);
put(ChartCategoryPane.class.getName(), ChartCategoryNoFormulaPane.class);
}
};
static {
map.put(AreaPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(AreaDataLabelPane.class));
map.put(Area3DPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(AreaDataLabelPane.class));
map.put(Bar2DPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(Bar2DDataLabelPane.class));
map.put(Bar3DPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(Bar2DDataLabelPane.class));
map.put(BubblePlot.class.getName(), new FactoryObject()
.setAxisPaneCls(XYChartStyleAxisPane.class)
.setDataLabelPaneClass(BubbleDataLabelPane.class));
map.put(CustomPlot.class.getName(), new FactoryObject()
.setAxisPaneCls(CustomChartStyleAxisPane.class)
.setDataLabelPaneClass(Bar2DDataLabelPane.class));
map.put(GanttPlot.class.getName(), new FactoryObject()
.setAxisPaneCls(GanntChartStyleAxisPane.class));
map.put(LinePlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(LineDataLabelPane.class));
map.put(MapPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(MapDataLabelPane.class));
map.put(MeterBluePlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(MeterDataLabelPane.class));
map.put(MeterPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(MeterDataLabelPane.class));
map.put(PiePlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(PieDataLabelPane.class));
map.put(Pie3DPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(PieDataLabelPane.class));
map.put(RadarPlot.class.getName(), new FactoryObject()
.setAxisPaneCls(RadarChartStyleAxisPane.class)
.setDataLabelPaneClass(RadarDataLabelPane.class));
map.put(StockPlot.class.getName(), new FactoryObject()
.setAxisPaneCls(TernaryChartStyleAxisPane.class)
.setDataLabelPaneClass(StockDataLabelPane.class));
map.put(RangePlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(RangeDataLabelPane.class)
.setAxisPaneCls(ValueChartStyleAxisPane.class));
map.put(XYScatterPlot.class.getName(), new FactoryObject()
.setAxisPaneCls(XYChartStyleAxisPane.class)
.setDataLabelPaneClass(XYDataLabelPane.class));
map.put(FunnelPlot.class.getName(), new FactoryObject()
.setDataLabelPaneClass(PieDataLabelPane.class));
}
private ChartPlotFactory() {
}
/**
* 创建对应的坐标轴界面
* @param plot plot类型
* @return 返回坐标轴界面
*/
public static ChartStyleAxisPane createChartStyleAxisPaneByPlot(Plot plot) {
FactoryObject factoryObject = map.get(plot.getClass().getName());
if (factoryObject != null && factoryObject.getAxisPaneClass() != null) {
try {
Constructor<? extends ChartStyleAxisPane> c = factoryObject.getAxisPaneClass().getConstructor(Plot.class);
return c.newInstance(plot);
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
return new BinaryChartStyleAxisPane(plot);
}
/**
* 创建对应的标签Plot
* @param plotClass plot的类
* @return 对应的标签界面
*/
public static DataLabelPane createDataLabelPane4Plot(Class plotClass) {
FactoryObject factoryObject = map.get(plotClass.getName());
if (factoryObject != null && factoryObject.getDataLabelPaneClass() != null) {
try {
Constructor c = factoryObject.getDataLabelPaneClass().getConstructor();
return (DataLabelPane) c.newInstance();
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
return new DataLabelPane();
}
public static ChartAxisUsePane getNoFormulaPane(ChartAxisUsePane pane){
Class aClass = axisPane.get(pane.getClass().getName());
if(aClass != null){
try {
Constructor c = aClass.getConstructor();
return (ChartAxisUsePane) c.newInstance();
}catch (Exception e){
FRContext.getLogger().error(e.getMessage(), e);
}
}
return pane;
}
}

76
designer_chart/src/com/fr/design/chart/ChartSwingUtils.java

@ -0,0 +1,76 @@
package com.fr.design.chart;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* 这里打算是放一些图表用的界面控件的.
*/
public class ChartSwingUtils {
public static void addListener(final UICheckBox box, final UITextField textField) {
textField.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (box.isSelected()) {
showFormulaPane(textField, null);
}
}
});
textField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
if(box.isSelected()) {
e.consume();
showFormulaPane(textField, null);
}
}
});
}
public static UITextField createFormulaUITextField(final OKListener l) {
final UITextField textField = new UITextField();
textField.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
showFormulaPane(textField, l);
}
});
textField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
e.consume();
showFormulaPane(textField, l);
}
});
return textField;
}
private static void showFormulaPane(final UITextField jTextField, final OKListener l) {
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(new Formula(jTextField.getText()));
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane()), new DialogActionAdapter(){
public void doOk() {
Formula formula = formulaPane.update();
jTextField.setText(Utils.objectToString(formula));
if (l != null) {
l.action();
}
}
}).setVisible(true);
}
public interface OKListener {
public void action();
}
}

186
designer_chart/src/com/fr/design/chart/ChartTypePane.java

@ -0,0 +1,186 @@
package com.fr.design.chart;
/**
* the Pane of the Chart
*
*/
import com.fr.base.FRContext;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.*;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.general.RegistEditionException;
import com.fr.general.VT4FR;
import com.fr.stable.StableUtils;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
public class ChartTypePane extends ChartCommonWizardPane {
private static final long serialVersionUID = -1175602484968520546L;
private ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
private Chart[][] charts4Icon = null;
{
charts4Icon = new Chart[this.typeName.length][];
for (int i = 0; i < this.typeName.length; i++) {
Chart[] rowCharts = ChartTypeManager.getInstance().getChartTypes(this.typeName[i].getPlotID());
charts4Icon[i] = new Chart[1];
for (int j = 0; j < 1; j++) {
try {
charts4Icon[i][j] = (Chart) rowCharts[j].clone();
charts4Icon[i][j].setTitle(null);
if(charts4Icon[i][j].getPlot() != null){
charts4Icon[i][j].getPlot().setLegend(null);
}
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
}
}
private JList mainTypeList = null;
private JList iconViewList = null;
private DefaultListModel iconListModel = null;
public ChartTypePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
DefaultListModel defaultListModel = new DefaultListModel();
mainTypeList = new JList(defaultListModel);
for (int i = 0; i < typeName.length; i++) {
defaultListModel.insertElementAt(Inter.getLocText(typeName[i].getName()), i);
}
mainTypeList.addListSelectionListener(listSelectionListener);
JScrollPane typeScrollPane = new JScrollPane(mainTypeList);
typeScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
iconViewList = new JList();
iconListModel = new DefaultListModel();
iconViewList.setModel(iconListModel);
iconViewList.setVisibleRowCount(0);
iconViewList.setLayoutOrientation(JList.HORIZONTAL_WRAP);
iconViewList.setCellRenderer(iconCellRenderer);
JScrollPane subListPane = new JScrollPane(iconViewList);
//iconPane.add
mainTypeList.setSelectedIndex(0);
JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane);
spane.setDividerLocation(120);
spane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("M-Popup_ChartType")));
this.add(spane);
iconViewList.setSelectedIndex(0);
}
ListCellRenderer iconCellRenderer = new DefaultListCellRenderer() {
private static final long serialVersionUID = 956888843609479566L;
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
this.setText("");
if (value instanceof ChartIcon) {
this.setIcon((ChartIcon) value);
setHorizontalAlignment(UILabel.CENTER);
if (isSelected) {
// 深蓝色.
this.setBackground(new Color(57, 107, 181));
}
ChartIcon chartIcon = (ChartIcon) value;
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon), null));
}
return this;
}
};
protected ListSelectionListener listSelectionListener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
int main_index = mainTypeList.getSelectedIndex();
Chart[] sub_charts = ChartTypePane.this.charts4Icon[main_index];
ChartTypePane.this.iconListModel.clear();
for (int i = 0; i < sub_charts.length; i++) {
ChartTypePane.this.iconListModel.addElement(new ChartIcon(sub_charts[i]));
}
iconViewList.setSelectedIndex(0);
}
};
public String getChartName(ChartIcon chartIcon) {
Chart chart = (Chart)chartIcon.getChart();
return chart.getChartName();
}
public void populate(Chart chart) {
if (chart == null) {
return;
}
Plot plot = chart.getPlot();
int mainIndex = 0;
int subIndex = 0;
for (int i = 0; i < typeName.length; i++) {
Chart [] charts = ChartTypeManager.getInstance().getChartTypes(typeName[i].getPlotID());
for (int j = 0; j < charts.length; j++) {
if (charts[j].getPlot().match4GUI(plot)) {
mainIndex = i;
subIndex = j;
// 一旦匹配 立马中断
break;
}
}
}
mainTypeList.setSelectedIndex(mainIndex);
iconViewList.setSelectedIndex(subIndex);
}
public void update(Chart oldChart) {
String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID();
Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
if(chart.getPlot() != null){
if(chart.getPlot() instanceof MapPlot && !(VT4FR.isLicAvailable(StableUtils.getBytes()) && VT4FR.CHART_MAP.support())){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Chart-Map_Not_Supported"));
throw new RegistEditionException(VT4FR.CHART_MAP);
}
if (chart.getPlot() != null) {
try {
oldChart.changePlotInNewType((Plot) chart.getPlot().clone());
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
}
}
public void update(ChartCollection cc) {
if (cc == null) {
return;
}
Chart chart4Update = cc.getSelectedChart();
if (chart4Update == null) {
String plotID = typeName[mainTypeList.getSelectedIndex()].getPlotID();
Chart chart = ChartTypeManager.getInstance().getChartTypes(plotID)[iconViewList.getSelectedIndex()];
try{
chart4Update = (Chart)chart.clone();
cc.addChart(chart4Update);
}catch (CloneNotSupportedException ex){
FRContext.getLogger().error(ex.getMessage(), ex);
}
}
update(chart4Update);
}
}

20
designer_chart/src/com/fr/design/chart/ChartWizardPane.java

@ -0,0 +1,20 @@
package com.fr.design.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.JWizardPanel;
/**
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-4-23 下午03:07:52
* 类说明: 图表向导界面
*/
public abstract class ChartWizardPane extends JWizardPanel {
public ChartWizardPane() {
super();
}
public abstract void update(ChartCollection cc);
public abstract void populate(ChartCollection cc);
}

40
designer_chart/src/com/fr/design/chart/FactoryObject.java

@ -0,0 +1,40 @@
package com.fr.design.chart;
import com.fr.design.chart.axis.ChartStyleAxisPane;
import com.fr.design.chart.series.SeriesCondition.dlp.DataLabelPane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-5
* Time : 下午5:29
*/
public class FactoryObject {
private Class<? extends ChartStyleAxisPane> axisPaneClass;
private Class<? extends DataLabelPane> dataLabelPaneClass;
public FactoryObject() {
}
public Class<? extends ChartStyleAxisPane> getAxisPaneClass() {
return axisPaneClass;
}
public FactoryObject setAxisPaneCls(Class<? extends ChartStyleAxisPane> axisPaneClass) {
this.axisPaneClass = axisPaneClass;
return this;
}
public Class<? extends DataLabelPane> getDataLabelPaneClass() {
return dataLabelPaneClass;
}
public FactoryObject setDataLabelPaneClass(Class<? extends DataLabelPane> dataLabelPaneClass) {
this.dataLabelPaneClass = dataLabelPaneClass;
return this;
}
public static FactoryObject EMPTY = new FactoryObject();
}

29
designer_chart/src/com/fr/design/chart/axis/AxisStyleObject.java

@ -0,0 +1,29 @@
package com.fr.design.chart.axis;
import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisUsePane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-2
* Time : 下午2:40
*/
public class AxisStyleObject {
private String name;
private ChartAxisUsePane axisStylePane;
public AxisStyleObject(String name, ChartAxisUsePane axisStylePane) {
this.name = name;
this.axisStylePane = axisStylePane;
}
public String getName() {
return name;
}
public ChartAxisUsePane getAxisStylePane() {
return axisStylePane;
}
}

17
designer_chart/src/com/fr/design/chart/axis/AxisStylePane.java

@ -0,0 +1,17 @@
package com.fr.design.chart.axis;
import com.fr.general.Inter;
import com.fr.design.dialog.BasicPane;
public abstract class AxisStylePane<T> extends BasicPane {
private static final long serialVersionUID = 8969849654720197617L;
public abstract void populate(T axis);
public abstract void update(T axis);
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Set", "ChartF-Axis", "Format"});
}
}

63
designer_chart/src/com/fr/design/chart/axis/BinaryChartStyleAxisPane.java

@ -0,0 +1,63 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.CategoryPlot;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisUsePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartPercentValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午8:57
*/
public class BinaryChartStyleAxisPane extends ChartStyleAxisPane {
public BinaryChartStyleAxisPane(Plot plot) {
super(plot);
}
/**
* 创建坐标轴样式面板
* @param plot 图表
* @return 面板
*/
public final AxisStyleObject[] createAxisStyleObjects(Plot plot) {
return new AxisStyleObject[]{
getXAxisPane(plot),
getYAxisPane(plot)
};
}
protected AxisStyleObject getXAxisPane(final Plot plot) {
//是否支持坐标轴轴样式
return new AxisStyleObject(CATE_AXIS, new ChartCategoryPane(){
protected boolean isSupportLineStyle(){
return plot.isSupportAxisLineStyle();
}
});
}
protected AxisStyleObject getYAxisPane(final Plot plot) {
Axis axis = plot.getyAxis();
// 堆积情况时
boolean isStack = false;
if(plot instanceof CategoryPlot) {
isStack = ((CategoryPlot)plot).isStacked();
}
ChartValuePane valuePane = new ChartValuePane(){
protected boolean isSupportLineStyle(){
return plot.isSupportAxisLineStyle();
}
};
boolean usePercentPane = axis.isPercentage() && isStack;
ChartAxisUsePane p = usePercentPane ? new ChartPercentValuePane() : valuePane;
return new AxisStyleObject(VALUE_AXIS, p);
}
}

63
designer_chart/src/com/fr/design/chart/axis/ChartAlertLinePane.java

@ -0,0 +1,63 @@
package com.fr.design.chart.axis;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.stable.Nameable;
import com.fr.chart.chartattr.ChartAlertValue;
import com.fr.design.gui.controlpane.JControlPane;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import java.util.ArrayList;
import java.util.List;
public class ChartAlertLinePane extends JControlPane {
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new NameObjectCreator(Inter.getLocText("ChartF-Alert-Line"),
ChartAlertValue.class, ChartAlertValuePane.class)
};
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Edit", "ChartF-Alert-Line"});
}
public void populate(ChartAlertValue[] alertList) {
if (alertList == null) {
alertList = new ChartAlertValue[0];
}
List<NameObject> nameObjectList = new ArrayList<NameObject>();
for (int i = 0; i < alertList.length; i++) {
ChartAlertValue value = alertList[i];
nameObjectList.add(new NameObject(value.getAlertPaneSelectName(), value));
}
if (!nameObjectList.isEmpty()) {
populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
}
public ChartAlertValue[] updateAlertValues() {
Nameable[] res = update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
if (res_array.length < 1) {
return new ChartAlertValue[0];
}
List alertValueList = new ArrayList();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
ChartAlertValue chartAlertValue = (ChartAlertValue) nameObject.getObject();
chartAlertValue.setAlertPaneSelectName(nameObject.getName());
alertValueList.add(chartAlertValue);
}
return (ChartAlertValue[]) alertValueList.toArray(new ChartAlertValue[alertValueList.size()]);
}
}

20
designer_chart/src/com/fr/design/chart/axis/ChartAlertValueInTopBottomPane.java

@ -0,0 +1,20 @@
package com.fr.design.chart.axis;
import com.fr.general.Inter;
/**
* 警戒线 居上 居下界面.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-5-22 上午09:53:28
*/
public class ChartAlertValueInTopBottomPane extends ChartAlertValuePane {
protected String getLeftName() {
return Inter.getLocText("Chart_Alert_Bottom");
}
protected String getRightName() {
return Inter.getLocText("Chart_Alert_Top");
}
}

229
designer_chart/src/com/fr/design/chart/axis/ChartAlertValuePane.java

@ -0,0 +1,229 @@
package com.fr.design.chart.axis;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartAlertValue;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.AlphaPane;
import com.fr.design.style.FRFontPane;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
* 图表 坐标轴 警戒线值 编辑界面. (默认 位置居左居右)
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-5-22 上午09:49:54
*/
public class ChartAlertValuePane extends BasicBeanPane<ChartAlertValue> {
private static final int DE_FONT = 9;
private static final double ALPH_PER = 100;
private UITextField textField;
private LineComboBox lineCombo;
private ColorSelectBox colorBox;
private AlphaPane alphaPane;
private UITextField contentField;
private UIComboBox fontNameBox;
private UIComboBox fontSizeBox;
private UIRadioButton leftButton;
private UIRadioButton rightButton;
public ChartAlertValuePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel pane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(pane, BorderLayout.CENTER);
JPanel alertLinePane =FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
pane.add(alertLinePane);
alertLinePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"ChartF-Alert-Line", "Set"})));
JPanel valuePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(valuePane);
valuePane.add(new UILabel(Inter.getLocText(new String[]{"ChartF_Alert", "Value"}) + ":"));
textField = new UITextField();
textField.setColumns(4);
valuePane.add(textField);
textField.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
showFormulaPane();
}
});
textField.addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
e.consume();
showFormulaPane();
}
});
JPanel lineStylePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(lineStylePane);
lineStylePane.add(new UILabel(Inter.getLocText("Line-Style") + ":"));
lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
lineStylePane.add(lineCombo);
JPanel lineColorPane =FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
alertLinePane.add(lineColorPane);
lineColorPane.add(new UILabel(Inter.getLocText(new String[]{"ChartF-Alert-Line", "Color"}) + ":"));
colorBox = new ColorSelectBox(80);
lineColorPane.add(colorBox);
alphaPane = new AlphaPane();
alertLinePane.add(alphaPane);
JPanel tipPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
pane.add(tipPane);
tipPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Chart_Alert_Tip") + ":", null));
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
tipPane.add(centerPane);
fontNameBox = new UIComboBox();
fontNameBox.setPreferredSize(new Dimension(80,20));
fontNameBox.addItem("SimSun"); // TODO 这边字体中没有在列表内
String[] names = Utils.getAvailableFontFamilyNames4Report();
for(int i = 0; i < names.length; i++) {
fontNameBox.addItem(names[i]);
}
fontSizeBox = new UIComboBox();
fontSizeBox.setPreferredSize(new Dimension(80,20));
Integer[] sizes = FRFontPane.Font_Sizes;
for(int i = 0; i < sizes.length; i++) {
fontSizeBox.addItem(sizes[i]);
}
double t = TableLayout.FILL;
double[] rowSize = {t, t, t, t, t};
double[] columnSize = {0.1, 0.2, 0.5, 0.2};
Component[][] components= {
{null, new UILabel(Inter.getLocText("Content") + ":"), contentField = new UITextField(3)},
{null, new UILabel(Inter.getLocText("FRFont") + ":"), fontNameBox},
{null, new UILabel(Inter.getLocText("FRFont-Size") + ":"), fontSizeBox},
{null, new UILabel(Inter.getLocText("Layout") + ": "), leftButton = new UIRadioButton(getLeftName())},
{null, null, rightButton = new UIRadioButton(getRightName())},
};
JPanel tablePane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
centerPane.add(tablePane);
ButtonGroup bg = new ButtonGroup();
bg.add(leftButton);
bg.add(rightButton);
leftButton.setSelected(true);
}
protected String getLeftName() {// 居左 居右
return Inter.getLocText("Chart_Alert_Left");
}
protected String getRightName() {
return Inter.getLocText("Chart_Alert_Right");
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("ChartF-Alert-Line");
}
private void showFormulaPane() {
final UIFormula formulaPane = FormulaFactory.createFormulaPane();
formulaPane.populate(new Formula(textField.getText()));
formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(ChartAlertValuePane.this), new DialogActionAdapter(){
public void doOk() {
Formula formula = formulaPane.update();
textField.setText(Utils.objectToString(formula));
}
}).setVisible(true);
}
@Override
public void populateBean(ChartAlertValue ob) {
//兼容以前设置的虚线
if (ob.getLineStyle().getLineStyle() != Constants.LINE_NONE
&& ob.getLineStyle().getLineStyle() != Constants.LINE_THIN
&& ob.getLineStyle().getLineStyle() != Constants.LINE_MEDIUM
&& ob.getLineStyle().getLineStyle() != Constants.LINE_THICK) {
ob.getLineStyle().setLineStyle(Constants.LINE_THIN);
}
textField.setText(Utils.objectToString(ob.getAlertValueFormula()));
lineCombo.setSelectedLineStyle(ob.getLineStyle().getLineStyle());
colorBox.setSelectObject(ob.getLineColor().getSeriesColor());
alphaPane.populate((int)(ob.getAlertLineAlpha() * ALPH_PER));
contentField.setText(ob.getAlertContent());
fontNameBox.setSelectedItem(ob.getAlertFont().getName());
fontSizeBox.setSelectedItem(ob.getAlertFont().getSize());
if(ob.getAlertPosition() == Constants.LEFT) {
leftButton.setSelected(true);
} else {
rightButton.setSelected(true);
}
}
@Override
public ChartAlertValue updateBean() {
ChartAlertValue chartAlertValue = new ChartAlertValue();
updateBean(chartAlertValue);
return chartAlertValue;
}
public void updateBean(ChartAlertValue chartAlertValue) {
chartAlertValue.setAlertValueFormula(new Formula(textField.getText()));
chartAlertValue.getLineColor().setSeriesColor(colorBox.getSelectObject());
chartAlertValue.getLineStyle().setLineStyle(lineCombo.getSelectedLineStyle());
chartAlertValue.setAlertLineAlpha(alphaPane.update());
chartAlertValue.setAlertContent(contentField.getText());
String fontName = Utils.objectToString(fontNameBox.getSelectedItem());
int fontSize = DE_FONT;
Number number = Utils.objectToNumber(fontSizeBox.getSelectedItem(), true);
if(number != null) {
fontSize = number.intValue();
}
chartAlertValue.setAlertFont(FRFont.getInstance(fontName, Font.PLAIN, fontSize));
if(leftButton.isSelected()) {
chartAlertValue.setAlertPosition(Constants.LEFT);
} else if(rightButton.isSelected()) {
chartAlertValue.setAlertPosition(Constants.RIGHT);
}
}
}

87
designer_chart/src/com/fr/design/chart/axis/ChartStyleAxisPane.java

@ -0,0 +1,87 @@
package com.fr.design.chart.axis;
import java.awt.CardLayout;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.gui.style.axis.ChartAxisUsePane;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-2
* Time : 上午8:48
*/
public abstract class ChartStyleAxisPane extends BasicPane implements ListSelectionListener {
protected static final String CATE_AXIS = Inter.getLocText("ChartF-Category_Axis");
protected static final String VALUE_AXIS = Inter.getLocText("Chart_F_Radar_Axis");
protected static final String SECOND_AXIS = Inter.getLocText(new String[]{"Second", "Chart_F_Radar_Axis"});
private JList mainList;
private CardLayout cardLayout;
private JPanel cardDisplayPane = null;
private java.util.List<ChartAxisUsePane> axisStylePaneList = new ArrayList<ChartAxisUsePane>();
public ChartStyleAxisPane(Plot plot) {
initComponents(plot);
}
private void initComponents(Plot plot) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
DefaultListModel listModel = new DefaultListModel();
mainList = new JList(listModel);
AxisStyleObject[] axisStyleObjects = createAxisStyleObjects(plot);
cardLayout = new CardLayout();
cardDisplayPane = FRGUIPaneFactory.createCardLayout_S_Pane();
cardDisplayPane.setLayout(cardLayout);
for (int i = 0; i < axisStyleObjects.length; i ++) {
AxisStyleObject as = axisStyleObjects[i];
listModel.addElement(as.getName());
ChartAxisUsePane axisStylePane = as.getAxisStylePane();
axisStylePaneList.add(axisStylePane);
cardDisplayPane.add(axisStylePane, as.getName());
}
mainList.setSelectedIndex(0);
mainList.addListSelectionListener(this);
this.add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, mainList, cardDisplayPane));
}
@Override
protected String title4PopupWindow() {
return "Axis";
}
public void valueChanged(ListSelectionEvent e) {
cardLayout.show(cardDisplayPane, (String)mainList.getSelectedValue());
}
public abstract AxisStyleObject[] createAxisStyleObjects(Plot plot);
public void populate(Plot plot) {
for (int i = 0, len = axisStylePaneList.size(); i < len; i++) {
// axisStylePaneList.get(i).populate(getAxisFromPlotByListIndex(plot, i));
}
}
public void update(Plot plot) {
for (int i = 0, len = axisStylePaneList.size(); i < len; i++) {
// axisStylePaneList.get(i).update(getAxisFromPlotByListIndex(plot, i));
}
}
private Axis getAxisFromPlotByListIndex(Plot plot, int index) {
return plot.getAxis(index);
}
}

19
designer_chart/src/com/fr/design/chart/axis/CustomChartStyleAxisPane.java

@ -0,0 +1,19 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.general.Inter;
public class CustomChartStyleAxisPane extends TernaryChartStyleAxisPane {
public CustomChartStyleAxisPane(Plot plot) {
super(plot);
}
protected String getValueAxisName() {
return Inter.getLocText("Main_Axis");
}
protected String getSecondValueAxisName() {
return Inter.getLocText("Second_Axis");
}
}

28
designer_chart/src/com/fr/design/chart/axis/GanntChartStyleAxisPane.java

@ -0,0 +1,28 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryPane;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午9:50
*/
public class GanntChartStyleAxisPane extends BinaryChartStyleAxisPane {
public GanntChartStyleAxisPane(Plot plot) {
super(plot);
}
protected AxisStyleObject getXAxisPane(Plot plot) {
ChartCategoryPane categoryPane = new ChartCategoryPane();
categoryPane.getAxisValueTypePane().removeTextAxisPane();
return new AxisStyleObject(Inter.getLocText("Chart_Date_Axis"), categoryPane);
}
protected AxisStyleObject getYAxisPane(Plot plot) {
return new AxisStyleObject(CATE_AXIS, new ChartCategoryPane());
}
}

193
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -0,0 +1,193 @@
package com.fr.design.chart.axis;
import com.fr.base.Formula;
import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.chartattr.Axis;
import com.fr.design.chart.ChartSwingUtils;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class MinMaxValuePane extends JPanel {
private static final long serialVersionUID = 3353266754022091576L;
protected UICheckBox maxCheckBox;
protected UITextField maxValueField;
protected UICheckBox minCheckBox;
protected UITextField minValueField;
// 主次要刻度单位
protected UICheckBox isCustomMainUnitBox;
protected UITextField mainUnitField;
protected UICheckBox isCustomSecUnitBox;
protected UITextField secUnitField;
public MinMaxValuePane() {
minCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Min_Value"}));
minValueField = new UITextField(6);
maxCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Custom", "Max_Value"}));
maxValueField = new UITextField(6);
isCustomMainUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_MainGraduationUnit"));
mainUnitField = new UITextField(6);
isCustomSecUnitBox = new UICheckBox(Inter.getLocText("FR-Chart_SecondGraduationUnit"));
secUnitField = new UITextField(6);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p, f };
double[] rowSize = { p, p, p, p};
Component[][] components = getPanelComponents();
JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
for(int i = 0; i < components.length; i++) {
((UICheckBox)components[i][0]).addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]);
}
}
protected Component[][] getPanelComponents() {
return new Component[][]{
new Component[]{minCheckBox, minValueField},
new Component[]{maxCheckBox, maxValueField},
new Component[]{isCustomMainUnitBox, mainUnitField},
new Component[]{isCustomSecUnitBox, secUnitField},
};
}
private void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected());
mainUnitField.setEnabled(isCustomMainUnitBox.isSelected());
secUnitField.setEnabled(isCustomSecUnitBox.isSelected());
}
public void setPaneEditable(boolean isEditable) {
minCheckBox.setEnabled(isEditable);
maxCheckBox.setEnabled(isEditable);
minValueField.setEnabled(isEditable);
maxValueField.setEnabled(isEditable);
mainUnitField.setEnabled(isEditable);
secUnitField.setEnabled(isEditable);
isCustomMainUnitBox.setEnabled(isEditable);
isCustomSecUnitBox.setEnabled(isEditable);
checkBoxUse();
}
public void populate(Axis axis) {
if(axis == null) {
return;
}
if (axis.isCustomMinValue()) {
minCheckBox.setSelected(true);
if(axis.getMinValue() != null) {
minValueField.setText(axis.getMinValue().toString());
}
}
// 最大值
if (axis.isCustomMaxValue()) {
maxCheckBox.setSelected(true);
if(axis.getMaxValue() != null) {
maxValueField.setText(axis.getMaxValue().toString());
}
}
// 主次刻度单位
if (axis.isCustomMainUnit()) {
isCustomMainUnitBox.setSelected(true);
if(axis.getMainUnit() != null) {
mainUnitField.setText(axis.getMainUnit().toString());
}
}
if(axis.isCustomSecUnit()) {
isCustomSecUnitBox.setSelected(true);
if(axis.getSecUnit() != null) {
secUnitField.setText(axis.getSecUnit().toString());
}
}
checkBoxUse();
}
public void update(Axis axis) {
if (axis == null) {
return;
}
// 最大最小值
if (minCheckBox.isSelected()) {
axis.setCustomMinValue(StringUtils.isNotEmpty(minValueField.getText()));
axis.setMinValue(new Formula(minValueField.getText()));
} else {
axis.setCustomMinValue(false);
}
if (maxCheckBox.isSelected()) {
axis.setCustomMaxValue(StringUtils.isNotEmpty(maxValueField.getText()));
axis.setMaxValue(new Formula(maxValueField.getText()));
} else {
axis.setCustomMaxValue(false);
}
updateUnit(axis);
}
private void updateUnit(Axis axis) {
// 主要刻度
if (isCustomMainUnitBox.isSelected()){
String increment = mainUnitField.getText();
if(StringUtils.isEmpty(increment)) {
axis.setCustomMainUnit(false);
axis.setMainUnit(null);
} else {
axis.setCustomMainUnit(true);
Formula formula = new Formula(increment);
Number number = ChartBaseUtils.formula2Number(formula);
if(number != null && number.doubleValue() < 0) {
axis.setMainUnit(new Formula("10"));
} else {
axis.setMainUnit(formula);
}
}
} else {
axis.setCustomMainUnit(false);
}
if (isCustomSecUnitBox.isSelected()){
String increment = secUnitField.getText();
if(StringUtils.isEmpty(increment)) {
axis.setCustomSecUnit(false);
axis.setSecUnit(null);
} else {
axis.setCustomSecUnit(true);
Formula formula = new Formula(increment);
Number number = ChartBaseUtils.formula2Number(formula);
if(number != null && number.doubleValue() < 0) {
axis.setSecUnit(new Formula("10"));
} else {
axis.setSecUnit(formula);
}
}
} else {
axis.setCustomSecUnit(false);
}
}
}

26
designer_chart/src/com/fr/design/chart/axis/RadarChartStyleAxisPane.java

@ -0,0 +1,26 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartRadarPane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-5
* Time : 下午7:18
* 雷达图的图表样式--> 坐标轴界面
*/
public class RadarChartStyleAxisPane extends ChartStyleAxisPane {
private static final long serialVersionUID = 8919941507725513032L;
public RadarChartStyleAxisPane(Plot plot) {
super(plot);
}
public final AxisStyleObject[] createAxisStyleObjects(Plot plot) {
return new AxisStyleObject[]{new AxisStyleObject(
CATE_AXIS,
new ChartRadarPane())};
}
}

42
designer_chart/src/com/fr/design/chart/axis/TernaryChartStyleAxisPane.java

@ -0,0 +1,42 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartCategoryPane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartSecondValuePane;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午8:58
* 三元坐标设置界面
*/
public class TernaryChartStyleAxisPane extends ChartStyleAxisPane {
private static final long serialVersionUID = 539802340384090324L;
public TernaryChartStyleAxisPane(Plot plot) {
super(plot);
}
@Override
public AxisStyleObject[] createAxisStyleObjects(Plot plot) {
return new AxisStyleObject[]{
new AxisStyleObject(CATE_AXIS,
new ChartCategoryPane()),
new AxisStyleObject(getValueAxisName(),
new ChartValuePane()),
new AxisStyleObject(getSecondValueAxisName(),
new ChartSecondValuePane())
};
}
protected String getValueAxisName() {
return VALUE_AXIS;
}
protected String getSecondValueAxisName() {
return SECOND_AXIS;
}
}

25
designer_chart/src/com/fr/design/chart/axis/ValueChartStyleAxisPane.java

@ -0,0 +1,25 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午9:02
*/
public class ValueChartStyleAxisPane extends ChartStyleAxisPane {
private static final long serialVersionUID = 8513685484255363315L;
public ValueChartStyleAxisPane(Plot plot) {
super(plot);
}
public final AxisStyleObject[] createAxisStyleObjects(Plot plot) {
return new AxisStyleObject[]{new AxisStyleObject(
CATE_AXIS,
new ChartValuePane())};
}
}

26
designer_chart/src/com/fr/design/chart/axis/XYChartStyleAxisPane.java

@ -0,0 +1,26 @@
package com.fr.design.chart.axis;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.style.axis.ChartValuePane;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-12-6
* Time : 上午9:51
*/
public class XYChartStyleAxisPane extends BinaryChartStyleAxisPane {
public XYChartStyleAxisPane(Plot plot) {
super(plot);
}
protected AxisStyleObject getXAxisPane(Plot plot) {
return new AxisStyleObject(Inter.getLocText("ChartF-X_Axis"), new ChartValuePane());
}
protected AxisStyleObject getYAxisPane(Plot plot) {
return new AxisStyleObject(Inter.getLocText("ChartF-Y_Axis"), new ChartValuePane());
}
}

59
designer_chart/src/com/fr/design/chart/comp/BorderAttriPane.java

@ -0,0 +1,59 @@
package com.fr.design.chart.comp;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.dialog.BasicPane;
import com.fr.design.style.color.ColorSelectBox;
import java.awt.*;
public class BorderAttriPane extends BasicPane {
private LineComboBox lineCombo;
private ColorSelectBox colorSelectBox;
public BorderAttriPane() {
this(Inter.getLocText("Line-Style"), Inter.getLocText("Color"));
}
public BorderAttriPane(String lineString, String colorSting) {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
this.add(new UILabel(lineString + ":"));
this.add(lineCombo = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART));
lineCombo.setPreferredSize(new Dimension(60, 18));
this.add(new UILabel(colorSting + ":"));
this.add(colorSelectBox = new ColorSelectBox(80));
colorSelectBox.setPreferredSize(new Dimension(60, 18));
colorSelectBox.setSelectObject(null);
}
public void setLineColor(Color color) {
this.colorSelectBox.setSelectObject(color);
}
public Color getLineColor() {
return this.colorSelectBox.getSelectObject();
}
public void setLineStyle(int style) {
if (style != Constants.LINE_NONE && style != Constants.LINE_THICK
&& style != Constants.LINE_THIN && style != Constants.LINE_MEDIUM) {
style = Constants.LINE_THIN;
}
this.lineCombo.setSelectedLineStyle(style);
}
public int getLineStyle() {
return lineCombo.getSelectedLineStyle();
}
@Override
protected String title4PopupWindow() {
return "Border";
}
}

123
designer_chart/src/com/fr/design/chart/demo/GlyphDemo.java

@ -0,0 +1,123 @@
package com.fr.design.chart.demo;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.*;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.*;
import java.awt.*;
public class GlyphDemo extends JFrame {
private static final long serialVersionUID = -3174315376448330927L;
/**
* 主函数
* @param args 参数
*/
public static void main(String[] args) {
new GlyphDemo();
}
public GlyphDemo() {
JPanel contentPane = (JPanel)this.getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createBorderLayout());
UITabbedPane tab = new UITabbedPane();
contentPane.add(tab, BorderLayout.CENTER);
tab.add("Line", createGlyphLinePanel());
tab.add("Bar", createBarPanel());
tab.add("Area", createAreaPanel());
tab.add("Meter", createMeterPanel());
tab.add("Pie", createPiePanel());
tab.add("Radar", createRadarPanel());
tab.add("Stock", createStockPanel());
tab.add("XYScatter", createXYScatterPanel());
tab.add("Range", createRangePanel());
tab.add("Mix", createCustomPanel());
tab.add("Gantt", createGanttPanel());
tab.add("Bubble", createBubblePane());
setSize(1200, 600);
// 关闭时退出
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setTitle("Line Glyph Demo");
setVisible(true);
}
private JPanel createGlyphLinePanel() {
Chart[] chr = LineIndependentChart.lineChartTypes;
return contentPane(chr,2,4);
}
private JPanel createBarPanel() {
Chart[] chr= ColumnIndependentChart.columnChartTypes;
return contentPane(chr,2,4);
}
private JPanel createAreaPanel() {
Chart[] chr= AreaIndependentChart.areaChartTypes;
return contentPane(chr,2,4);
}
private JPanel createMeterPanel() {
Chart[] chr= MeterIndependentChart.meterChartTypes;
return contentPane(chr,2,4);
}
private JPanel createPiePanel() {
Chart[] chr = PieIndependentChart.pieChartTypes;
JPanel contentPane = contentPane(chr,2,4);
return contentPane;
}
private JPanel createRadarPanel() {
Chart[] chr = RadarIndependentChart.radarChartTypes;
return contentPane(chr,2,4);
}
private JPanel createStockPanel() {
Chart[] chr = StockIndependentChart.stockChartTypes;
return contentPane(chr,2,4);
}
private JPanel createXYScatterPanel() {
Chart[] chr = XYScatterIndependentChart.XYScatterChartTypes;
return contentPane(chr,2,4);
}
private JPanel createRangePanel() {
Chart[] chr = RangeIndependentChart.rangeChartTypes;
return contentPane(chr,2,4);
}
private JPanel createCustomPanel() {
Chart[] chr = CustomIndependentChart.combChartTypes;
return contentPane(chr,2,4);
}
private JPanel createGanttPanel() {
Chart[] chr = GanttIndependentChart.ganttChartTypes;
return contentPane(chr,2,4);
}
private JPanel createBubblePane() {
Chart[] chr = BubbleIndependentChart.bubbleChartTypes;
return contentPane(chr,2,4);
}
private JPanel contentPane(Chart[] chr,int x,int y){
JPanel contentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
contentPane.setLayout(new /**/ GridLayout(x, y));
for(int i=0;i<chr.length;i++){
contentPane.add(new ChartComponent(new ChartCollection(chr[i])));
}
return contentPane;
}
}

86
designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java

@ -0,0 +1,86 @@
package com.fr.design.chart.fun;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.stable.fun.Level;
/**
* Created by eason on 14/12/29.
*
* @since 8.0
* 自定义图表类型设设计界面接口
*/
public interface IndependentChartUIProvider extends Level {
String XML_TAG = "IndependentChartUIProvider";
int CURRENT_API_LEVEL = 2;
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
AbstractChartTypePane getPlotTypePane();
/**
* 数据集数据源的界面
*
* @return 数据集数据源的界面
*/
AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 单元格数据源的界面
*
* @return 单元格数据源的界面
*/
AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent);
/**
* 条件属性界面
*
* @return 条件属性界面
*/
ConditionAttributesPane getPlotConditionPane(Plot plot);
/**
* 系列界面
*
* @return 系列界面
*/
BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot);
/**
* 图表的属性界面数组
*
* @return 属性界面
*/
AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener);
/**
* 是否使用默认的界面为了避免界面来回切换
*
* @return 是否使用默认的界面
*/
boolean isUseDefaultPane();
/**
* 图标路径
*
* @return 图标路径
*/
String getIconPath();
}

52
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUI.java

@ -0,0 +1,52 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
/**
* Created by eason on 15/4/23.
*/
@Deprecated
public abstract class AbstractIndependentChartUI implements IndependentChartUIProvider {
@Override
public int currentAPILevel() {
return -1;
}
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
return new AbstractChartAttrPane[0];
}
/**
* 是否使用默认的界面为了避免界面来回切换
* @return 是否使用默认的界面
*/
public boolean isUseDefaultPane(){
return true;
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return getPlotSeriesPane();
}
public BasicBeanPane<Plot> getPlotSeriesPane(){
return null;
}
public boolean equals(Object obj) {
return obj != null && ComparatorUtils.equals(obj.getClass(), this.getClass());
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new DataSeriesConditionPane();
}
}

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

@ -0,0 +1,49 @@
package com.fr.design.chart.fun.impl;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils;
/**
* Created by Mitisky on 16/3/7.
*/
public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider {
@Override
public int currentAPILevel() {
return CURRENT_API_LEVEL;
}
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
return new AbstractChartAttrPane[0];
}
/**
* 是否使用默认的界面为了避免界面来回切换
* @return 是否使用默认的界面
*/
public boolean isUseDefaultPane(){
return true;
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return getPlotSeriesPane();
}
public BasicBeanPane<Plot> getPlotSeriesPane(){
return null;
}
public boolean equals(Object obj) {
return obj != null && ComparatorUtils.equals(obj.getClass(), this.getClass());
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new DataSeriesConditionPane();
}
}

97
designer_chart/src/com/fr/design/chart/gui/ActiveGlyphFactory.java

@ -0,0 +1,97 @@
package com.fr.design.chart.gui;
import java.util.HashMap;
import java.util.Map;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.CategoryAxisGlyph;
import com.fr.chart.chartglyph.ChartAlertValueGlyph;
import com.fr.chart.chartglyph.ChartGlyph;
import com.fr.chart.chartglyph.DataSeries;
import com.fr.chart.chartglyph.DataSheetGlyph;
import com.fr.chart.chartglyph.DateAxisGlyph;
import com.fr.chart.chartglyph.LegendGlyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.RadarAxisGlyph;
import com.fr.chart.chartglyph.RangeAxisGlyph;
import com.fr.chart.chartglyph.TextGlyph;
import com.fr.chart.chartglyph.TitleGlyph;
import com.fr.chart.chartglyph.TrendLineGlyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.active.ActiveGlyph;
import com.fr.design.chart.gui.active.AlertValueActiveGlyph;
import com.fr.design.chart.gui.active.CategoryAxisActiveGlyph;
import com.fr.design.chart.gui.active.ChartActiveGlyph;
import com.fr.design.chart.gui.active.DataLabelActiveGlyph;
import com.fr.design.chart.gui.active.DataSeriesActiveGlyph;
import com.fr.design.chart.gui.active.DataSheetActiveGlyph;
import com.fr.design.chart.gui.active.DateAxisActiveGlyph;
import com.fr.design.chart.gui.active.LegendActiveGlyph;
import com.fr.design.chart.gui.active.PlotActiveGlyph;
import com.fr.design.chart.gui.active.RadarAxisActiveGlyph;
import com.fr.design.chart.gui.active.RangeAxisActiveGlyph;
import com.fr.design.chart.gui.active.TextActiveGlyph;
import com.fr.design.chart.gui.active.TrendLineActiveGlyph;
import com.fr.design.chart.gui.active.ValueAxisActiveGlyph;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-23
* Time : 上午9:08
*/
public class ActiveGlyphFactory {
private static Map<String, Class> glyphMap = new HashMap<String, Class>();
static {
glyphMap.put(DataSeries.class.getName(), DataSeriesActiveGlyph.class);
glyphMap.put(RadarAxisGlyph.class.getName(), RadarAxisActiveGlyph.class);
glyphMap.put(RangeAxisGlyph.class.getName(), RangeAxisActiveGlyph.class);
glyphMap.put(TitleGlyph.class.getName(), TextActiveGlyph.class);
glyphMap.put(DateAxisGlyph.class.getName(), DateAxisActiveGlyph.class);
glyphMap.put(ValueAxisGlyph.class.getName(), ValueAxisActiveGlyph.class);
glyphMap.put(CategoryAxisGlyph.class.getName(), CategoryAxisActiveGlyph.class);
glyphMap.put(ChartGlyph.class.getName(), ChartActiveGlyph.class);
glyphMap.put(DataSheetGlyph.class.getName(), DataSheetActiveGlyph.class);
glyphMap.put(LegendGlyph.class.getName(), LegendActiveGlyph.class);
glyphMap.put(TextGlyph.class.getName(), DataLabelActiveGlyph.class);
glyphMap.put(TrendLineGlyph.class.getName(), TrendLineActiveGlyph.class);
glyphMap.put(ChartAlertValueGlyph.class.getName(), AlertValueActiveGlyph.class);
}
private ActiveGlyphFactory() {
}
public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph) {
return createActiveGlyph(chartComponent, glyph, null);
}
public static ActiveGlyph createActiveGlyph(ChartComponent chartComponent, Object glyph, Glyph parentGlyph) {
if (glyph == null) {
return null;
}
String clsName = glyph.getClass().getName();
Class cls = glyphMap.get(clsName);
Class parameterCls = glyph.getClass();
if (cls == null) {
if (clsName.endsWith("PlotGlyph")) {
cls = PlotActiveGlyph.class;
parameterCls = PlotGlyph.class;
} else if (clsName.endsWith("DataSeries4Area")) {
cls = DataSeriesActiveGlyph.class;
parameterCls = DataSeries.class;
} else {
cls = ChartActiveGlyph.class;
parameterCls = ChartGlyph.class;
}
}
try {
Class[] argsClass = new Class[]{ChartComponent.class, parameterCls, Glyph.class};
return (ActiveGlyph) cls.getConstructor(argsClass).newInstance(new Object[]{chartComponent, glyph, parentGlyph});
} catch (Exception e) {
return null;
}
}
}

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

@ -0,0 +1,322 @@
package com.fr.design.chart.gui;
import com.fr.base.FRContext;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChart;
import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.design.chart.gui.active.ActiveGlyph;
import com.fr.design.chart.gui.active.ChartActiveGlyph;
import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.stable.ArrayUtils;
import com.fr.stable.core.PropertyChangeListener;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.Rectangle2D;
import java.awt.geom.RoundRectangle2D;
import java.util.ArrayList;
import java.util.List;
/**
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-7-3 下午02:46:45
* 类说明: 事件说明: 工具栏编辑--> 是刷新ChartComponent 然后响应整个设计块的改变事件
右键编辑 ---> 刷新ChartCompment 刷新对应的工具栏(加入事件) 然后响应整个设计块的改变事件
*/
public class ChartComponent extends MiddleChartComponent implements MouseListener, MouseMotionListener {
private static final long serialVersionUID = 744164838619052097L;
private final List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
private ChartCollection chartCollection4Design;
private Chart editingChart;
private BaseChartGlyph chartGlyph;
private int chartWidth = -1;
private int chartHeight = -1;
private Point point;
private ActiveGlyph activeGlyph;
private boolean supportEdit = true;
private final int[] resizeCursors = new int[]{
Cursor.NW_RESIZE_CURSOR, Cursor.N_RESIZE_CURSOR, Cursor.NE_RESIZE_CURSOR,
Cursor.E_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR, Cursor.SW_RESIZE_CURSOR
};
public ChartComponent() {
super();
addMouseListener(this);
addMouseMotionListener(this);
}
/**
* 必须加入 响应事件, 停止当前的选中元素编辑 && 获取焦点
* @author kunsnat E-mail kunsnat@gmail.com
* @param cc
*/
public ChartComponent(ChartCollection cc) {
this();
populate(cc);
}
public ChartComponent(BaseChartCollection cc) {
this();
populate(cc);
}
public ChartComponent(ChartCollection cc, PropertyChangeListener l) {
this();
populate(cc);
addStopEditingListener(l);
}
/**
* 右键编辑 图表编辑层的监听事件, 在停止编辑时 响应整个编辑模板(form, sheet)的改变.
* @param l 监听事件
*/
public void addStopEditingListener(PropertyChangeListener l) {
if (!listeners.contains(l)) {
listeners.add(l);
}
}
private void fireStopEditing() {
for (int len = listeners.size(), i = len; i > 0; i--) {
listeners.get(i - 1).propertyChange();
}
}
/**
* 停止编辑, 通知事情, 刷新画出新界面.
*/
public void reset() {
fireStopEditing();
this.editingChart = null;
this.chartGlyph = null;
this.activeGlyph = null;
this.point = null;
this.chartHeight = this.chartWidth = -1;
this.editingChart = this.chartCollection4Design.getSelectedChart();
refreshChartGlyph();
this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph);
repaint();
}
public void populate(BaseChartCollection cc) { // kunsnat_bug: 5471 实现设置的即时预览
try {// clone 为了判断编辑前后的值.
this.chartCollection4Design = (ChartCollection)cc;
// this.chartCollection4Design = (ChartCollection)cc.clone();
} catch (Exception e) {
FRContext.getLogger().error("ChartCollection clone is Error");
}
reset();
}
public BaseChartCollection update() {
return this.chartCollection4Design;
}
/**
* 设置是否支持编辑, :弹出对话框, 右键选中列表
*/
public void setSupportEdit(boolean supportEdit) {
this.supportEdit = supportEdit;
}
/**
* 返回是否支持编辑, :弹出对话框, 右键选中列表
* @return 返回是否支持编辑.
*/
public boolean isSupportEdit() {
return supportEdit;
}
public ChartCollection getChartCollection() {
return chartCollection4Design;
}
public int getChartSize() {
return (this.chartCollection4Design == null) ? 0 : this.chartCollection4Design.getChartCount();
}
public BaseChart getEditingChart() {
return editingChart;
}
public BaseChartGlyph getChartGlyph() {
return chartGlyph;
}
public void paintComponent(Graphics g) { //
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g;
Paint oldPaint = g2d.getPaint();
g2d.setPaint(Color.white);
g2d.fillRect(0, 0, this.getBounds().width, this.getBounds().height);
g2d.setPaint(oldPaint);
g2d.translate(ChartConstants.PREGAP4BOUNDS/2, ChartConstants.PREGAP4BOUNDS/2);
if (needRefreshChartGlyph()) {
refreshChartGlyph();
}
Object lastHint = g2d.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
// 反锯齿
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
drawChartGlyph(g2d);
ActiveGlyph ag = this.getActiveGlyph();
if (ag != null) {
ag.paint4ActiveGlyph(g2d, chartGlyph);
}
g2d.translate(-ChartConstants.PREGAP4BOUNDS/2, -ChartConstants.PREGAP4BOUNDS/2);
if (lastHint == null) {
lastHint = RenderingHints.VALUE_ANTIALIAS_OFF;
}
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, lastHint);
}
/*
* ChartGlyph改变大小的时候做的操作
*/
private void refreshChartGlyph() {
Dimension d = getBounds().getSize();
this.editingChart = this.chartCollection4Design.getSelectedChart();// kunsnat: 切换选中时 同步切换Plot
if (editingChart != null) {
this.chartGlyph = editingChart.createGlyph(editingChart.defaultChartData());
this.activeGlyph = ActiveGlyphFactory.createActiveGlyph(this, chartGlyph);
}
this.chartWidth = d.width - ChartConstants.PREGAP4BOUNDS;
this.chartHeight = d.height - ChartConstants.PREGAP4BOUNDS;
}
private ActiveGlyph getActiveGlyph() {
if (point == null) {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph);
} else {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y);
}
return this.activeGlyph;
}
/**
* 鼠标点击
* @param event 鼠标事件
*/
public void mouseClicked(MouseEvent event) {
int click = event.getClickCount();
if (click >= 1 && activeGlyph != null && this.isSupportEdit()) {
activeGlyph.goRightPane();
}
}
/**
* 鼠标按压
* @param e 鼠标事件
*/
public void mousePressed(MouseEvent e) {
point = new Point(e.getX(),e.getY());
if (!ArrayUtils.contains(resizeCursors, this.getCursor().getType())) {
this.activeGlyph = new ChartActiveGlyph(this, chartGlyph).findActionGlyphFromChildren(point.x, point.y);
}
if (this.activeGlyph == null) {
return;
}
repaint();
}
/**
* 鼠标松开
* @param e 鼠标事件
*/
public void mouseReleased(MouseEvent e) {
}
/**
* 鼠标进入
* @param e 鼠标事件
*/
public void mouseEntered(MouseEvent e) {
}
/**
* 鼠标退出
* @param e 鼠标事件
*/
public void mouseExited(MouseEvent e) {
}
/**
* 鼠标拖拽
* @param e 鼠标事件
*/
public void mouseDragged(MouseEvent e) {
}
/**
* 鼠标移动
* @param e 鼠标事件
*/
public void mouseMoved(MouseEvent e) {
ActiveGlyph ag = this.getActiveGlyph();
if (ag != null) {
ag.onMouseMove(e);
}
}
public AxisGlyph getActiveAxisGlyph() {
return (AxisGlyph) activeGlyph.getGlyph();
}
public Axis getActiveAxis() {
AxisGlyph axisGlyph = getActiveAxisGlyph();
if (editingChart.getPlot() != null) {
return editingChart.getPlot().getAxis(axisGlyph.getAxisType());
}
return null;
}
private boolean needRefreshChartGlyph() {
return chartGlyph == null || chartWidth != this.getBounds().width || chartHeight != this.getBounds().height;
}
private void drawChartGlyph(Graphics2D g2d) {
if (chartGlyph != null) {
if (chartGlyph.isRoundBorder()) {
chartGlyph.setBounds(new RoundRectangle2D.Double(0, 0, chartWidth, chartHeight, 10, 10));
} else {
chartGlyph.setBounds(new Rectangle2D.Double(0, 0, chartWidth, chartHeight));
}
// chartGlyph.draw(g2d, ScreenResolution.getScreenResolution());
//不直接画chartGlyph而画image的原因是表单的柱形图会溢出表单
//其他图都ok,其实感觉应该是柱形图画的不对,应该也可以改那边
Image chartImage = chartGlyph.toImage(chartWidth,chartHeight,ScreenResolution.getScreenResolution());
g2d.drawImage(chartImage, 0, 0, chartWidth, chartHeight, null);
}
}
}

79
designer_chart/src/com/fr/design/chart/gui/ChartWidgetOption.java

@ -0,0 +1,79 @@
package com.fr.design.chart.gui;
import com.fr.base.FRContext;
import com.fr.chart.chartattr.Chart;
import com.fr.design.gui.core.WidgetOption;
import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget;
import javax.swing.*;
/**
* 表单中 图表控件信息, 名称, class, form中通过XcreatorUtils反射类 实现XChartEditor的初始化.
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-7-5 上午09:59:39
*/
public class ChartWidgetOption extends WidgetOption {
private static final long serialVersionUID = -6576352405047132226L;
private String optionName;
private Icon optionIcon;
private Class<? extends ChartEditor> widgetClass;
private Chart chart;
public ChartWidgetOption(String optionName, Icon optionIcon, Class<? extends ChartEditor> widgetClass, Chart chart) {
this.optionName = optionName;
this.optionIcon = optionIcon;
this.widgetClass = widgetClass;
this.chart = chart;
}
/**
* 通过类 信息等 创建对应的控件编辑器.
*
* @return 返回控件编辑器.
*/
public Widget createWidget() {
Class<? extends ChartEditor> clz = widgetClass();
try {
ChartEditor widget = clz.newInstance();
widget.addChart((Chart) chart.clone());
return widget;
} catch (InstantiationException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (IllegalAccessException e) {
FRContext.getLogger().error(e.getMessage(), e);
} catch (CloneNotSupportedException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
return null;
}
/**
* 信息名称, 一般是图表的类型名称.
*
* @return 返回名称.
*/
public String optionName() {
return this.optionName;
}
/**
* 信息图片, 一般是图表按钮的缩略图.
*
* @return 信息图片.
*/
public Icon optionIcon() {
return this.optionIcon;
}
/**
* 图表控件对应Editor的类.
*
* @return 返回类.
*/
public Class<? extends ChartEditor> widgetClass() {
return this.widgetClass;
}
}

161
designer_chart/src/com/fr/design/chart/gui/active/ActiveGlyph.java

@ -0,0 +1,161 @@
package com.fr.design.chart.gui.active;
import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Shape;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import com.fr.base.ScreenResolution;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.Glyph;
import com.fr.design.chart.gui.ActiveGlyphFactory;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:51
* 选中的Glyph
*/
public abstract class ActiveGlyph {
protected Glyph parentGlyph;
protected ChartComponent chartComponent;
public ActiveGlyph(ChartComponent chartComponent, Glyph parentGlyph) {
this.chartComponent = chartComponent;
this.parentGlyph = parentGlyph;
}
public abstract Glyph getGlyph();
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
this.getGlyph().draw(g2d, resolution);
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
/**
* 属性表中, 通过点击 展开到对应的界面.
*/
public abstract void goRightPane();
/**
* 画的偏移的
* @return 偏移的
*/
public Point2D offset4Paint() {
return new Point2D.Double(
this.parentGlyph.getShape().getBounds().getX(),
this.parentGlyph.getShape().getBounds().getY()
);
}
public void paint4ActiveGlyph(Graphics2D g2d, BaseChartGlyph chartGlyph) {
if(this.parentGlyph == null) {
return;
}
Paint oldPaint = g2d.getPaint();
Composite oldComposite = g2d.getComposite();
g2d.setPaint(Color.white);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
g2d.fill(chartGlyph.getShape());
drawAllGlyph(g2d, ScreenResolution.getScreenResolution());
g2d.setPaint(oldPaint);
g2d.setComposite(oldComposite);
}
protected void drawSelectedBounds4Active(Graphics2D g2d) {
if (this.getGlyph() != null) {
Shape shape = this.getGlyph().getShape();
if (shape != null) {
g2d.draw(shape);
}
}
}
/**
*当前的ActiveGlyph是否包含坐标mouseX, mouseY
* @param mouseX 坐标X
* @param mouseY 坐标Y
* @return 包含则返回true
*/
public boolean contains(int mouseX, int mouseY) {
if (getGlyph() == null || getGlyph().getShape() == null){
return false;
}
Point2D offset = this.offset4Paint();
/*
* alex:因为Line2D.contains(x, y)必然返回false
* 所以用intersect一个区域,这个区域大小用4 * 4的,区域大一些,就灵敏一些
*/
return getGlyph().getShape().intersects(mouseX - offset.getX() - 2, mouseY - offset.getY() - 2, 4, 4);
}
/**
* 在当前选中的ActiveGlyph中,仅仅在其Children中找与mouseX, mouseY匹配的ActiveGlyph
* @param mouseX 坐标X
* @param mouseY 坐标Y
* @return 当前ativeGlyph
*/
public ActiveGlyph findActionGlyphFromChildren(int mouseX, int mouseY) {
Glyph currentGlyph = getGlyph();
// 报错应对.
if (currentGlyph == null) {
return null;
}
java.util.Iterator selectableChildren = currentGlyph.selectableChildren();
ActiveGlyph resAG = null;
while (selectableChildren.hasNext() && resAG == null) {
ActiveGlyph childActiveGlyph = ActiveGlyphFactory.createActiveGlyph(chartComponent, selectableChildren.next(), currentGlyph);
// 如果childActiveGlyph不为null,找一下其子辈有没有符合条件
if (childActiveGlyph != null) {
resAG = childActiveGlyph.findActionGlyphFromChildren(mouseX, mouseY);
}
// 如果childActiveGlyph的子辈没有符合条件的,就看一下这个childGlyph是否符合条件
if (resAG == null && childActiveGlyph != null && childActiveGlyph.contains(mouseX, mouseY)) {
resAG = childActiveGlyph;
}
}
// 如果当前ActiveGlyph的所有子辈都没有与mouseX, mouseY相匹配的,看一下它自己是否匹配
if (resAG == null) {
if (this.contains(mouseX, mouseY)) {
resAG = this;
}
}
return resAG;
}
/**
* 拖拽
* @param e 事件
*/
public void onMouseDragged(MouseEvent e) {
}
/**
* 移动事件
* @param e 事件
*/
public void onMouseMove(MouseEvent e) {
}
}

38
designer_chart/src/com/fr/design/chart/gui/active/AlertValueActiveGlyph.java

@ -0,0 +1,38 @@
package com.fr.design.chart.gui.active;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ChartAlertValueGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction;
public class AlertValueActiveGlyph extends ActiveGlyph{
ChartAlertValueGlyph alertValueGlyph;
public AlertValueActiveGlyph(ChartComponent chartComponent,ChartAlertValueGlyph alertLine, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.alertValueGlyph = alertLine;
}
public Point2D offset4Paint() {
Rectangle2D valueAxisBoudns = this.alertValueGlyph.getValueAxisGlyph().getBounds();
return new Point2D.Double(
this.parentGlyph.getShape().getBounds().getX() + valueAxisBoudns.getX(),
this.parentGlyph.getShape().getBounds().getY() + valueAxisBoudns.getY()
);
}
@Override
public Glyph getGlyph() {
return this.alertValueGlyph;
}
@Override
public void goRightPane() {
new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane();
}
}

43
designer_chart/src/com/fr/design/chart/gui/active/AxisActiveGlyph.java

@ -0,0 +1,43 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAxisStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:00
*/
public abstract class AxisActiveGlyph extends ActiveGlyph {
protected AxisGlyph axis;
public AxisActiveGlyph(ChartComponent chartComponent, AxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.axis = axis;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
this.axis.drawWithOutAlert(g2d, resolution);
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
public void goRightPane() {
new SetAxisStyleAction(chartComponent).showAxisStylePane();
}
/**
* 返回 对应的属性Axis
*/
public Glyph getGlyph() {
return this.axis;
}
}

19
designer_chart/src/com/fr/design/chart/gui/active/CategoryAxisActiveGlyph.java

@ -0,0 +1,19 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.CategoryAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:01
*/
public class CategoryAxisActiveGlyph extends AxisActiveGlyph {
public CategoryAxisActiveGlyph(ChartComponent chartComponent, CategoryAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

39
designer_chart/src/com/fr/design/chart/gui/active/ChartActiveGlyph.java

@ -0,0 +1,39 @@
package com.fr.design.chart.gui.active;
import java.awt.geom.Point2D;
import com.fr.base.chart.BaseChartGlyph;
import com.fr.base.chart.Glyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetChartStyleAciton;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:54
*/
public class ChartActiveGlyph extends ActiveGlyph {
private BaseChartGlyph glyphChart;
public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart) {
this(chartComponent, chart, null);
}
public ChartActiveGlyph(ChartComponent chartComponent, BaseChartGlyph chart, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.glyphChart = chart;
}
public Glyph getGlyph() {
return this.glyphChart;
}
public Point2D offset4Paint() {
return new java.awt.Point(0, 0);
}
public void goRightPane() {
new SetChartStyleAciton(chartComponent).showChartStylePane();
}
}

44
designer_chart/src/com/fr/design/chart/gui/active/DataLabelActiveGlyph.java

@ -0,0 +1,44 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.TextGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetDataLabelStyleAction;
public class DataLabelActiveGlyph extends ActiveGlyph{
private TextGlyph dataLabel;
public DataLabelActiveGlyph(ChartComponent chartComponent, TextGlyph dataLabel, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.dataLabel = dataLabel;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
ArrayList<TextGlyph> allDataPointLableGlyph = new ArrayList<TextGlyph>();
PlotGlyph plotGlyph = (PlotGlyph)(this.parentGlyph);
plotGlyph.getAllDataPointGlyph(allDataPointLableGlyph);
for(int index = 0; index < allDataPointLableGlyph.size(); index++){
allDataPointLableGlyph.get(index).draw(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
@Override
public Glyph getGlyph() {
return this.dataLabel;
}
@Override
public void goRightPane() {
new SetDataLabelStyleAction(chartComponent).showDataLabelStylePane();
}
}

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

@ -0,0 +1,53 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DataSeries;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:59
*/
public class DataSeriesActiveGlyph extends ActiveGlyph {
private DataSeries series;
public DataSeriesActiveGlyph(ChartComponent chartComponent, DataSeries series, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.series = series;
}
public Glyph getGlyph() {
return this.series;
}
/**
* 界面条状
*/
public void goRightPane() {
if(chartComponent.getEditingChart() == null) {
return;
}
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
}
@Override
public void drawAllGlyph(Graphics2D g2d, int resolution) {
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
if(this.parentGlyph != null && this.parentGlyph instanceof PlotGlyph){
PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph;
plotGlyph.drawShape4Series(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
}
}

30
designer_chart/src/com/fr/design/chart/gui/active/DataSheetActiveGlyph.java

@ -0,0 +1,30 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DataSheetGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetDataSheetAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:57
*/
public class DataSheetActiveGlyph extends ActiveGlyph {
private DataSheetGlyph dataSheetGlyph;
public DataSheetActiveGlyph(ChartComponent chartComponent, DataSheetGlyph dataSheetGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.dataSheetGlyph = dataSheetGlyph;
}
public Glyph getGlyph() {
return this.dataSheetGlyph;
}
public void goRightPane() {
new SetDataSheetAction(chartComponent).showDataSheetStylePane();
}
}

18
designer_chart/src/com/fr/design/chart/gui/active/DateAxisActiveGlyph.java

@ -0,0 +1,18 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.DateAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:03
*/
public class DateAxisActiveGlyph extends AxisActiveGlyph {
public DateAxisActiveGlyph(ChartComponent chartComponent, DateAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

30
designer_chart/src/com/fr/design/chart/gui/active/LegendActiveGlyph.java

@ -0,0 +1,30 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.LegendGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetLegendStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:58
*/
public class LegendActiveGlyph extends ActiveGlyph {
private LegendGlyph legendGlyph;
public LegendActiveGlyph(ChartComponent chartComponent, LegendGlyph legendGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.legendGlyph = legendGlyph;
}
public Glyph getGlyph() {
return this.legendGlyph;
}
public void goRightPane() {
new SetLegendStyleAction(chartComponent).showLegendStylePane();
}
}

34
designer_chart/src/com/fr/design/chart/gui/active/PlotActiveGlyph.java

@ -0,0 +1,34 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetPlotStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:55
*/
public class PlotActiveGlyph extends ActiveGlyph {
private PlotGlyph plotGlyph;
public PlotActiveGlyph(ChartComponent chartComponent, PlotGlyph plotGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.plotGlyph = plotGlyph;
}
public Glyph getGlyph() {
return this.plotGlyph;
}
public void goRightPane() {
new SetPlotStyleAction(chartComponent).showPlotPane();
}
public java.awt.Point offset4Paint() {
return new java.awt.Point(0, 0);
}
}

18
designer_chart/src/com/fr/design/chart/gui/active/RadarAxisActiveGlyph.java

@ -0,0 +1,18 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.RadarAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:03
*/
public class RadarAxisActiveGlyph extends AxisActiveGlyph {
public RadarAxisActiveGlyph(ChartComponent chartComponent, RadarAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

18
designer_chart/src/com/fr/design/chart/gui/active/RangeAxisActiveGlyph.java

@ -0,0 +1,18 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:02
*/
public class RangeAxisActiveGlyph extends AxisActiveGlyph {
public RangeAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

35
designer_chart/src/com/fr/design/chart/gui/active/TextActiveGlyph.java

@ -0,0 +1,35 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.TitleGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetTitleStyleAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午3:57
*/
public class TextActiveGlyph extends ActiveGlyph {
private TitleGlyph titleGlyph;
public TextActiveGlyph(ChartComponent chartComponent, TitleGlyph titleGlyph, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.titleGlyph = titleGlyph;
}
public Glyph getGlyph() {
return this.titleGlyph;
}
public java.awt.Point offset4Paint() {
return new java.awt.Point(0, 0);
}
public void goRightPane() {
new SetTitleStyleAction(chartComponent).showTitlePane();
}
}

43
designer_chart/src/com/fr/design/chart/gui/active/TrendLineActiveGlyph.java

@ -0,0 +1,43 @@
package com.fr.design.chart.gui.active;
import java.awt.Graphics2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.PlotGlyph;
import com.fr.chart.chartglyph.TrendLineGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.active.action.SetAnalysisLineStyleAction;
public class TrendLineActiveGlyph extends ActiveGlyph{
private TrendLineGlyph trendLine;
public TrendLineActiveGlyph(ChartComponent chartComponent,TrendLineGlyph trendLine, Glyph parentGlyph) {
super(chartComponent, parentGlyph);
this.trendLine = trendLine;
}
@Override
public Glyph getGlyph() {
return this.trendLine;
}
public void drawAllGlyph(Graphics2D g2d, int resolution){
Point2D offset4Paint = offset4Paint();
g2d.translate(offset4Paint.getX(), offset4Paint.getY());
PlotGlyph plotGlyph = (PlotGlyph)this.parentGlyph;
List<TrendLineGlyph> list = new ArrayList<TrendLineGlyph>();
plotGlyph.getAllTrendLineGlyph(list);
for(int index = 0; index < list.size(); index++){
list.get(index).draw(g2d, resolution);
}
g2d.translate(-offset4Paint.getX(), -offset4Paint.getY());
};
@Override
public void goRightPane() {
new SetAnalysisLineStyleAction(chartComponent).showAnalysisLineStylePane();
}
}

19
designer_chart/src/com/fr/design/chart/gui/active/ValueAxisActiveGlyph.java

@ -0,0 +1,19 @@
package com.fr.design.chart.gui.active;
import com.fr.base.chart.Glyph;
import com.fr.chart.chartglyph.ValueAxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:02
*/
public class ValueAxisActiveGlyph extends AxisActiveGlyph {
public ValueAxisActiveGlyph(ChartComponent chartComponent, ValueAxisGlyph axis, Glyph parentGlyph) {
super(chartComponent, axis, parentGlyph);
}
}

47
designer_chart/src/com/fr/design/chart/gui/active/action/ChartComponentAction.java

@ -0,0 +1,47 @@
package com.fr.design.chart.gui.active.action;
import com.fr.base.chart.BaseChart;
import com.fr.chart.chartattr.Axis;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartglyph.AxisGlyph;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.actions.UpdateAction;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:05
*/
public abstract class ChartComponentAction extends UpdateAction {
protected ChartComponent chartComponent;
public ChartComponentAction(ChartComponent chartComponent) {
this.chartComponent = chartComponent;
}
public void reset() {
chartComponent.reset();
}
public void repaint() {
chartComponent.repaint();
}
public BaseChart getEditingChart() {
return chartComponent.getEditingChart();
}
public ChartCollection getChartCollection() {
return chartComponent.getChartCollection();
}
public Axis getActiveAxis() {
return chartComponent.getActiveAxis();
}
public AxisGlyph getActiveAxisGlyph() {
return chartComponent.getActiveAxisGlyph();
}
}

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

@ -0,0 +1,27 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
public class SetAnalysisLineStyleAction extends ChartComponentAction{
public SetAnalysisLineStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "AnalysisLine"}));
}
@Override
public void actionPerformed(ActionEvent e) {
showAnalysisLineStylePane();
}
public void showAnalysisLineStylePane(){
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LINE_TITLE);
}
}

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

@ -0,0 +1,33 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:10
*/
public class SetAxisStyleAction extends ChartComponentAction {
public SetAxisStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "ChartF-Axis", "Format"}));
}
public void actionPerformed(ActionEvent e) {
showAxisStylePane();
}
public void showAxisStylePane() {
String axisType = getActiveAxisGlyph() == null ? StringUtils.EMPTY : getActiveAxisGlyph().getAxisType();
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AXIS_TITLE, axisType);
}
}

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

@ -0,0 +1,31 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:00
*/
public class SetChartStyleAciton extends ChartComponentAction {
public SetChartStyleAciton(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"DashBoard-ChartFloat", "Style"}));
}
public void actionPerformed(ActionEvent e) {
showChartStylePane();
}
public void showChartStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_AREA_TITLE);
}
}

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

@ -0,0 +1,26 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
public class SetDataLabelStyleAction extends ChartComponentAction{
public SetDataLabelStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "Data-Label"}));
}
@Override
public void actionPerformed(ActionEvent e) {
showDataLabelStylePane();
}
public void showDataLabelStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LABEL_TITLE);
}
}

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

@ -0,0 +1,26 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午5:28
*/
public class SetDataSeriesAttrAction extends ChartComponentAction {
public SetDataSeriesAttrAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "ChartF-Series", "Format"}));
}
public void actionPerformed(ActionEvent e) {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_SERIES_TITLE);
}
}

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

@ -0,0 +1,33 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:49
*/
public class SetDataSheetAction extends ChartComponentAction {
private static final long serialVersionUID = -4763886493273213850L;
public SetDataSheetAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText("Chart_Set_Data_Sheet"));
}
public void actionPerformed(ActionEvent e) {
showDataSheetStylePane();
}
public void showDataSheetStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_DATA_TITLE);
}
}

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

@ -0,0 +1,32 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:56
*/
public class SetLegendStyleAction extends ChartComponentAction {
private static final long serialVersionUID = 3253190503195130478L;
public SetLegendStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText("Set_Legend_Sytle"));
}
public void actionPerformed(ActionEvent e) {
showLegendStylePane();
}
public void showLegendStylePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_LEGNED_TITLE);
}
}

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

@ -0,0 +1,32 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:58
*/
public class SetPlotStyleAction extends ChartComponentAction {
private static final long serialVersionUID = 2894127568015714372L;
public SetPlotStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "ChartF-Plot"}));
}
public void actionPerformed(ActionEvent e) {
showPlotPane();
}
public void showPlotPane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_AREA_TITLE, PaneTitleConstants.CHART_STYLE_AREA_PLOT_TITLE);
}
}

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

@ -0,0 +1,32 @@
package com.fr.design.chart.gui.active.action;
import java.awt.event.ActionEvent;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.mainframe.chart.ChartEditPane;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.Inter;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date : 11-11-22
* Time : 下午4:52
*/
public class SetTitleStyleAction extends ChartComponentAction {
private static final long serialVersionUID = -4763886493273213850L;
public SetTitleStyleAction(ChartComponent chartComponent) {
super(chartComponent);
this.setName(Inter.getLocText(new String[]{"Set", "Title", "Style"}));
}
public void actionPerformed(ActionEvent e) {
showTitlePane();
}
public void showTitlePane() {
ChartEditPane.getInstance().GoToPane(PaneTitleConstants.CHART_STYLE_TITLE, PaneTitleConstants.CHART_STYLE_TITLE_TITLE);
}
}

81
designer_chart/src/com/fr/design/chart/javascript/ChartEmailPane.java

@ -0,0 +1,81 @@
package com.fr.design.chart.javascript;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.javascript.EmailPane;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.general.Inter;
import com.fr.js.EmailJavaScript;
/**
*
* @author jim
*
*/
public class ChartEmailPane extends EmailPane{
private UITextField itemNameTextField;
@Override
protected void initCenterPane(UILabel mainTextLabel, JScrollPane scrollPane, double fill, double preferred) {
double[] columnSize = { preferred, fill};
itemNameTextField = new UITextField();
JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate();
// 是否支持导出控制图表的超链邮件是否显示showTplContent
boolean supportExport = jTemplate.isJWorkBook();
if (supportExport) {
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred, preferred};
showTplContent = new UICheckBox(Inter.getLocText("Email-Can_Preview_Report_Content"));
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
{new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()),
createLinePane(Inter.getLocText("HJS-CC_to"), ccEditor = new UITextField()),
createLinePane(Inter.getLocText("EmailPane-BCC"), bccEditor = new UITextField()),
createLinePane(Inter.getLocText("EmailPane-mailSubject"), titleEditor = new UITextField()),
{mainTextLabel, scrollPane},
{new UILabel(), showTplContent},
{new UILabel(), tipsPane2}},rSizes, columnSize, 6);
} else {
double[] rSizes = { preferred, preferred, preferred, preferred, preferred, preferred, fill, preferred};
centerPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(Inter.getLocText("Name") + ":", SwingConstants.RIGHT), itemNameTextField},
{new UILabel(), tipsPane1},
createLinePane(Inter.getLocText("HJS-Mail_to"), maitoEditor = new UITextField()),
createLinePane(Inter.getLocText("HJS-CC_to"), ccEditor = new UITextField()),
createLinePane(Inter.getLocText("EmailPane-BCC"), bccEditor = new UITextField()),
createLinePane(Inter.getLocText("EmailPane-mailSubject"), titleEditor = new UITextField()),
{mainTextLabel, scrollPane},
{new UILabel(), tipsPane2}},rSizes, columnSize, 8);
}
}
protected void checkEmailConfig(boolean valid) {
super.checkEmailConfig(valid);
if(itemNameTextField != null){
itemNameTextField.setEnabled(valid);
}
}
public void populateBean(EmailJavaScript ob) {
if(itemNameTextField != null){
itemNameTextField.setName(ob == null ? null : ob.getItemName());
}
super.populateBean(ob);
}
public void updateBean(EmailJavaScript email) {
if(itemNameTextField != null){
email.setItemName(itemNameTextField.getText());
}
super.updateBean(email);
}
}

155
designer_chart/src/com/fr/design/chart/report/GisMapDataPane.java

@ -0,0 +1,155 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class GisMapDataPane extends DataContentsPane{
private static final long serialVersionUID = -190573722921978406L;
private UIComboBoxPane<Chart> dataFromPane;// 数据来源的box界面
private GisMapReportDataContentPane reportPane;
private GisMapTableDataContentPane tablePane;
private AttributeChangeListener listener;
public GisMapDataPane(AttributeChangeListener listener) {
super();
this.listener = listener;
}
/**
* 判断准许的情况
* @param ob 传入的对象
* @return 返回是否允许
*/
public boolean accept(Object ob) {
return ob instanceof TopDefinition;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("ChartF-Gis");
}
public void setSupportCellData(boolean surpportCellData) {
dataFromPane.justSupportOneSelect(surpportCellData);
}
@Override
public void populate(ChartCollection collection) {
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
if(definition instanceof GisMapTableDefinition) {
dataFromPane.setSelectedIndex(0);
tablePane.populateBean((GisMapTableDefinition)definition);
}else if(definition instanceof GisMapReportDefinition) {
dataFromPane.setSelectedIndex(1);
reportPane.populateBean((GisMapReportDefinition)definition);
}
this.initAllListeners();
this.addAttributeChangeListener(listener);
}
@Override
public void update(ChartCollection collection) {
if(dataFromPane.getSelectedIndex() == 0){
collection.getSelectedChart().setFilterDefinition(tablePane.updateBean());
}else if(dataFromPane.getSelectedIndex() == 1){
collection.getSelectedChart().setFilterDefinition(reportPane.updateBean());
}
}
@Override
protected JPanel createContentPane() {
return new BasicScrollPane<Chart>() {
@Override
protected JPanel createContentPane() {
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
contentPane.add(dataFromPane = new UIComboBoxPane<Chart>() {
protected void initLayout() {
this.setLayout(new BorderLayout(LayoutConstants.HGAP_LARGE,6));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = { p,f };
double[] rowSize = { p};
Component[][] components = new Component[][]{
new Component[]{new BoldFontTextLabel(Inter.getLocText("ChartF-Data-Resource") + ":"), jcb},
} ;
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
@Override
protected List<FurtherBasicBeanPane<? extends Chart>> initPaneList() {
List list = new ArrayList();
list.add(tablePane = new GisMapTableDataContentPane());// 数据集界面
list.add(reportPane = new GisMapReportDataContentPane());// 单元格界面
return list;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Data_Setting");
}
}, BorderLayout.CENTER);
dataFromPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0));
return contentPane;
}
@Override
public void populateBean(Chart ob) {
// TODO Auto-generated method stub
}
@Override
protected String title4PopupWindow() {
// TODO Auto-generated method stub
return null;
}};
}
}

69
designer_chart/src/com/fr/design/chart/report/GisMapDataPane4Chart.java

@ -0,0 +1,69 @@
package com.fr.design.chart.report;
import com.fr.base.TableData;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.*;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.AbstractChartDataPane4Chart;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class GisMapDataPane4Chart extends AbstractChartDataPane4Chart {
private GisMapTableDataContentPane4Chart tablePane = new GisMapTableDataContentPane4Chart();
public GisMapDataPane4Chart(AttributeChangeListener listener, ChartDataPane parent) {
super(listener, parent);
}
protected JPanel getDataContentPane() {
return tablePane;
}
@Override
public void populate(ChartCollection collection) {
tablePane = new GisMapTableDataContentPane4Chart();
if (collection != null && collection.getSelectedChart() != null) {
Chart chart = collection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition instanceof TableDataDefinition) {
TableData tableData = ((TableDataDefinition) definition).getTableData();
if (tableData != null) {
populateChoosePane(tableData);
fireTableDataChange();
}
}
if (definition instanceof GisMapTableDefinition) {
tablePane.populateBean((GisMapTableDefinition) definition);
}
}
this.remove(leftContentPane);
this.initContentPane();
this.validate();
dataSource.addItemListener(dsListener);
initAllListeners();
initSelfListener(tablePane);
this.addAttributeChangeListener(attributeChangeListener);
}
@Override
public void update(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(tablePane.updateBean());
}
/**
* 数据集数据改变
*/
public void fireTableDataChange() {
tablePane.fireTableDataChange(choosePane.getTableDataWrapper());
}
}

301
designer_chart/src/com/fr/design/chart/report/GisMapReportDataContentPane.java

@ -0,0 +1,301 @@
package com.fr.design.chart.report;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.chart.chartdata.BaseSeriesDefinition;
import com.fr.chart.chartdata.GisMapReportDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
/**
* 属性表gis地图单元格数据源设置界面
*
* @author eason
*/
public class GisMapReportDataContentPane extends FurtherBasicBeanPane<GisMapReportDefinition> implements UIObserver {
private UIButtonGroup<String> addressType;
private UIButtonGroup<String> lnglatOrder;
private TinyFormulaPane addressPane;
private TinyFormulaPane addressNamePane;
private UICorrelationPane seriesPane;
private JPanel orderPane;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
public GisMapReportDataContentPane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
addressType = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-Address"), Inter.getLocText("Chart-LngLat")});
lnglatOrder = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-LngFirst"), Inter.getLocText("Chart-LatFirst")});
addressPane = new TinyFormulaPane();
addressNamePane = new TinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
orderPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM, 0)) {
@Override
public Dimension getPreferredSize() {
if (this.isVisible()) {
return super.getPreferredSize();
} else {
return new Dimension(0, 0);
}
}
};
orderPane.add(new UILabel(Inter.getLocText("Chart-LatLngOrder")), BorderLayout.WEST);
orderPane.add(lnglatOrder, BorderLayout.CENTER);
orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0);
Component[][] components = new Component[][]{
new Component[]{addressType, addressPane},
new Component[]{orderPane, null},
new Component[]{new UILabel(" " +Inter.getLocText("Chart-Address-Name")+":", SwingConstants.RIGHT), addressNamePane},
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(northPane, BorderLayout.NORTH);
String[] columnNames = new String[]{Inter.getLocText(new String[]{"Filed", "Title"}), Inter.getLocText("Area_Value")};
seriesPane = new UICorrelationPane(columnNames) {
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
this.add(seriesPane, BorderLayout.CENTER);
}
/**
* 界面接入.
* @param ob 对象
* @return true表示接受
*/
public boolean accept(Object ob) {
return true;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面弹出标题.
* @return 标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Cell");
}
@Override
public void populateBean(GisMapReportDefinition ob) {
if (ob.getCategoryName() != null) {
if (ob.isAddress()) {
addressType.setSelectedIndex(0);
orderPane.setVisible(false);
} else {
addressType.setSelectedIndex(1);
orderPane.setVisible(true);
}
if (ob.isLngFirst()) {
lnglatOrder.setSelectedIndex(0);
} else {
lnglatOrder.setSelectedIndex(1);
}
addressPane.populateBean(Utils.objectToString(ob.getCategoryName()));
if (ob.getAddressName() != null) {
addressNamePane.populateBean(Utils.objectToString(ob.getAddressName()));
}
int size = ob.getTitleValueSize();
List paneList = new ArrayList();
for (int i = 0; i < size; i++) {
BaseSeriesDefinition first = ob.getTitleValueWithIndex(i);
if (first != null && first.getSeriesName() != null && first.getValue() != null) {
paneList.add(new Object[]{first.getSeriesName(), first.getValue()});
}
}
if (!paneList.isEmpty()) {
seriesPane.populateBean(paneList);
}
}
}
@Override
public GisMapReportDefinition updateBean() {
GisMapReportDefinition reportDefinition = new GisMapReportDefinition();
if (this.addressType.getSelectedIndex() == 0) {
reportDefinition.setAddressType(true);
orderPane.setVisible(false);
} else {
reportDefinition.setAddressType(false);
orderPane.setVisible(true);
}
if (this.lnglatOrder.getSelectedIndex() == 0) {
reportDefinition.setLnglatOrder(true);
} else {
reportDefinition.setLnglatOrder(false);
}
String address = addressPane.updateBean();
if (StringUtils.isBlank(address)) {
return null;
}
if (StableUtils.canBeFormula(address)) {
reportDefinition.setCategoryName(new Formula(address));
} else {
reportDefinition.setCategoryName(address);
}
String addressName = addressNamePane.updateBean();
if (addressName != null && !StringUtils.isBlank(addressName)) {
if (StableUtils.canBeFormula(addressName)) {
reportDefinition.setAddressName(addressName);
} else {
reportDefinition.setAddressName(addressName);
}
}
List values = seriesPane.updateBean();
if (values != null && !values.isEmpty()) {
for (int i = 0, size = values.size(); i < size; i++) {
Object[] objects = (Object[]) values.get(i);
Object name = objects[0];
Object value = objects[1];
if (StableUtils.canBeFormula(value)) {
value = new Formula(Utils.objectToString(value));
}
SeriesDefinition definition = new SeriesDefinition(name, value);
reportDefinition.addTitleValue(definition);
}
}
return reportDefinition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if (editorComponent instanceof TinyFormulaPane) {
return ((TinyFormulaPane) editorComponent).getUITextField().getText();
} else if (editorComponent instanceof UITextField) {
return ((UITextField) editorComponent).getText();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
return getEditorComponent(column, value);
}
private JComponent getEditorComponent(int column, Object value) {
if (column == 0) {
UITextField field = new UITextField();
addListener4UITextFiled(field);
if (value != null) {
field.setText(Utils.objectToString(value));
}
editorComponent = field;
} else {
TinyFormulaPane tinyPane = new TinyFormulaPane() {
@Override
public void okEvent() {
seriesPane.stopCellEditing();
seriesPane.fireTargetChanged();
}
};
tinyPane.setBackground(UIConstants.FLESH_BLUE);
addListener4UITextFiled(tinyPane.getUITextField());
if (value != null) {
tinyPane.getUITextField().setText(Utils.objectToString(value));
}
editorComponent = tinyPane;
}
return editorComponent;
}
private void addListener4UITextFiled(UITextField textField) {
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
// seriesPane.stopCellEditing(); //kunsnat: 不stop是因为可能直接点击公式编辑按钮, 否则需要点击两次才能弹出.
seriesPane.fireTargetChanged();
}
});
}
}
}

350
designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane.java

@ -0,0 +1,350 @@
package com.fr.design.chart.report;
import com.fr.base.Utils;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.LayoutConstants;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
/**
* 属性表gis地图数据集数据源定义面板
* @author eason
*
*/
public class GisMapTableDataContentPane extends FurtherBasicBeanPane<GisMapTableDefinition> implements UIObserver {
private DatabaseTableDataPane fromTableData;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private String[] initNames = {""};
private UIButtonGroup<String> addressType;
private UIButtonGroup<String> lnglatOrder;
private UIComboBox addressBox;
private UIComboBox addressNameBox;
private UICorrelationPane titleValuePane;
private JPanel orderPane;
public GisMapTableDataContentPane() {
this.setLayout(new BorderLayout());
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
UILabel label = new UILabel(Inter.getLocText("Chart-Select_Data_Set") + ":", SwingConstants.LEFT);
northPane.add(fromTableData = new DatabaseTableDataPane(label) {
@Override
protected void userEvent() {
refresh2ComboBox();
}
});
fromTableData.setPreferredSize(new Dimension(218, 20));
northPane.add(fromTableData);
addressType = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-Gis_Address"), Inter.getLocText("Chart-Gis_LatLng")});
lnglatOrder = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-Lng_First"),Inter.getLocText("Chart-Lat_First")});
addressBox = new UIComboBox();
addressNameBox = new UIComboBox();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
orderPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM,0)){
@Override
public Dimension getPreferredSize() {
if(this.isVisible()){
return super.getPreferredSize();
}else{
return new Dimension(0,0);
}
}
};
orderPane.add(new UILabel(Inter.getLocText("Chart-LatLng_Order")), BorderLayout.WEST);
orderPane.add(lnglatOrder, BorderLayout.CENTER);
orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0);
addressNameBox.removeAllItems();
addressNameBox.addItem(Inter.getLocText("Chart-Use_None"));
Component[][] components = new Component[][]{
new Component[]{addressType, addressBox},
new Component[]{orderPane,null},
new Component[]{new UILabel(Inter.getLocText("Chart-Address_Name") + ":", SwingConstants.RIGHT), addressNameBox},
};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel pane = new JPanel();
this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(centerPane, BorderLayout.NORTH);
String[] titles = {Inter.getLocText("Chart-Area_Title"), Inter.getLocText("Chart-Area_Value")};
titleValuePane = new UICorrelationPane(titles){
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
pane.add(titleValuePane, BorderLayout.CENTER);
}
private void refresh2ComboBox() {// 刷新地址 地址名 名称列表
TableDataWrapper tableDataWrappe = fromTableData.getTableDataWrapper();
if (tableDataWrappe == null) {
return;
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
initNames = columnNameList.toArray(new String[columnNameList.size()]);
addressBox.removeAllItems();
addressNameBox.removeAllItems();
addressNameBox.addItem(Inter.getLocText("Chart-Use_None"));
for(int i = 0, size = initNames.length; i < size; i++) {
addressBox.addItem(initNames[i]);
addressNameBox.addItem(initNames[i]);
}
addressBox.getModel().setSelectedItem(null);
addressNameBox.getModel().setSelectedItem(null);
stopEditing();
}
/**
* 界面接入
* @param ob 对象
* @return true表示接受
*/
public boolean accept(Object ob) {
return false;
}
/**
* 界面重置
*/
public void reset() {
}
/**
* 界面弹出标题
* @return 标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-DS_TableData");
}
private void stopEditing() {
}
@Override
public void populateBean(GisMapTableDefinition ob) {
stopEditing();
if (ob instanceof GisMapTableDefinition) {
GisMapTableDefinition mapDefinition = (GisMapTableDefinition) ob;
fromTableData.populateBean(((NameTableData) mapDefinition.getTableData()));
if(ob.isAddress()){
addressType.setSelectedIndex(0);
orderPane.setVisible(false);
}else{
addressType.setSelectedIndex(1);
orderPane.setVisible(true);
}
if(ob.isLngFirst()){
lnglatOrder.setSelectedIndex(0);
}else{
lnglatOrder.setSelectedIndex(1);
}
addressBox.setSelectedItem(mapDefinition.getAddress());
if(StringUtils.isEmpty(mapDefinition.getAddressName())) {
addressNameBox.setSelectedItem(Inter.getLocText("Chart-Use_None"));
} else {
addressNameBox.setSelectedItem(mapDefinition.getAddressName());
}
List paneList = new ArrayList();
int titleValueSize = mapDefinition.getTittleValueSize();
for(int i = 0; i < titleValueSize; i++) {
SeriesDefinition definition = mapDefinition.getTittleValueWithIndex(i);
if(definition != null && definition.getSeriesName() != null && definition.getValue() != null) {
paneList.add(new Object[]{definition.getSeriesName(), definition.getValue()});
}
}
if(!paneList.isEmpty()) {
titleValuePane.populateBean(paneList);
}
}
}
@Override
public GisMapTableDefinition updateBean() {// 从一行内容中update
stopEditing();
GisMapTableDefinition definition = new GisMapTableDefinition();
TableDataWrapper tableDataWrappe = fromTableData.getTableDataWrapper();
if (tableDataWrappe == null || addressBox.getSelectedItem() == null) {
return null;
}
definition.setTableData(new NameTableData(tableDataWrappe.getTableDataName()));
definition.setAddress(Utils.objectToString(addressBox.getSelectedItem()));
if(this.addressType.getSelectedIndex() == 0){
definition.setAddressType(true);
lnglatOrder.setVisible(false);
}else{
definition.setAddressType(false);
lnglatOrder.setVisible(true);
}
if(this.lnglatOrder.getSelectedIndex() == 0){
definition.setLnglatOrder(true);
}else{
definition.setLnglatOrder(false);
}
if(addressNameBox.getSelectedItem() != null){
String adName = Utils.objectToString(addressNameBox.getSelectedItem());
if(ArrayUtils.contains(ChartConstants.NONE_KEYS, adName)) {
definition.setAddressName(StringUtils.EMPTY);
} else {
definition.setAddressName(adName);
}
}
List paneList = titleValuePane.updateBean();
for(int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[])paneList.get(i);
if(values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTittleValue(seriesDefinition);
}
}
return definition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof UITextField) {
UITextField textField = (UITextField)editorComponent;
return textField.getText();
} else if(editorComponent instanceof UIComboBox) {
UIComboBox boxPane = (UIComboBox)editorComponent;
return boxPane.getSelectedItem();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
if(column == 0 ) {
UITextField text = new UITextField();
if(value != null) {
text.setText(Utils.objectToString(value));
}
text.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
titleValuePane.stopCellEditing();
titleValuePane.fireTargetChanged();
}
});
this.editorComponent = text;
} else {
UIComboBox box = new UIComboBox(initNames);
box.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
titleValuePane.fireTargetChanged();
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
this.editorComponent = box;
}
return this.editorComponent;
}
}
}

341
designer_chart/src/com/fr/design/chart/report/GisMapTableDataContentPane4Chart.java

@ -0,0 +1,341 @@
package com.fr.design.chart.report;
import com.fr.base.Utils;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartdata.GisMapTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class GisMapTableDataContentPane4Chart extends FurtherBasicBeanPane<GisMapTableDefinition> implements UIObserver {
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private String[] initNames = {""};
private UIButtonGroup<String> addressType;
private UIButtonGroup<String> lnglatOrder;
private UIComboBox addressBox;
private UIComboBox addressNameBox;
private UICorrelationPane titleValuePane;
private JPanel orderPane;
private TableDataWrapper tableDataWrapper;
public GisMapTableDataContentPane4Chart() {
this.setLayout(new BorderLayout());
addressType = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-Gis_Address"), Inter.getLocText("Chart-Gis_LatLng")});
lnglatOrder = new UIButtonGroup<String>(new String[]{Inter.getLocText("Chart-Lng_First"), Inter.getLocText("Chart-Lat_First")});
addressBox = new UIComboBox();
addressNameBox = new UIComboBox();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = new double[]{p, f};
double[] rowSize = new double[]{p, p, p};
orderPane = new JPanel(new BorderLayout(LayoutConstants.VGAP_MEDIUM, 0)) {
@Override
public Dimension getPreferredSize() {
if (this.isVisible()) {
return super.getPreferredSize();
} else {
return new Dimension(0, 0);
}
}
};
orderPane.add(new UILabel(Inter.getLocText("Chart-LatLng_Order")), BorderLayout.WEST);
orderPane.add(lnglatOrder, BorderLayout.CENTER);
orderPane.setVisible(false);
lnglatOrder.setSelectedIndex(0);
addressType.setSelectedIndex(0);
addressNameBox.removeAllItems();
addressNameBox.addItem(Inter.getLocText("Chart-Use_None"));
Component[][] components = new Component[][]{
new Component[]{addressType, addressBox},
new Component[]{orderPane, null},
new Component[]{new UILabel(Inter.getLocText("Chart-Address_Name") + ":", SwingConstants.RIGHT), addressNameBox},
};
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel pane = new JPanel();
this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(centerPane, BorderLayout.NORTH);
String[] titles = {Inter.getLocText("Chart-Area_Title"), Inter.getLocText("Chart-Area_Value")};
titleValuePane = new UICorrelationPane(titles) {
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
pane.add(titleValuePane, BorderLayout.CENTER);
}
private void refresh2ComboBox() {// 刷新地址 地址名 名称列表
TableDataWrapper tableDataWrappe =tableDataWrapper;
if (tableDataWrappe == null) {
return;
}
java.util.List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
initNames = columnNameList.toArray(new String[columnNameList.size()]);
addressBox.removeAllItems();
addressNameBox.removeAllItems();
addressNameBox.addItem(Inter.getLocText("Chart-Use_None"));
for (int i = 0, size = initNames.length; i < size; i++) {
addressBox.addItem(initNames[i]);
addressNameBox.addItem(initNames[i]);
}
if(initNames.length > 0){
addressBox.setSelectedIndex(0);
}
addressNameBox.setSelectedIndex(0);
stopEditing();
}
/**
* 界面接入
*
* @param ob 对象
* @return true表示接受
*/
public boolean accept(Object ob) {
return false;
}
/**
* 界面重置
*/
public void reset() {
}
/**
* 界面弹出标题
*
* @return 标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Chart-DS_TableData");
}
private void stopEditing() {
}
@Override
public void populateBean(GisMapTableDefinition ob) {
stopEditing();
if (ob instanceof GisMapTableDefinition) {
GisMapTableDefinition mapDefinition = (GisMapTableDefinition) ob;
if (ob.isAddress()) {
addressType.setSelectedIndex(0);
orderPane.setVisible(false);
} else {
addressType.setSelectedIndex(1);
orderPane.setVisible(true);
}
if (ob.isLngFirst()) {
lnglatOrder.setSelectedIndex(0);
} else {
lnglatOrder.setSelectedIndex(1);
}
addressBox.setSelectedItem(mapDefinition.getAddress());
if (StringUtils.isEmpty(mapDefinition.getAddressName())) {
addressNameBox.setSelectedItem(Inter.getLocText("Chart-Use_None"));
} else {
addressNameBox.setSelectedItem(mapDefinition.getAddressName());
}
java.util.List paneList = new ArrayList();
int titleValueSize = mapDefinition.getTittleValueSize();
for (int i = 0; i < titleValueSize; i++) {
SeriesDefinition definition = mapDefinition.getTittleValueWithIndex(i);
if (definition != null && definition.getSeriesName() != null && definition.getValue() != null) {
paneList.add(new Object[]{definition.getSeriesName(), definition.getValue()});
}
}
if (!paneList.isEmpty()) {
titleValuePane.populateBean(paneList);
}
}
}
@Override
public GisMapTableDefinition updateBean() {// 从一行内容中update
stopEditing();
GisMapTableDefinition definition = new GisMapTableDefinition();
TableDataWrapper tableDataWrappe = tableDataWrapper;
if (tableDataWrappe == null || addressBox.getSelectedItem() == null) {
return null;
}
definition.setTableData(tableDataWrapper.getTableData());
definition.setAddress(Utils.objectToString(addressBox.getSelectedItem()));
if (this.addressType.getSelectedIndex() == 0) {
definition.setAddressType(true);
lnglatOrder.setVisible(false);
} else {
definition.setAddressType(false);
lnglatOrder.setVisible(true);
}
if (this.lnglatOrder.getSelectedIndex() == 0) {
definition.setLnglatOrder(true);
} else {
definition.setLnglatOrder(false);
}
if (addressNameBox.getSelectedItem() != null) {
String adName = Utils.objectToString(addressNameBox.getSelectedItem());
if (ArrayUtils.contains(ChartConstants.NONE_KEYS, adName)) {
definition.setAddressName(StringUtils.EMPTY);
} else {
definition.setAddressName(adName);
}
}
java.util.List paneList = titleValuePane.updateBean();
for (int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[]) paneList.get(i);
if (values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTittleValue(seriesDefinition);
}
}
return definition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if (editorComponent instanceof UITextField) {
UITextField textField = (UITextField) editorComponent;
return textField.getText();
} else if (editorComponent instanceof UIComboBox) {
UIComboBox boxPane = (UIComboBox) editorComponent;
return boxPane.getSelectedItem();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
if (column == 0) {
UITextField text = new UITextField();
if (value != null) {
text.setText(Utils.objectToString(value));
}
text.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
titleValuePane.stopCellEditing();
titleValuePane.fireTargetChanged();
}
});
this.editorComponent = text;
} else {
UIComboBox box = new UIComboBox(initNames);
box.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
titleValuePane.fireTargetChanged();
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
this.editorComponent = box;
}
return this.editorComponent;
}
}
/**
* 出发数据集改变
* @param wrapper 数据集
*/
public void fireTableDataChange(TableDataWrapper wrapper){
this.tableDataWrapper = wrapper;
refresh2ComboBox();
}
}

76
designer_chart/src/com/fr/design/chart/report/MapCubeDataPane.java

@ -0,0 +1,76 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartdata.MapMoreLayerReportDefinition;
import com.fr.chart.chartdata.MapMoreLayerTableDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* 钻取数据
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-21 下午11:02:02
*/
public class MapCubeDataPane extends UIComboBoxPane<TopDefinitionProvider> {
private MapReportCubeDataPane reportPane;
private MapTableCubeDataPane tablePane;
protected void initLayout() {
this.setLayout(new BorderLayout(0, 0));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
northPane.add(new BoldFontTextLabel(Inter.getLocText("ChartF-Data-Resource") + ":"));
northPane.add(jcb);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
@Override
protected List<FurtherBasicBeanPane<? extends TopDefinitionProvider>> initPaneList() {
List list = new ArrayList();
list.add(tablePane = new MapTableCubeDataPane());
list.add(reportPane = new MapReportCubeDataPane());
return list;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("LayerData");
}
/**
* 对数据集或者单元格数据加载界面
*/
public void populateBean(TopDefinitionProvider definition) {
if(definition instanceof MapMoreLayerReportDefinition) {
this.setSelectedIndex(1);
MapMoreLayerReportDefinition reportDefinition = (MapMoreLayerReportDefinition)definition;
reportPane.populateBean(reportDefinition);
} else if(definition instanceof MapMoreLayerTableDefinition) {
MapMoreLayerTableDefinition tableDefinition = (MapMoreLayerTableDefinition)definition;
this.setSelectedIndex(0);
tablePane.populateBean(tableDefinition);
}
}
/**
* 根据界面 下载保存数据
*/
public TopDefinitionProvider update() {
if(this.getSelectedIndex() == 0) {
return tablePane.updateBean();
} else {
return reportPane.updateBean();
}
}
}

68
designer_chart/src/com/fr/design/chart/report/MapCubeDataPane4Chart.java

@ -0,0 +1,68 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartdata.MapMoreLayerTableDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.general.Inter;
import java.awt.*;
import java.util.*;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class MapCubeDataPane4Chart extends UIComboBoxPane<TopDefinitionProvider> {
private MapTableCubeDataPane4Chart tablePane;
protected void initLayout() {
this.setLayout(new BorderLayout(0, 0));
this.add(cardPane, BorderLayout.CENTER);
}
@Override
protected List<FurtherBasicBeanPane<? extends TopDefinitionProvider>> initPaneList() {
List list = new ArrayList();
list.add(tablePane = new MapTableCubeDataPane4Chart());
return list;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Map_LayerData");
}
/**
* 对数据集或者单元格数据加载界面
*/
public void populateBean(TopDefinitionProvider definition) {
if(definition instanceof MapMoreLayerTableDefinition) {
MapMoreLayerTableDefinition tableDefinition = (MapMoreLayerTableDefinition)definition;
this.setSelectedIndex(0);
tablePane.populateBean(tableDefinition);
}
}
/**
* 根据界面 下载保存数据
*/
public TopDefinitionProvider update() {
return tablePane.updateBean();
}
/**
* 出发数据集改变
* @param tableDataWrapper 数据集
*/
public void fireTableDataChanged(TableDataWrapper tableDataWrapper) {
tablePane.setTableDataWrapper(tableDataWrapper);
tablePane.refreshAreaNameBox();
}
}

309
designer_chart/src/com/fr/design/chart/report/MapCubeLayerPane.java

@ -0,0 +1,309 @@
package com.fr.design.chart.report;
import com.fr.base.MapXMLHelper;
import com.fr.base.Utils;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.chart.chartglyph.MapAttr;
import com.fr.design.DesignerEnvManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.*;
import java.util.List;
/**
* 地图钻取层级界面, 默认钻取到同名的地图
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-11-20 下午03:39:08
*/
public class MapCubeLayerPane extends BasicBeanPane<String>{
private JTree mapTree;
private DefaultMutableTreeNode root;
private String editingMap = "";
private Set<String> editedMap = new HashSet<String>();
private List<ChangeListener> fireWhenTreeChange = new ArrayList<ChangeListener>();
private List<String> hasDealNames = new ArrayList<String>();
private boolean isSvg = true;
public MapCubeLayerPane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout());
root = new DefaultMutableTreeNode();
mapTree = new JTree(root);
mapTree.setRootVisible(false);
mapTree.addMouseListener(mapListener);
JScrollPane treePane = new JScrollPane(mapTree);
treePane.setPreferredSize(new Dimension(100, 100));
this.add(treePane, BorderLayout.CENTER);
}
public void setSvg(boolean isSvg) {
this.isSvg = isSvg;
}
/**
* 返回节点路径
*/
public int getTreeDepth() {
return root.getDepth();
}
/**
* 初始化节点界面.
* @param mapName 地图名称.
*/
public void initRootTree(String mapName) {
editingMap = mapName;
root.removeAllChildren();
DefaultMutableTreeNode node = new DefaultMutableTreeNode(mapName);
root.add(node);
// 每个节点都要去判断是否有地图再包含 默认钻取到同名的地图
if(isSvg) {
MapSvgAttr mapAttr = MapSvgXMLHelper.getInstance().getMapAttr(mapName);
hasDealNames.clear();
add4Node(mapAttr, node, mapName);
} else {
MapAttr mapAttr = (MapAttr)MapXMLHelper.getInstance().getMapAttr(mapName);
hasDealNames.clear();
addBitMap4Node(mapAttr, node, mapName);
}
mapTree.doLayout();
mapTree.validate();
((DefaultTreeModel)mapTree.getModel()).reload();
for(int i = 0; i < fireWhenTreeChange.size(); i++) {
fireWhenTreeChange.get(i).stateChanged(new ChangeEvent(this));
}
}
/**
* 添加响应事件.
* @param change 改变的事件.
*/
public void addChangeListener(ChangeListener change) {
fireWhenTreeChange.add(change);
}
private void addBitMap4Node(MapAttr editingMapAttr, DefaultMutableTreeNode node, String mapName) {
MapAttr mapAttr = (MapAttr)MapXMLHelper.getInstance().getMapAttr(mapName);
if(mapAttr != null) {
Iterator namesValue = mapAttr.shapeValuesIterator();
while(namesValue.hasNext()) {
Object names = namesValue.next();
String nextToName = Utils.objectToString(editingMapAttr.getLayerTo(Utils.objectToString(names)));
MapAttr tmpAttr = (MapAttr)MapXMLHelper.getInstance().getMapAttr(nextToName);
if(tmpAttr != null) {
DefaultMutableTreeNode currentName = new DefaultMutableTreeNode(names);
node.add(currentName);// 有钻取内容的地图才添加节点
if(!hasDealNames.contains(Utils.objectToString(currentName.getUserObject()))) {
hasDealNames.add(Utils.objectToString(currentName.getUserObject()));
addBitMap4Node(editingMapAttr, currentName, nextToName);
}
}
}
}
}
private void add4Node(MapSvgAttr editingMapAttr, DefaultMutableTreeNode node, String mapName) {
MapSvgAttr mapAttr = MapSvgXMLHelper.getInstance().getMapAttr(mapName);
if(mapAttr != null) {
Iterator namesValue = mapAttr.shapeValuesIterator();
while(namesValue.hasNext()) {
Object names = namesValue.next();
String nextToName = Utils.objectToString(editingMapAttr.getLayerTo(Utils.objectToString(names)));
MapSvgAttr tmpAttr = MapSvgXMLHelper.getInstance().getMapAttr(nextToName);
if(tmpAttr != null) {
DefaultMutableTreeNode currentName = new DefaultMutableTreeNode(names);
node.add(currentName);// 有钻取内容的地图才添加节点
if(!hasDealNames.contains(Utils.objectToString(currentName.getUserObject()))) {
hasDealNames.add(Utils.objectToString(currentName.getUserObject()));
add4Node(editingMapAttr, currentName, nextToName);
}
}
}
}
}
MouseListener mapListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
final TreePath visiblePath = mapTree.getSelectionPath(); // 取得当前选中的节点 selectTreeName
if(visiblePath == null) {
return;
}
final String selectTreeName = Utils.objectToString(((DefaultMutableTreeNode)visiblePath.getLastPathComponent()).getUserObject());
if(SwingUtilities.isRightMouseButton(e)) {
if(!isSvg){
popBitMapDialog(e, selectTreeName);
return;
}
final MapSvgAttr editingAttr = MapSvgXMLHelper.getInstance().getMapAttr(editingMap);
editedMap.add(editingMap);
final MapCubeSetDataPane setDataPane = new MapCubeSetDataPane();
setDataPane.freshComboxNames();
MapSvgAttr mapAttr = MapSvgXMLHelper.getInstance().getMapAttr(selectTreeName);
editedMap.add(selectTreeName);
if(mapAttr != null) {// 从中取出对应关系 // 取出当前节点名称所对应的地图
List list = new ArrayList();
Iterator names = mapAttr.shapeValuesIterator();//行: 地图区域名(String) + 对应地图名(String)
while(names.hasNext()) {
Object name = names.next();
String layName = editingAttr.getLayerTo(Utils.objectToString(name));
if(ArrayUtils.contains(ChartConstants.NONE_KEYS, layName)) {// kunsnat: 考虑切换设计器语言.
layName = StringUtils.EMPTY;
}
list.add(new Object[]{name, layName});
}
setDataPane.populateBean(list);
}
int x = (int)(mapTree.getLocationOnScreen().getX() + mapTree.getWidth());
int y = (int)e.getLocationOnScreen().getY();
UIDialog dialog = setDataPane.showUnsizedWindow(SwingUtilities.getWindowAncestor(setDataPane), new DialogActionAdapter() {
public void doOk() {
List list = setDataPane.updateBean(); // 更新当前的 地图名所对应的 区域名钻取关系 重新inittree
for(int i = 0; i < list.size(); i++) {
Object[] values = (Object[])list.get(i);
editingAttr.putLayerTo(Utils.objectToString(values[0]), Utils.objectToString(values[1]));
}
initRootTree(editingMap);
saveMapInfo();
}
});
dialog.setSize(300, 300);
GUICoreUtils.centerWindow(dialog);
dialog.setVisible(true);
}
}
};
private void popBitMapDialog(MouseEvent e, final String selectTreeName) {
final MapAttr editingAttr = (MapAttr)MapXMLHelper.getInstance().getMapAttr(editingMap);
editedMap.add(editingMap);
final MapCubeSetDataPane setDataPane = new MapCubeSetDataPane();
setDataPane.freshBitMapComboxNames();
MapAttr mapAttr = (MapAttr)MapXMLHelper.getInstance().getMapAttr(selectTreeName);
if(mapAttr != null) {// 从中取出对应关系 // 取出当前节点名称所对应的地图
List list = new ArrayList();
Iterator names = mapAttr.shapeValuesIterator();//行: 地图区域名(String) + 对应地图名(String)
while(names.hasNext()) {
Object name = names.next();
String layName = editingAttr.getLayerTo(Utils.objectToString(name));
if(ArrayUtils.contains(ChartConstants.NONE_KEYS, layName)) {// kunsnat: 考虑切换设计器语言.
layName = StringUtils.EMPTY;
}
list.add(new Object[]{name, layName});
}
setDataPane.populateBean(list);
}
int x = (int)(mapTree.getLocationOnScreen().getX() + mapTree.getWidth());
int y = (int)e.getLocationOnScreen().getY();
UIDialog dialog = setDataPane.showUnsizedWindow(SwingUtilities.getWindowAncestor(setDataPane), new DialogActionAdapter() {
public void doOk() {
List list = setDataPane.updateBean(); // 更新当前的 地图名所对应的 区域名钻取关系 重新inittree
for(int i = 0; i < list.size(); i++) {
Object[] values = (Object[])list.get(i);
editingAttr.putLayerTo(values[0], values[1]);
}
initRootTree(editingMap);
saveMapInfo();
}
});
dialog.setSize(300, 300);
GUICoreUtils.centerWindow(dialog);
dialog.setVisible(true);
}
private void saveMapInfo() {
final String[] mapNames = editedMap.toArray(new String[0]);
if(isSvg){
editedMap.clear();
}
SwingWorker worker = new SwingWorker<Integer, Void>() {
@Override
protected Integer doInBackground() throws Exception {
if(isSvg){
MapSvgXMLHelper.getInstance().saveEditedMaps(mapNames);
} else {
MapXMLHelper.getInstance().writerMapSourceWhenEditMap();
}
return 0;
}
@Override
protected void done() {
FRLogger.getLogger().info("Map Save End");
}
};
worker.execute();
DesignerEnvManager.addWorkers(worker);
}
@Override
public void populateBean(String rootMapName) {// 更节点的地图名称 只有根节点是确定的
// 从数据库中取出地图名称 和 层级关系 刷新列表
initRootTree(rootMapName);
}
public void updateBean(String rootMapName) {// HashMap --> 对应层级的 地图名称
// 刷新列表, 更新数据库中的地图名称
}
@Override
public String updateBean() {
return "";
}
/**
* 返回界面标题.
*/
protected String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Map_Drill");
}
}

130
designer_chart/src/com/fr/design/chart/report/MapCubeSetDataPane.java

@ -0,0 +1,130 @@
package com.fr.design.chart.report;
import com.fr.base.MapXMLHelper;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.xcombox.ComboBoxUseEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import java.awt.*;
import java.util.List;
/**
* 地图, 下层钻取设置
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-19 下午03:19:53
*/
public class MapCubeSetDataPane extends BasicBeanPane<List>{
private UITableEditorPane tableEditorPane;// 地图名称 + 地图类型列表
private String[] initNames = new String[]{""};
public MapCubeSetDataPane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
UIArrayTableModel model = new UIArrayTableModel(new String[]{Inter.getLocText("FR-Chart-Area_Name"), Inter.getLocText("FR-Chart-Drill_Map")}, new int[] {}) {
public boolean isCellEditable(int row, int col) {
return col != 0;
}
};
model.setDefaultEditor(Object.class, new DefaultComboBoxEditor());
model.setDefaultRenderer(Object.class, new DefaultComboBoxRenderer());
tableEditorPane = new UITableEditorPane<Object[]>(model);
this.add(tableEditorPane);
model.addRow(new Object[]{"", ""});
}
/**
* 刷新下拉列表
*/
public void freshComboxNames() {
initNames = MapSvgXMLHelper.getInstance().mapAllNames();
}
/**
* 位图地图刷新下拉列表
*/
public void freshBitMapComboxNames() {
initNames = MapXMLHelper.getInstance().mapAllNames();
}
// 需要得到地图 所有区域名称. 以及对应好的名字.
@Override
public void populateBean(List ob) {
tableEditorPane.populate(ob.toArray());
}
@Override
public List updateBean() {
return tableEditorPane.update();
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Drill_Setting");
}
/**
* refresh TODO 只是需要随时更新initNames
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-11-20 下午05:12:20
*/
private class DefaultComboBoxEditor extends AbstractCellEditor implements TableCellEditor {
private static final long serialVersionUID = -3239789564820528730L;
private ValueEditorPane cellEditor;
public DefaultComboBoxEditor() {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if(column == 0) {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new TextEditor()});
} else {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
public Object getCellEditorValue() {
return cellEditor.update();
}
}
private class DefaultComboBoxRenderer extends DefaultTableCellRenderer {
private static final long serialVersionUID = -695450455731718014L;
private ValueEditorPane cellEditor;
public DefaultComboBoxRenderer() {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if(column == 0) {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new TextEditor()});
} else {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
}
}

139
designer_chart/src/com/fr/design/chart/report/MapDataPane.java

@ -0,0 +1,139 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.MapMoreLayerReportDefinition;
import com.fr.chart.chartdata.MapMoreLayerTableDefinition;
import com.fr.chart.chartdata.MapSingleLayerReportDefinition;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.data.DataContentsPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* 选择地图类型后 使用的地图数据界面
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-21 下午10:49:13
*/
public class MapDataPane extends DataContentsPane {
private UIComboBoxPane<Chart> mainPane;
private MapMoreCubeLayerPane morePane;
private MapSinglePane singlePane;
private AttributeChangeListener listener;
public MapDataPane(AttributeChangeListener listener) {
super();
this.listener = listener;
}
/**
* 加载界面, 更新地图数据
*/
public void populate(ChartCollection collection) {
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
morePane.init4PopuMapTree(collection);
if(definition instanceof MapSingleLayerTableDefinition) {
mainPane.setSelectedIndex(0);
singlePane.populateBean(definition);
}
else if(definition instanceof MapMoreLayerTableDefinition) {
mainPane.setSelectedIndex(1);
morePane.populateBean(collection);
} else if(definition instanceof MapMoreLayerReportDefinition) {
mainPane.setSelectedIndex(1);
morePane.populateBean(collection);
} else if(definition instanceof MapSingleLayerReportDefinition) {
mainPane.setSelectedIndex(0);
singlePane.populateBean(definition);
}
this.initAllListeners();
this.addAttributeChangeListener(listener);
}
/**
* 下载保存数据
*/
public void update(ChartCollection collection) {
if(mainPane.getSelectedIndex() == 0) {
collection.getSelectedChart().setFilterDefinition(singlePane.updateBean());
} else {
morePane.updateBean(collection);
}
}
@Override
protected JPanel createContentPane() {
BasicScrollPane<Chart> scroll = new BasicScrollPane<Chart>() {
protected JPanel createContentPane() {
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
mainPane = new UIComboBoxPane<Chart>() {
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
northPane.add(new BoldFontTextLabel(Inter.getLocText("Map Show Type") + ":"));
northPane.add(jcb);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
protected List<FurtherBasicBeanPane<? extends Chart>> initPaneList() {
List list = new ArrayList();
list.add(singlePane = new MapSinglePane());
list.add(morePane = new MapMoreCubeLayerPane());
return list;
}
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Chart-Map", "Data"});
}
};
pane.add(mainPane, BorderLayout.CENTER);
return pane;
}
public void populateBean(Chart ob) {
}
protected String title4PopupWindow() {
return null;
}
};
return scroll;
}
/**
* 返回界面使用图标路径
*/
public String getIconPath() {
return "com/fr/design/images/chart/ChartData.png";
}
/**
* 返回界面标题
* @return 标题
*/
public String title4PopupWindow() {
return Inter.getLocText(new String[]{"Chart-Map", "Data"});
}
@Override
public void setSupportCellData(boolean surpportCellData) {
morePane.setSurpportCellData(surpportCellData);
singlePane.setSurpportCellData(surpportCellData);
}
}

133
designer_chart/src/com/fr/design/chart/report/MapDataPane4Chart.java

@ -0,0 +1,133 @@
package com.fr.design.chart.report;
import com.fr.base.TableData;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.*;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.AbstractChartDataPane4Chart;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
* Date: 14/12/3
* Time: 下午6:49
*/
public class MapDataPane4Chart extends AbstractChartDataPane4Chart {
private UIComboBoxPane dataContentPane;
private MapMoreCubeLayerPane4Chart morePane = new MapMoreCubeLayerPane4Chart();
private MapSinglePane4Chart singlePane = new MapSinglePane4Chart();
private ChartCollection currentCollection;
private ItemListener itemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
fireTableDataChange();
}
};
public MapDataPane4Chart(AttributeChangeListener listener, ChartDataPane parent) {
super(listener, parent);
dataContentPane = new UIComboBoxPane<Chart>() {
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
northPane.add(new BoldFontTextLabel(Inter.getLocText("FR-Chart-Map_ShowWay") + ":"));
northPane.add(jcb);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
protected java.util.List<FurtherBasicBeanPane<? extends Chart>> initPaneList() {
java.util.List list = new ArrayList();
list.add(singlePane);
list.add(morePane);
return list;
}
protected void comboBoxItemStateChanged() {
if(currentCollection == null){
return;
}
fireTableDataChange();
morePane.init4PopuMapTree(currentCollection);
}
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Chart-Map", "Data"});
}
};
}
protected JPanel getDataContentPane(){
return dataContentPane;
}
@Override
public void populate(ChartCollection collection) {
currentCollection = collection;
morePane.init4PopuMapTree(collection);
if (collection != null && collection.getSelectedChart() != null) {
Chart chart = collection.getSelectedChart();
TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition instanceof TableDataDefinition) {
TableData tableData = ((TableDataDefinition) definition).getTableData();
if(tableData != null){
populateChoosePane(tableData);
fireTableDataChange();
}
}
if(definition instanceof MapSingleLayerTableDefinition) {
singlePane.populateBean(definition);
} else if(definition instanceof MapMoreLayerTableDefinition) {
morePane.populateBean(collection);
}
}
this.remove(leftContentPane);
this.initContentPane();
this.validate();
dataSource.addItemListener(dsListener);
initAllListeners();
initSelfListener(dataContentPane);
this.addAttributeChangeListener(attributeChangeListener);
}
@Override
public void update(ChartCollection collection) {
if(dataContentPane.getSelectedIndex() == 0) {
collection.getSelectedChart().setFilterDefinition(singlePane.updateBean());
} else {
morePane.updateBean(collection);
}
currentCollection = collection;
}
/**
* 数据集数据改变
*/
public void fireTableDataChange() {
if (dataContentPane == null) {
return;
}
if(dataContentPane.getSelectedIndex() == 0) {
singlePane.fireTableDataChanged(choosePane.getTableDataWrapper());
} else {
morePane.fireTableDataChanged(choosePane.getTableDataWrapper());
}
}
}

106
designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane.java

@ -0,0 +1,106 @@
package com.fr.design.chart.report;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.MapPlot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.general.Inter;
import java.util.ArrayList;
import java.util.List;
/**
* 地图多层钻取界面, 就是一个多层Tab切换界面
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-22 上午10:23:37
*/
public class MapMoreCubeLayerPane extends MultiTabPane<ChartCollection>{
private static final long serialVersionUID = -174286187746442527L;
private MapCubeLayerPane layerPane;
private MapCubeDataPane dataPane;
@Override
protected List<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
paneList.add(layerPane = new MapCubeLayerPane());
paneList.add(dataPane = new MapCubeDataPane());
return paneList;
}
public ChartCollection updateBean() {
return null;// do nothing
}
public void populateBean(ChartCollection collection) {
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
layerPane.setSvg(map.isSvgMap());
layerPane.populateBean(map.getMapName());
}
// 确认层级关系
dataPane.populateBean(collection.getSelectedChart().getFilterDefinition());
}
public void updateBean(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(dataPane.update());
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
layerPane.updateBean(map.getMapName());// 确定更新地图名称所对应的层级关系
}
}
/**
* 刷新层级树 数据中populate 数据的层数
* @param collection 图表收集器.
*/
public void init4PopuMapTree(ChartCollection collection) {
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
if(layerPane != null) {
layerPane.setSvg(map.isSvgMap());
layerPane.initRootTree(map.getMapName());
}
}
}
/**
* 判断是否合格
* @param ob 参数判断
* @return 默认合格.
*/
public boolean accept(Object ob) {
return true;
}
/**
* 界面标题
* @return 返回标题
*/
public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Muiti_In");
}
/**
* 重置
*/
public void reset() {
}
/**
* 设置是否支持单元格数据.
*/
public void setSurpportCellData(boolean surpportCellData) {
dataPane.justSupportOneSelect(surpportCellData);
}
}

113
designer_chart/src/com/fr/design/chart/report/MapMoreCubeLayerPane4Chart.java

@ -0,0 +1,113 @@
package com.fr.design.chart.report;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.MapPlot;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane;
import com.fr.general.Inter;
import java.util.ArrayList;
import java.util.List;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class MapMoreCubeLayerPane4Chart extends MultiTabPane<ChartCollection> {
private static final long serialVersionUID = -174286187746442527L;
private MapCubeLayerPane layerPane;
private MapCubeDataPane4Chart dataPane;
@Override
protected List<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
paneList.add(layerPane = new MapCubeLayerPane());
paneList.add(dataPane = new MapCubeDataPane4Chart());
return paneList;
}
public ChartCollection updateBean() {
return null;// do nothing
}
public void populateBean(ChartCollection collection) {
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
layerPane.populateBean(map.getMapName());
}
// 确认层级关系
dataPane.populateBean(collection.getSelectedChart().getFilterDefinition());
}
public void updateBean(ChartCollection collection) {
collection.getSelectedChart().setFilterDefinition(dataPane.update());
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
layerPane.updateBean(map.getMapName());// 确定更新地图名称所对应的层级关系
}
}
/**
* 刷新层级树 数据中populate 数据的层数
* @param collection 图表收集器.
*/
public void init4PopuMapTree(ChartCollection collection) {
Chart selectChart = collection.getSelectedChart();
if(selectChart != null && selectChart.getPlot() instanceof MapPlot) {
MapPlot map = (MapPlot)selectChart.getPlot();
if(layerPane != null) {
layerPane.initRootTree(map.getMapName());
}
}
}
/**
* 判断是否合格
* @param ob 参数判断
* @return 默认合格.
*/
public boolean accept(Object ob) {
return true;
}
/**
* 界面标题
* @return 返回标题
*/
public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Map_Multilayer");
}
/**
* 重置
*/
public void reset() {
}
/**
* 设置是否支持单元格数据.
*/
public void setSurpportCellData(boolean surpportCellData) {
dataPane.justSupportOneSelect(surpportCellData);
}
/**
* 出发数据集改变
* @param tableDataWrapper 数据集
*/
public void fireTableDataChanged(TableDataWrapper tableDataWrapper) {
dataPane.fireTableDataChanged(tableDataWrapper);
}
}

202
designer_chart/src/com/fr/design/chart/report/MapMoreReportIndexPane.java

@ -0,0 +1,202 @@
package com.fr.design.chart.report;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.chart.chartdata.BaseSeriesDefinition;
import com.fr.chart.chartdata.MapSingleLayerReportDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
/**
* 多层地图, 单元格, 多层切换 单界面.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-4-22 下午04:26:10
*/
public class MapMoreReportIndexPane extends BasicBeanPane<MapSingleLayerReportDefinition> implements UIObserver{
private String title = StringUtils.EMPTY;
private TinyFormulaPane areaNamePane;
private UICorrelationPane tabPane;
public MapMoreReportIndexPane() {
initPane();
}
public MapMoreReportIndexPane(String titleName) {
title = titleName;
initPane();
}
private void initPane() {
this.setLayout(new BorderLayout(0, 0));
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
northPane.add(new UILabel(Inter.getLocText("Area_Name") + ":"));
areaNamePane = new TinyFormulaPane();
areaNamePane.setPreferredSize(new Dimension(120, 20));
northPane.add(areaNamePane);
tabPane = new UICorrelationPane(new String[]{Inter.getLocText(new String[]{"Filed", "Title"}), Inter.getLocText("Area_Value")}){
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
this.add(tabPane, BorderLayout.CENTER);
}
@Override
public void populateBean(MapSingleLayerReportDefinition definition) {
if(definition != null && definition.getCategoryName() != null) {
areaNamePane.populateBean(Utils.objectToString(definition.getCategoryName()));
List paneList = new ArrayList();
int titleValueSize = definition.getTitleValueSize();
for(int i = 0; i < titleValueSize; i++) {
BaseSeriesDefinition sd = definition.getTitleValueWithIndex(i);
if(sd != null && sd.getSeriesName() != null && sd.getValue() != null) {
paneList.add(new Object[]{sd.getSeriesName(), sd.getValue()});
}
}
if(!paneList.isEmpty()) {
tabPane.populateBean(paneList);
}
}
}
public MapSingleLayerReportDefinition updateBean() {
MapSingleLayerReportDefinition definition = new MapSingleLayerReportDefinition();
String areaName = areaNamePane.updateBean();
if(StableUtils.canBeFormula(areaName)) {
definition.setCategoryName(new Formula(areaName));
} else {
definition.setCategoryName(areaName);
}
List paneList = tabPane.updateBean();
for(int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[])paneList.get(i);
if(values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTitleValue(seriesDefinition);
}
}
return definition;
}
@Override
protected String title4PopupWindow() {
return title;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof TinyFormulaPane) {
return ((TinyFormulaPane)editorComponent).getUITextField().getText();
} else if(editorComponent instanceof UITextField) {
return ((UITextField)editorComponent).getText();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
return getEditorComponent(column, value);
}
private JComponent getEditorComponent(int column, Object value) {
if(column == 0) {
UITextField field = new UITextField();
editorComponent = field;
if(value != null) {
field.setText(Utils.objectToString(value));
}
} else {
TinyFormulaPane tinyPane = new TinyFormulaPane() {
@Override
public void okEvent() {
tabPane.stopCellEditing();
tabPane.fireTargetChanged();
}
};
tinyPane.setBackground(UIConstants.FLESH_BLUE);
tinyPane.getUITextField().addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
// tabPane.stopCellEditing();//kunsnat: 不stop是因为可能直接点击公式编辑按钮, 否则需要点击两次才能弹出.
tabPane.fireTargetChanged();
}
});
if(value != null) {
tinyPane.getUITextField().setText(Utils.objectToString(value));
}
editorComponent = tinyPane;
}
return editorComponent;
}
}
@Override
public void registerChangeListener(UIObserverListener listener) {
if(tabPane != null) {
tabPane.registerChangeListener(listener);
}
if(areaNamePane != null) {
areaNamePane.registerChangeListener(listener);
}
}
@Override
public boolean shouldResponseChangeListener() {
return true;
}
}

209
designer_chart/src/com/fr/design/chart/report/MapMoreTableIndexPane.java

@ -0,0 +1,209 @@
package com.fr.design.chart.report;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import com.fr.base.Utils;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
/**
* 多层地图, 数据集定义, 多层切换 界面.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-4-22 下午03:27:51
*/
public class MapMoreTableIndexPane extends BasicBeanPane<MapSingleLayerTableDefinition> implements UIObserver{
private static final long serialVersionUID = 8135457041761804584L;
private String title = StringUtils.EMPTY;
private UIComboBox areaNameBox;
private UICorrelationPane tabPane;// 文本框 + 下拉框
private Object[] boxItems = new Object[]{""};
public MapMoreTableIndexPane() {
initPane();
}
public MapMoreTableIndexPane(String titleName) {
title = titleName;
initPane();
}
@Override
protected String title4PopupWindow() {
return title;
}
private void initPane() {
this.setLayout(new BorderLayout());
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
northPane.add(new UILabel(Inter.getLocText("Area_Name") + ":"));
areaNameBox = new UIComboBox();
areaNameBox.setPreferredSize(new Dimension(120, 20));
northPane.add(areaNameBox);
tabPane = new UICorrelationPane(new String[]{Inter.getLocText(new String[]{"Filed", "Title"}), Inter.getLocText("Area_Value")}){
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
this.add(tabPane, BorderLayout.CENTER);
}
/**
* 初始化 Box的选项.
*/
public void initAreaComBox(Object[] values) {
Object oldSelected = areaNameBox.getSelectedItem();
areaNameBox.removeAllItems();
boxItems = values;
if(values != null) {
for(int i = 0, size = values.length; i < size; i++) {
areaNameBox.addItem(values[i]);
}
}
areaNameBox.getModel().setSelectedItem(oldSelected);
}
@Override
public void populateBean(MapSingleLayerTableDefinition ob) {
if(ob != null) {
areaNameBox.setSelectedItem(ob.getAreaName());
List paneList = new ArrayList();
int titleValueSize = ob.getTitleValueSize();
for(int i = 0; i < titleValueSize; i++) {
SeriesDefinition definition = ob.getTitleValueWithIndex(i);
if(definition != null && definition.getSeriesName() != null && definition.getValue() != null) {
paneList.add(new Object[]{definition.getSeriesName(), definition.getValue()});
}
}
if(!paneList.isEmpty()) {
tabPane.populateBean(paneList);
}
}
}
public MapSingleLayerTableDefinition updateBean() {// 不需要数据集,
MapSingleLayerTableDefinition definition = new MapSingleLayerTableDefinition();
if(areaNameBox.getSelectedItem() != null) {
definition.setAreaName(Utils.objectToString(areaNameBox.getSelectedItem()));
}
List paneList = tabPane.updateBean();
for(int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[])paneList.get(i);
if(values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTitleValue(seriesDefinition);
}
}
return definition;
}
private class InnerTableEditor extends UITableEditor {// 文本框 + 下拉框
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof UIComboBox) {
return ((UIComboBox)editorComponent).getSelectedItem();
} else if(editorComponent instanceof UITextField) {
return ((UITextField)editorComponent).getText();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
return getEditorComponent(column, value);
}
private JComponent getEditorComponent(int column, Object value) {
if(column == 0) {
UITextField field = new UITextField();
editorComponent = field;
if(value != null) {
field.setText(value.toString());
}
} else {
UIComboBox box = new UIComboBox(boxItems);
box.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
tabPane.fireTargetChanged();
tabPane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
editorComponent = box;
}
return editorComponent;
}
}
@Override
public void registerChangeListener(UIObserverListener listener) {
if(areaNameBox != null) {
areaNameBox.registerChangeListener(listener);
}
if(tabPane != null) {
tabPane.registerChangeListener(listener);
}
}
@Override
public boolean shouldResponseChangeListener() {
return true;
}
}

74
designer_chart/src/com/fr/design/chart/report/MapReportCubeDataPane.java

@ -0,0 +1,74 @@
package com.fr.design.chart.report;
import com.fr.chart.chartdata.MapMoreLayerReportDefinition;
import com.fr.chart.chartdata.MapSingleLayerReportDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.general.Inter;
import java.awt.*;
/**
* 多层钻取 单元格的数据设置界面
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-23 上午10:07:41
*/
public class MapReportCubeDataPane extends FurtherBasicBeanPane<MapMoreLayerReportDefinition> {
private MapMoreReportIndexPane reportPane;
public MapReportCubeDataPane() {
this.setLayout(new BorderLayout(0, 0));
reportPane = new MapMoreReportIndexPane();
this.add(reportPane, BorderLayout.CENTER);
}
/**
* 能够展示界面的判断.
* @param ob 界面类型
* @return 返回是否符合.
*/
public boolean accept(Object ob) {
return ob instanceof MapMoreLayerReportDefinition;
}
/**
* 界面重置
*/
public void reset() {
}
/**
* 界面弹出标题
* @return 返回标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("Cell");
}
@Override
public void populateBean(MapMoreLayerReportDefinition ob) {// 根据Populate 决定层级的个数, 表现为row的个数
if (ob != null) {
MapSingleLayerReportDefinition[] values = ob.getNameValues();
if(values != null && values.length > 0) {
reportPane.populateBean(values[0]);
}
}
}
@Override
public MapMoreLayerReportDefinition updateBean() {
MapMoreLayerReportDefinition reportDefinition = new MapMoreLayerReportDefinition();
reportDefinition.clearNameValues();
reportDefinition.addNameValue(reportPane.updateBean());
return reportDefinition;
}
}

233
designer_chart/src/com/fr/design/chart/report/MapReportDataSinglePane.java

@ -0,0 +1,233 @@
package com.fr.design.chart.report;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Formula;
import com.fr.base.Utils;
import com.fr.chart.chartdata.BaseSeriesDefinition;
import com.fr.chart.chartdata.MapSingleLayerReportDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
/**
* 地图 单元格数据 单层地图 界面
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-22 下午05:16:23
*/
public class MapReportDataSinglePane extends FurtherBasicBeanPane<MapSingleLayerReportDefinition> implements UIObserver {
private TinyFormulaPane areaNamePane;
private UICorrelationPane seriesPane;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
public MapReportDataSinglePane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.CENTER));
northPane.add(new UILabel(Inter.getLocText("Area_Name") + ":", SwingConstants.RIGHT));
areaNamePane = new TinyFormulaPane();
areaNamePane.setPreferredSize(new Dimension(120, 20));
northPane.add(areaNamePane);
String[] columnNames = new String[]{Inter.getLocText(new String[]{"Filed", "Title"}), Inter.getLocText("Area_Value")};
seriesPane = new UICorrelationPane(columnNames) {
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
this.add(seriesPane, BorderLayout.CENTER);
}
/**
* 界面接入.
*/
public boolean accept(Object ob) {
return true;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面弹出标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("Cell");
}
@Override
public void populateBean(MapSingleLayerReportDefinition ob) {
if(ob.getCategoryName() != null) {
areaNamePane.populateBean(Utils.objectToString(ob.getCategoryName()));
int size = ob.getTitleValueSize();
List paneList = new ArrayList();
for(int i = 0; i < size; i++) {
BaseSeriesDefinition first = ob.getTitleValueWithIndex(i);
if (first != null && first.getSeriesName() != null && first.getValue() != null) {
paneList.add(new Object[]{first.getSeriesName(), first.getValue()});
}
}
if (!paneList.isEmpty()) {
seriesPane.populateBean(paneList);
}
}
}
@Override
public MapSingleLayerReportDefinition updateBean() {
MapSingleLayerReportDefinition reportDefinition = new MapSingleLayerReportDefinition();
String areaName = areaNamePane.updateBean();
if(StableUtils.canBeFormula(areaName)) {
reportDefinition.setCategoryName(new Formula(areaName));
} else {
reportDefinition.setCategoryName(areaName);
}
List values = seriesPane.updateBean();
if(values != null && !values.isEmpty() ) {
for (int i = 0, size = values.size(); i < size; i++) {
Object[] objects = (Object[]) values.get(i);
Object name = objects[0];
Object value = objects[1];
if (StableUtils.canBeFormula(value)) {
value = new Formula(Utils.objectToString(value));
}
SeriesDefinition definition = new SeriesDefinition(name, value);
reportDefinition.addTitleValue(definition);
}
}
return reportDefinition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof TinyFormulaPane) {
return ((TinyFormulaPane)editorComponent).getUITextField().getText();
} else if(editorComponent instanceof UITextField) {
return ((UITextField)editorComponent).getText();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
return getEditorComponent(column, value);
}
private JComponent getEditorComponent(int column, Object value) {
if(column == 0) {
UITextField field = new UITextField();
addListener4UITextFiled(field);
if(value != null) {
field.setText(Utils.objectToString(value));
}
editorComponent = field;
} else {
TinyFormulaPane tinyPane = new TinyFormulaPane() {
@Override
public void okEvent() {
seriesPane.stopCellEditing();
seriesPane.fireTargetChanged();
}
};
tinyPane.setBackground(UIConstants.FLESH_BLUE);
addListener4UITextFiled(tinyPane.getUITextField());
if(value != null) {
tinyPane.getUITextField().setText(Utils.objectToString(value));
}
editorComponent = tinyPane;
}
return editorComponent;
}
private void addListener4UITextFiled(UITextField textField) {
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
// seriesPane.stopCellEditing(); //kunsnat: 不stop是因为可能直接点击公式编辑按钮, 否则需要点击两次才能弹出.
seriesPane.fireTargetChanged();
}
});
}
}
}

62
designer_chart/src/com/fr/design/chart/report/MapReportEditor.java

@ -0,0 +1,62 @@
package com.fr.design.chart.report;
import java.awt.Component;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellEditor;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.general.Inter;
/**
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-23 上午10:31:22
*/
public class MapReportEditor extends AbstractCellEditor implements TableCellEditor {
private ValueEditorPane cellEditor;
private List<ChangeListener> list = new ArrayList<ChangeListener>();
public MapReportEditor() {
}
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
cellEditor = createPane();
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
public Object getCellEditorValue() {
return cellEditor.update();
}
public void addChangeListener(ChangeListener l) {
list.add(l);
}
private ValueEditorPane createPane() {
TextEditor textEidtor = new TextEditor();
initListeners(textEidtor);
FormulaEditor formulaEditor = new FormulaEditor(Inter.getLocText("Parameter-Formula"));
initListeners(formulaEditor);
Editor[] editors = new Editor[]{textEidtor, formulaEditor};
cellEditor = ValueEditorPaneFactory.createValueEditorPane(editors);
return cellEditor;
}
private void initListeners(Editor editor) {
for(int i = 0; i < list.size(); i++) {
editor.addChangeListener(list.get(i));
}
}
}

32
designer_chart/src/com/fr/design/chart/report/MapReportRenderer.java

@ -0,0 +1,32 @@
package com.fr.design.chart.report;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.general.Inter;
/**
* 简要提供 文本和公式两种编辑器
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-23 上午10:30:16
*/
public class MapReportRenderer extends DefaultTableCellRenderer {
private ValueEditorPane cellEditor;
public MapReportRenderer() {
Editor[] editors = new Editor[]{new TextEditor(), new FormulaEditor(Inter.getLocText("Parameter-Formula"))};
cellEditor = ValueEditorPaneFactory.createValueEditorPane(editors);
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
}

113
designer_chart/src/com/fr/design/chart/report/MapSinglePane.java

@ -0,0 +1,113 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartdata.MapSingleLayerReportDefinition;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* 数据定义: 地图单层设置
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-22 上午10:41:03
*/
public class MapSinglePane extends FurtherBasicBeanPane<TopDefinitionProvider> {
private UIComboBoxPane<Chart> dataFromPane;// 数据来源的box界面
private MapReportDataSinglePane reportSinglePane;
private MapTableDataSinglePane tableSinglePane;
public MapSinglePane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout());
this.add(dataFromPane = new UIComboBoxPane<Chart>() {
protected void initLayout() {
this.setLayout(new BorderLayout(0, 6));
JPanel northPane = new JPanel(new FlowLayout(FlowLayout.LEFT));
northPane.add(new BoldFontTextLabel(Inter.getLocText("ChartF-Data-Resource") + ":"));
northPane.add(jcb);
this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER);
}
@Override
protected List<FurtherBasicBeanPane<? extends Chart>> initPaneList() {
List list = new ArrayList();
list.add(tableSinglePane = new MapTableDataSinglePane());// 数据集界面
list.add(reportSinglePane = new MapReportDataSinglePane());// 单元格界面
return list;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Data_Setting");
}
}, BorderLayout.CENTER);
}
/**
* 判断准许的情况
*/
public boolean accept(Object ob) {
return ob instanceof TopDefinition;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText(new String[]{"SingleLayer", "Chart-Map"});
}
/**
* 加载单层地图时的 数据来源界面
*/
public void populateBean(TopDefinitionProvider ob) {
if(ob instanceof MapSingleLayerReportDefinition) {
dataFromPane.setSelectedIndex(1);
reportSinglePane.populateBean((MapSingleLayerReportDefinition)ob);
} else if(ob instanceof MapSingleLayerTableDefinition) {
dataFromPane.setSelectedIndex(0);
tableSinglePane.populateBean((MapSingleLayerTableDefinition)ob);
}
}
/**
* 保存下载 单层数据界面
*/
public TopDefinitionProvider updateBean() {
if(dataFromPane.getSelectedIndex() == 0) {
return tableSinglePane.updateBean();
} else {
return reportSinglePane.updateBean();
}
}
public void setSurpportCellData(boolean surpportCellData) {
dataFromPane.justSupportOneSelect(surpportCellData);
}
}

79
designer_chart/src/com/fr/design/chart/report/MapSinglePane4Chart.java

@ -0,0 +1,79 @@
package com.fr.design.chart.report;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.general.Inter;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class MapSinglePane4Chart extends FurtherBasicBeanPane<TopDefinitionProvider> {
private MapTableDataSinglePane4Chart tableSinglePane;
public MapSinglePane4Chart() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout());
this.add(tableSinglePane = new MapTableDataSinglePane4Chart(), BorderLayout.CENTER);
}
/**
* 判断准许的情况
* @param ob 数据集
* @return 是不是顶层数据
*/
public boolean accept(Object ob) {
return ob instanceof TopDefinition;
}
/**
* 重置
*/
public void reset() {
}
/**
*界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText(new String[]{"SingleLayer", "Chart-Map"});
}
/**
* 加载单层地图时的 数据来源界面
*/
public void populateBean(TopDefinitionProvider ob) {
if(ob instanceof MapSingleLayerTableDefinition) {
tableSinglePane.populateBean((MapSingleLayerTableDefinition)ob);
}
}
/**
* 保存下载 单层数据界面
*/
public TopDefinitionProvider updateBean() {
return tableSinglePane.updateBean();
}
/**
* 出发数据集改变
* @param tableDataWrapper 数据集
*/
public void fireTableDataChanged(TableDataWrapper tableDataWrapper) {
tableSinglePane.setTableDataWrapper(tableDataWrapper);
tableSinglePane.refreshAreaNameBox();
}
}

110
designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane.java

@ -0,0 +1,110 @@
package com.fr.design.chart.report;
import com.fr.chart.chartdata.MapMoreLayerTableDefinition;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
import java.util.List;
/**
* 地图 多层钻取 数据集定义界面
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-23 上午10:55:39
*/
public class MapTableCubeDataPane extends FurtherBasicBeanPane<MapMoreLayerTableDefinition> {
private DatabaseTableDataPane dataFromBox;
private MapMoreTableIndexPane tablePane;
public MapTableCubeDataPane() {
this.setLayout(new BorderLayout());
JPanel pane = new JPanel();
this.add(pane, BorderLayout.NORTH);
pane.setLayout(new FlowLayout(FlowLayout.LEFT));
UILabel label = new UILabel(Inter.getLocText("Select_Data_Set") + ":", SwingConstants.RIGHT);
dataFromBox = new DatabaseTableDataPane(label) {
protected void userEvent() {
refreshAreaNameBox();
}
};
dataFromBox.setPreferredSize(new Dimension(180, 20));
pane.add(dataFromBox);
tablePane = new MapMoreTableIndexPane();
this.add(tablePane, BorderLayout.CENTER);
}
private void refreshAreaNameBox() {// 刷新区域名称列表
TableDataWrapper tableDataWrappe = dataFromBox.getTableDataWrapper();
if (tableDataWrappe == null) {
return;
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
tablePane.initAreaComBox(columnNameList.toArray(new String[columnNameList.size()]));
}
/**
* 界面接入
* @param ob 界面
* @return 返回接入.
*/
public boolean accept(Object ob) {
return true;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面弹出标题
* @return 返回标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("DS-TableData");
}
@Override
public void populateBean(MapMoreLayerTableDefinition tableDefinition) {// editingLayerCout
if (tableDefinition != null) {
dataFromBox.populateBean(tableDefinition.getTableData());
MapSingleLayerTableDefinition[] values = tableDefinition.getNameValues();
if(values != null && values.length > 0) {
tablePane.populateBean(values[0]);
}
}
}
@Override
public MapMoreLayerTableDefinition updateBean() {
MapMoreLayerTableDefinition tableDefinition = new MapMoreLayerTableDefinition();
TableDataWrapper tableDataWrappe = dataFromBox.getTableDataWrapper();
if (tableDataWrappe != null) {
tableDefinition.setTableData(new NameTableData(tableDataWrappe.getTableDataName()));
tableDefinition.clearNameValues();
tableDefinition.addNameValue(tablePane.updateBean());
}
return tableDefinition;
}
}

93
designer_chart/src/com/fr/design/chart/report/MapTableCubeDataPane4Chart.java

@ -0,0 +1,93 @@
package com.fr.design.chart.report;
import com.fr.chart.chartdata.MapMoreLayerTableDefinition;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.general.Inter;
import java.awt.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class MapTableCubeDataPane4Chart extends FurtherBasicBeanPane<MapMoreLayerTableDefinition> {
private MapMoreTableIndexPane tablePane;
private TableDataWrapper tableDataWrapper;
public MapTableCubeDataPane4Chart() {
this.setLayout(new BorderLayout());
tablePane = new MapMoreTableIndexPane();
this.add(tablePane, BorderLayout.CENTER);
}
/**
* 刷新区域名称列表
*/
public void refreshAreaNameBox() {
TableDataWrapper tableDataWrappe = tableDataWrapper;
if (tableDataWrappe == null) {
return;
}
java.util.List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
tablePane.initAreaComBox(columnNameList.toArray(new String[columnNameList.size()]));
}
public void setTableDataWrapper(TableDataWrapper wrapper){
this.tableDataWrapper = wrapper;
}
/**
* 界面接入
* @param ob 界面
* @return 返回接入.
*/
public boolean accept(Object ob) {
return true;
}
/**
* 重置
*/
public void reset() {
}
/**
* 界面弹出标题
* @return 返回标题.
*/
public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Table_Data");
}
@Override
public void populateBean(MapMoreLayerTableDefinition tableDefinition) {
if (tableDefinition != null) {
MapSingleLayerTableDefinition[] values = tableDefinition.getNameValues();
if(values != null && values.length > 0) {
tablePane.populateBean(values[0]);
}
}
}
@Override
public MapMoreLayerTableDefinition updateBean() {
MapMoreLayerTableDefinition tableDefinition = new MapMoreLayerTableDefinition();
TableDataWrapper tableDataWrappe =tableDataWrapper;
if (tableDataWrappe != null) {
tableDefinition.setTableData(tableDataWrappe.getTableData());
tableDefinition.clearNameValues();
tableDefinition.addNameValue(tablePane.updateBean());
}
return tableDefinition;
}
}

271
designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane.java

@ -0,0 +1,271 @@
package com.fr.design.chart.report;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Utils;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.data.impl.NameTableData;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
/**
* 单层地图时: 数据集 定义界面
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-22 上午11:14:59
*/
public class MapTableDataSinglePane extends FurtherBasicBeanPane<MapSingleLayerTableDefinition> implements UIObserver {
private DatabaseTableDataPane fromTableData;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private String[] initNames = {""};
private UIComboBox areaNameBox;
private UICorrelationPane titleValuePane;
public MapTableDataSinglePane() {
this.setLayout(new BorderLayout());
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
UILabel label = new UILabel(Inter.getLocText("Select_Data_Set") + ":", SwingConstants.RIGHT);
northPane.add(fromTableData = new DatabaseTableDataPane(label) {
@Override
protected void userEvent() {
refreshAreaNameBox();
}
});
fromTableData.setPreferredSize(new Dimension(180, 20));
northPane.add(fromTableData);
UILabel nameLabel = new UILabel(" " + Inter.getLocText("Area_Name") + ":", SwingConstants.RIGHT);
areaNameBox = new UIComboBox();
areaNameBox.setPreferredSize(new Dimension(80, 20));
JPanel areaNamePane = new JPanel();
areaNamePane.setLayout(new FlowLayout(FlowLayout.LEFT, 3, 0));
areaNamePane.add(nameLabel);
areaNamePane.add(areaNameBox);
JPanel pane = new JPanel();
this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(areaNamePane, BorderLayout.NORTH);
String[] titles = {Inter.getLocText(new String[]{"Filed", "Title"}), Inter.getLocText("Area_Value")};
titleValuePane = new UICorrelationPane(titles){
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
pane.add(titleValuePane, BorderLayout.CENTER);
}
private void refreshAreaNameBox() {// 刷新区域名称列表
TableDataWrapper tableDataWrappe = fromTableData.getTableDataWrapper();
if (tableDataWrappe == null) {
return;
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
initNames = columnNameList.toArray(new String[columnNameList.size()]);
Object oldSelected = areaNameBox.getSelectedItem();
areaNameBox.removeAllItems();
for(int i = 0, size = initNames.length; i < size; i++) {
areaNameBox.addItem(initNames[i]);
}
areaNameBox.getModel().setSelectedItem(oldSelected);
stopEditing();
}
/**
* 界面接入
*/
public boolean accept(Object ob) {
return false;
}
/**
* 界面重置
*/
public void reset() {
}
/**
* 界面弹出标题
*/
public String title4PopupWindow() {
return Inter.getLocText("DS-TableData");
}
private void stopEditing() {
}
@Override
public void populateBean(MapSingleLayerTableDefinition ob) {
stopEditing();
if (ob instanceof MapSingleLayerTableDefinition) {
MapSingleLayerTableDefinition mapDefinition = (MapSingleLayerTableDefinition) ob;
fromTableData.populateBean(((NameTableData) mapDefinition.getTableData()));
areaNameBox.setSelectedItem(mapDefinition.getAreaName());
List paneList = new ArrayList();
int titleValueSize = mapDefinition.getTitleValueSize();
for(int i = 0; i < titleValueSize; i++) {
SeriesDefinition definition = mapDefinition.getTitleValueWithIndex(i);
if(definition != null && definition.getSeriesName() != null && definition.getValue() != null) {
paneList.add(new Object[]{definition.getSeriesName(), definition.getValue()});
}
}
if(!paneList.isEmpty()) {
titleValuePane.populateBean(paneList);
}
}
}
@Override
public MapSingleLayerTableDefinition updateBean() {// 从一行内容中update
stopEditing();
MapSingleLayerTableDefinition definition = new MapSingleLayerTableDefinition();
TableDataWrapper tableDataWrappe = fromTableData.getTableDataWrapper();
if (tableDataWrappe == null || areaNameBox.getSelectedItem() == null) {
return null;
}
definition.setTableData(new NameTableData(tableDataWrappe.getTableDataName()));
definition.setAreaName(Utils.objectToString(areaNameBox.getSelectedItem()));
List paneList = titleValuePane.updateBean();
for(int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[])paneList.get(i);
if(values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTitleValue(seriesDefinition);
}
}
return definition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof UITextField) {
UITextField textField = (UITextField)editorComponent;
return textField.getText();
} else if(editorComponent instanceof UIComboBox) {
UIComboBox boxPane = (UIComboBox)editorComponent;
return boxPane.getSelectedItem();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
if(column == 0 ) {
UITextField text = new UITextField();
if(value != null) {
text.setText(Utils.objectToString(value));
}
text.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
titleValuePane.fireTargetChanged();
}
});
this.editorComponent = text;
} else {
UIComboBox box = new UIComboBox(initNames);
box.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
titleValuePane.fireTargetChanged();
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
this.editorComponent = box;
}
return this.editorComponent;
}
}
}

268
designer_chart/src/com/fr/design/chart/report/MapTableDataSinglePane4Chart.java

@ -0,0 +1,268 @@
package com.fr.design.chart.report;
import com.fr.base.Utils;
import com.fr.chart.chartdata.MapSingleLayerTableDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UICorrelationPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UITableEditor;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.*;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public class MapTableDataSinglePane4Chart extends FurtherBasicBeanPane<MapSingleLayerTableDefinition> implements UIObserver {
private static final int LABEL_WIDTH_GAP = 5;
private static final int COM_HEIGHT = 20;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
private String[] initNames = {""};
private UIComboBox areaNameBox;
private UICorrelationPane titleValuePane;
private TableDataWrapper tableDataWrapper;
public MapTableDataSinglePane4Chart() {
this.setLayout(new BorderLayout());
JPanel pane = new JPanel();
this.add(pane, BorderLayout.CENTER);
pane.setLayout(new BorderLayout());
pane.add(getAreaNamePane(), BorderLayout.NORTH);
String[] titles = {Inter.getLocText("FR-Chart-Area_Title"), Inter.getLocText("FR-Chart-Area_Value")};
titleValuePane = new UICorrelationPane(titles){
public UITableEditor createUITableEditor() {
return new InnerTableEditor();
}
};
pane.add(titleValuePane, BorderLayout.CENTER);
}
private JPanel getAreaNamePane(){
final UILabel label = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Map_ShowWay") + ":");
UILabel nameLabel = new UILabel(Inter.getLocText("FR-Chart-Area_Name") + ":", SwingConstants.RIGHT){
public Dimension getPreferredSize() {
return new Dimension(label.getPreferredSize().width+LABEL_WIDTH_GAP,COM_HEIGHT);
}
};
areaNameBox = new UIComboBox();
areaNameBox.setPreferredSize(new Dimension(80, 20));
double p =TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{nameLabel, areaNameBox},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
/**
*刷新区域名称列表
*/
public void refreshAreaNameBox() {// 刷新区域名称列表
TableDataWrapper tableDataWrappe = tableDataWrapper;
if (tableDataWrappe == null) {
return;
}
java.util.List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
initNames = columnNameList.toArray(new String[columnNameList.size()]);
Object oldSelected = areaNameBox.getSelectedItem();
areaNameBox.removeAllItems();
for(int i = 0, size = initNames.length; i < size; i++) {
areaNameBox.addItem(initNames[i]);
}
areaNameBox.getModel().setSelectedItem(oldSelected);
stopEditing();
}
/**
* 是否接受数据集
* @param ob 具体变量
* @return 不是
*/
public boolean accept(Object ob) {
return false;
}
/**
* 界面重置
*/
public void reset() {
}
/**
* 界面弹出标题
* @return 标题
*/
public String title4PopupWindow() {
return Inter.getLocText("FR-Chart-Table_Data");
}
private void stopEditing() {
}
@Override
public void populateBean(MapSingleLayerTableDefinition ob) {
stopEditing();
if (ob instanceof MapSingleLayerTableDefinition) {
MapSingleLayerTableDefinition mapDefinition = (MapSingleLayerTableDefinition) ob;
// fromTableData.populateBean(((NameTableData) mapDefinition.getTableData()));
areaNameBox.setSelectedItem(mapDefinition.getAreaName());
java.util.List paneList = new ArrayList();
int titleValueSize = mapDefinition.getTitleValueSize();
for(int i = 0; i < titleValueSize; i++) {
SeriesDefinition definition = mapDefinition.getTitleValueWithIndex(i);
if(definition != null && definition.getSeriesName() != null && definition.getValue() != null) {
paneList.add(new Object[]{definition.getSeriesName(), definition.getValue()});
}
}
if(!paneList.isEmpty()) {
titleValuePane.populateBean(paneList);
}
}
}
@Override
public MapSingleLayerTableDefinition updateBean() {// 从一行内容中update
stopEditing();
MapSingleLayerTableDefinition definition = new MapSingleLayerTableDefinition();
TableDataWrapper tableDataWrappe = tableDataWrapper;
// = fromTableData.getTableDataWrapper();
if (tableDataWrappe == null || areaNameBox.getSelectedItem() == null) {
return null;
}
definition.setTableData(tableDataWrapper.getTableData());
definition.setAreaName(Utils.objectToString(areaNameBox.getSelectedItem()));
java.util.List paneList = titleValuePane.updateBean();
for(int i = 0, size = paneList.size(); i < size; i++) {
Object[] values = (Object[])paneList.get(i);
if(values.length == 2) {
SeriesDefinition seriesDefinition = new SeriesDefinition();
seriesDefinition.setSeriesName(values[0]);
seriesDefinition.setValue(values[1]);
definition.addTitleValue(seriesDefinition);
}
}
return definition;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
private class InnerTableEditor extends UITableEditor {
private JComponent editorComponent;
/**
* 返回当前编辑器的值
*/
public Object getCellEditorValue() {
if(editorComponent instanceof UITextField) {
UITextField textField = (UITextField)editorComponent;
return textField.getText();
} else if(editorComponent instanceof UIComboBox) {
UIComboBox boxPane = (UIComboBox)editorComponent;
return boxPane.getSelectedItem();
}
return super.getCellEditorValue();
}
/**
* 返回当前编辑器..
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == table.getModel().getColumnCount()) {
return null;
}
if(column == 0 ) {
UITextField text = new UITextField();
if(value != null) {
text.setText(Utils.objectToString(value));
}
text.registerChangeListener(new UIObserverListener() {
@Override
public void doChange() {
titleValuePane.fireTargetChanged();
}
});
this.editorComponent = text;
} else {
UIComboBox box = new UIComboBox(initNames);
box.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
titleValuePane.fireTargetChanged();
titleValuePane.stopCellEditing();
}
});
if (value != null && StringUtils.isNotEmpty(value.toString())) {
box.setSelectedItem(value);
} else {
box.setSelectedItem(value);
}
this.editorComponent = box;
}
return this.editorComponent;
}
}
public void setTableDataWrapper(TableDataWrapper wrapper){
this.tableDataWrapper = wrapper;
}
}

23
designer_chart/src/com/fr/design/chart/series/PlotSeries/AbstrctMapAttrEditPane.java

@ -0,0 +1,23 @@
package com.fr.design.chart.series.PlotSeries;
import com.fr.chart.base.MapSvgAttr;
/**
* Created by IntelliJ IDEA.
* Author : daisy
* Version: 7.1.1
*/
public interface AbstrctMapAttrEditPane {
/**
* 更新界面
* @param attr 地图属性
*/
public void populateMapAttr(MapSvgAttr attr);
/**
* 更新MapSvgAttr
* @return 返回属性
*/
public MapSvgAttr updateCurrentAttr();
}

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

@ -0,0 +1,217 @@
package com.fr.design.chart.series.PlotSeries;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import com.fr.base.Utils;
import com.fr.chart.base.MapSvgAttr;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.data.core.DataCoreUtils;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import org.apache.batik.swing.svg.SVGFileFilter;
/**
* 自定义地图界面.
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-15 下午03:38:15
*/
public class MapCustomPane extends BasicBeanPane<String> implements AbstrctMapAttrEditPane{ // 储存地图对应的字段. 名称, 类型. shape (点 用圆形代替)
private FilterComboBox<String> areaString;// 区域字段
private DatabaseTableDataPane tableDataNameBox;// 数据集名称 + 后面跟随预览按钮
private MapImageEditPane imageShowPane; // 图片展示编辑的界面
private String lastSelectPath;
private boolean isNeedDataSource = true;
public MapCustomPane() {
initComp();
}
public MapCustomPane(boolean isNeedDataSource){
this.isNeedDataSource = isNeedDataSource;
initComp();
}
private void initComp() {
this.setLayout(new BorderLayout(0, 0));
JPanel pane = new JPanel();
this.add(pane, BorderLayout.NORTH);
pane.setLayout(new BorderLayout());
pane.add(northPaneCreate(), BorderLayout.NORTH);
imageShowPane = new MapImageEditPane();
pane.add(imageShowPane, BorderLayout.CENTER);
}
private JPanel northPaneCreate() {
JPanel northPane = new JPanel();
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
UIButton loadMap = new UIButton(Inter.getLocText("FR-Chart-Import_Map"));
loadMap.setPreferredSize(new Dimension(160, 20));
northPane.add(loadMap);
loadMap.addActionListener(selectPictureActionListener);
if(isNeedDataSource){
UILabel label =new UILabel(Inter.getLocText("FR-Chart-Table_Data") + ":", SwingConstants.RIGHT) ;
tableDataNameBox = new DatabaseTableDataPane(label) {
protected void userEvent() {
refreshAreaNameBox();
}
};
tableDataNameBox.setPreferredSize(new Dimension(200, 20));
northPane.add(tableDataNameBox);
northPane.add(new BoldFontTextLabel(Inter.getLocText(new String[]{"Filed", "Field"}) + ":"));
areaString = new FilterComboBox<String>();
areaString.setPreferredSize(new Dimension(120, 20));
areaString.addItemListener(areaChange);
northPane.add(areaString);
}
return northPane;
}
private ActionListener selectPictureActionListener = new ActionListener() {
public void actionPerformed(ActionEvent evt) {
JFileChooser svgFileChooser = new JFileChooser();
svgFileChooser.addChoosableFileFilter(new SVGFileFilter());
if (StringUtils.isNotBlank(lastSelectPath)) {
svgFileChooser.setSelectedFile(new File(lastSelectPath));
}
int returnVal = svgFileChooser.showOpenDialog(DesignerContext.getDesignerFrame());
if (returnVal != JFileChooser.CANCEL_OPTION) {
File selectedFile = svgFileChooser.getSelectedFile();
lastSelectPath = selectedFile.getAbsolutePath();
if (selectedFile != null && selectedFile.isFile()) {
imageShowPane.setSvgMap(selectedFile.getPath());
imageShowPane.repaint();
}
}
}
};
private ItemListener areaChange = new ItemListener() {
public void itemStateChanged(ItemEvent e) {
Object select = areaString.getSelectedItem();
if (select != null) {
String colName = Utils.objectToString(areaString.getSelectedItem());
TableDataWrapper tableDataWrappe = tableDataNameBox.getTableDataWrapper();
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
if (tableDataWrappe == null || source == null) {
return;
}
String[] values = DataCoreUtils.getColValuesInData(source, tableDataWrappe.getTableDataName(), colName);
ArrayList list = new ArrayList();
for(int i = 0; i < values.length; i++) {
list.add(values[i]);
}
imageShowPane.refreshFromDataList(list);
}
}
};
/**
* 选中方式: 区域或者点
*/
public void setImageSelectType(int selectType) {
if (imageShowPane != null) {
imageShowPane.setEditType(selectType);
}
}
private void refreshAreaNameBox() {// 刷新区域名称列表
if(!isNeedDataSource){
return;
}
TableDataWrapper tableDataWrappe = tableDataNameBox.getTableDataWrapper();
if (tableDataWrappe == null) {
return;
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
areaString.removeAllItems();
areaString.setItemList(columnNameList);
}
/**
* 当前正在编辑的条目的类别(国家省市)名和地图名
* @param typeName 类别名
* @param mapName 地图名
*/
public void setTypeNameAndMapName(String typeName, String mapName){
imageShowPane.setTypeNameAndMapName(typeName, mapName);
}
/**
* 根据地图名称 加载信息
*/
public void populateBean(String list) {
imageShowPane.populateBean(list);
}
/**
* 根据地图名称 保存信息
*/
public String updateBean() {
// 地图类型等 加入Helper
return imageShowPane.updateBean();
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Datasource-User_Defined", "Chart-Map"});
}
/**
* 更新界面
* @param attr 地图属性
*/
public void populateMapAttr(MapSvgAttr attr) {
imageShowPane.populateMapSvgAttr(attr);
}
/**
* 更新MapSvgAttr
* @return 返回属性
*/
public MapSvgAttr updateCurrentAttr() {
return imageShowPane.updateWithOutSave();
}
}

250
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapDefiAreaNamePane.java

@ -0,0 +1,250 @@
package com.fr.design.chart.series.PlotSeries;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.JPanel;
import javax.swing.JTable;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.base.Utils;
import com.fr.design.data.DesignTableDataManager;
import com.fr.data.TableDataSource;
import com.fr.data.core.DataCoreUtils;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.FilterComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.mainframe.chart.gui.data.DatabaseTableDataPane;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.xcombox.ComboBoxUseEditor;
import com.fr.design.editor.editor.Editor;
import com.fr.design.editor.editor.TextEditor;
import com.fr.general.Inter;
import com.fr.third.org.apache.poi.hssf.record.formula.functions.T;
/**
* 地图, 定义区域名.
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-19 下午03:19:53
*/
public class MapDefiAreaNamePane extends BasicBeanPane<String> implements AbstrctMapAttrEditPane{
private DatabaseTableDataPane tableDataBox;
private FilterComboBox columnBox;
// 双列: 左侧Label, 数据列表(全部都是UIComboBox, 支持自定义).
private UITableEditorPane tableEditorPane;
private UIArrayTableModel tableEditorModel;
private String[] initNames = new String[]{};
private String editName = "";
private boolean isNeedDataSource = true;
private MapSvgAttr currentSvg;
public MapDefiAreaNamePane(boolean isNeedDataSource){
this.isNeedDataSource = isNeedDataSource;
initCom();
}
public MapDefiAreaNamePane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
JPanel northPane = new JPanel();
if(this.isNeedDataSource){
this.add(northPane, BorderLayout.NORTH);
}
northPane.setLayout(new FlowLayout(FlowLayout.LEFT));
UILabel lable = new UILabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT);
// 数据集, 字段, 数据列表, 使用该数据进行自动命名
tableDataBox = new DatabaseTableDataPane(lable) {
protected void userEvent() {
refreshAreaNameBox();
}
};
tableDataBox.setPreferredSize(new Dimension(200, 20));
northPane.add(tableDataBox);
columnBox = new FilterComboBox<T>();
columnBox.setPreferredSize(new Dimension(40, 20));
columnBox.addItemListener(columnChange);
northPane.add(new UILabel(Inter.getLocText("FR-Chart-Map_Field")+":"));
northPane.add(columnBox);
tableEditorModel = new UIArrayTableModel(new String[]{Inter.getLocText("FR-Chart-Map_Use_Field"), Inter.getLocText("FR-Chart-Area_Name")}, new int[]{}) {
public boolean isCellEditable(int row, int col) {
return col != 0;
}
};
tableEditorModel.setDefaultEditor(Object.class, new DefaultComboBoxEditor());
tableEditorModel.setDefaultRenderer(Object.class, new DefaultComboBoxRenderer());
tableEditorPane = new UITableEditorPane<Object[]>(tableEditorModel);
this.add(tableEditorPane);
}
ItemListener columnChange = new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (columnBox.getSelectedItem() != null) {
String columnName = Utils.objectToString(columnBox.getSelectedItem());
TableDataWrapper tableDataWrappe = tableDataBox.getTableDataWrapper();
TableDataSource source = DesignTableDataManager.getEditingTableDataSource();
if (tableDataWrappe == null || source == null) {
return;
}
initNames = DataCoreUtils.getColValuesInData(source, tableDataWrappe.getTableDataName(), columnName);
if (tableEditorModel != null) {
tableEditorModel.stopCellEditing();// 只是用来刷新列表的combox
}
}
}
};
private void refreshAreaNameBox() {// 刷新区域名称列表
TableDataWrapper tableDataWrappe = tableDataBox.getTableDataWrapper();
if (tableDataWrappe == null) {
return;
}
List<String> columnNameList = tableDataWrappe.calculateColumnNameList();
columnBox.setItemList(columnNameList);
}
// 对应地图的名称
public void populateBean(String mapName) {
if (MapSvgXMLHelper.getInstance().containsMapName(mapName)) {
MapSvgAttr editingMapAttr = MapSvgXMLHelper.getInstance().getMapAttr(mapName);
this.editName = mapName;
this.populateMapAttr(editingMapAttr);
}
}
@Override
public String updateBean() {
// 固定存储 下 区域名 对应值 列表 MapHelper
updateMapAttr();
MapSvgXMLHelper.getInstance().removeMapAttr(currentSvg.getName());
MapSvgXMLHelper.getInstance().pushMapAttr(currentSvg.getName(),currentSvg);
return "";
}
private void updateMapAttr(){
if(currentSvg != null){
tableEditorModel.stopCellEditing();
List list = tableEditorPane.update();
for(int i = 0, size = list.size(); i < size; i++) {
Object[] tmp = (Object[]) list.get(i);
String name = Utils.objectToString(tmp[0]);
String nameTo = Utils.objectToString(tmp[1]);
currentSvg.setNameTo(name, nameTo);
}
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Define", "Area_Name"});
}
/**
* 更新界面
* @param editingMapAttr 地图属性
*/
public void populateMapAttr(MapSvgAttr editingMapAttr) {
List popuValues = new ArrayList();
if(editingMapAttr == null) {
currentSvg = null;
tableEditorPane.populate(popuValues.toArray());
return;
}
currentSvg =editingMapAttr;
List namesList = new ArrayList();
Iterator shapeNames = editingMapAttr.shapeValuesIterator();
while (shapeNames.hasNext()) {
namesList.add(shapeNames.next());// 先得到所有的处理名字, 然后再处理对应关系
}
for (int i = 0; i < namesList.size(); i++) {
Object name = namesList.get(i);
Object value = editingMapAttr.getNameToValue(Utils.objectToString(name));
popuValues.add(new Object[]{name, value});
}
tableEditorPane.populate(popuValues.toArray());
}
/**
* 更新MapSvgAttr
* @return 返回属性
*/
public MapSvgAttr updateCurrentAttr() {
updateMapAttr();
return currentSvg;
}
private class DefaultComboBoxEditor extends AbstractCellEditor implements TableCellEditor {
private ValueEditorPane cellEditor;
public DefaultComboBoxEditor() {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
if (column == 0) {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new TextEditor()});
} else {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
public Object getCellEditorValue() {
return cellEditor.update();
}
}
private class DefaultComboBoxRenderer extends DefaultTableCellRenderer {
private ValueEditorPane cellEditor;
public DefaultComboBoxRenderer() {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (column == 0) {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new TextEditor()});
} else {
cellEditor = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ComboBoxUseEditor(initNames)});
}
cellEditor.populate(value == null ? "" : value);
return cellEditor;
}
}
}

1
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapGroupExtensionPane.java

File diff suppressed because one or more lines are too long

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

@ -0,0 +1,763 @@
package com.fr.design.chart.series.PlotSeries;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.geom.GeneralPath;
import java.util.*;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JComponent;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import com.fr.base.*;
import com.fr.chart.base.MapSvgAttr;
import com.fr.chart.base.MapSvgXMLHelper;
import com.fr.chart.chartglyph.MapShapeValue;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.UISelectTable;
import com.fr.design.gui.itable.UITableNoOptionUI;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.UIDialog;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.CoreGraphHelper;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
/**
* 地图 图片编辑界面 选中图片 编辑. 支持鼠标选中等事件
*
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-10-15 下午04:17:28
*/
public class MapImageEditPane extends BasicBeanPane<String> {
private static final long serialVersionUID = -5925535686784344616L;
private static final double ARCSIZE = 7;
private static final int LOCATIONOFFSET = 10;
private static final int NAME_EDIT_PANE_WIDTH = 130;
private static final int NAME_EDIT_PANE_HEIGHT = 225;
private ImageEditPane imageEditPane;
private UISelectTable recordTable;
private int editType = 0;// 只标记mark或者标记出路径
private List<String> fromDataList = new ArrayList<String>();// 编辑时从数据集中取出的使用字段.
private HashMap<String, ArrayList<String>> resultAreaShape = new HashMap<String, ArrayList<String>>();// 名字 对应图形 // 已编辑区全都用指定颜色
private String currentNodeName ; //当前选中的节点的名字
private String typeName = "";
private String mapName = "";
private String mouseSelectListName = "";
private String editMapName = "";
public MapImageEditPane() {
initCom();
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
imageEditPane = new ImageEditPane();
this.add(imageEditPane, BorderLayout.CENTER);
recordTable = new UISelectTable(1){
public int columnAtPoint(Point point) {
//只有一列
return 0;
}
};
recordTable.addSelectionChangeListener(new ChangeListener() {
@Override
public void fireChanged(ChangeEvent event) {
mouseSelectListName = Utils.objectToString(event.getSource());
imageEditPane.repaint();
MapImageEditPane.this.repaint();
}
});
recordTable.setUI(new UITableNoOptionUI());
recordTable.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent e) {
List<Object[]> names = recordTable.updateBean();// 得到所有的List
List<String> test = new ArrayList<String>();
for (int i = 0; i < names.size(); i++) {
test.add(Utils.objectToString(recordTable.getValueAt(i, 0)));
}
Iterator<String> keys = resultAreaShape.keySet().iterator();
while (keys.hasNext()) {
String key = keys.next();
if (!test.contains(key)) {
keys.remove();
}
}
recordTable.revalidate();
repaint();
}
});
UIScrollPane pane = new UIScrollPane(recordTable);
pane.setPreferredSize(new Dimension(150, 320));
pane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Filed", "WF-Name"})));
this.add(pane, BorderLayout.EAST);
}
/**
* 设置编辑的类型: 区域 或者
*/
public void setEditType(int editType) {
this.editType = editType;
}
/**
* 返回编辑的类型: 区域 或者
*/
public int getEditType() {
return editType;
}
/**
* 设置正在编辑的svg文件
*/
public void setSvgMap(String filePath){
resultAreaShape.clear();
mouseSelectListName = StringUtils.EMPTY;
recordTable.populateBean(new ArrayList<Object[]>());
recordTable.revalidate();
imageEditPane.setSvgMap(filePath);
repaint();
}
/**
* 清空图片内容
*/
public void clearSvgMap(){
resultAreaShape.clear();
mouseSelectListName = StringUtils.EMPTY;
recordTable.populateBean(new ArrayList<Object[]>());
recordTable.revalidate();
imageEditPane.clearSvgMap();
repaint();
}
/**
* 设置正在编辑的svg文件
* @param attr 已经读取过的文件
*/
public void setSvgMap(MapSvgAttr attr){
resultAreaShape.clear();
mouseSelectListName = StringUtils.EMPTY;
recordTable.populateBean(new ArrayList<Object[]>());
recordTable.revalidate();
imageEditPane.setSvgMap(attr);
repaint();
}
/**
* 刷新数据列表中的数据
* @param list 列表
*/
public void refreshFromDataList(List list) {
fromDataList.clear();
for (Object aList : list) {
fromDataList.add(Utils.objectToString(aList));
}
}
/**
* 当前正在编辑的条目的类别(国家省市)名和地图名
* @param typeName 类别名
* @param mapName 地图名
*/
public void setTypeNameAndMapName(String typeName, String mapName){
this.typeName = typeName;
this.mapName = mapName;
}
private class ImageEditPane extends JComponent implements MouseListener, MouseMotionListener {
private MapSvgAttr currentSvgMap;//当前选中的svg地图
private GeneralPath selectedShape; // 当前选中的Shape
private Image image = BaseUtils.readImage("");// 所选择的图片
//平移的位置
private double moveLeft = 0;
private double moveTop = 0;
//鼠标落点的位置
private double mouseStartX;
private double mouseStartY;
private boolean dragged = false;
public ImageEditPane() {
this.addMouseListener(this);
this.addMouseMotionListener(this);
}
public void paintComponent(Graphics g) {// 选中图片之后, 记录选中的区域, 点中的 标记点
Rectangle bounds = this.getBounds();
if (bounds == null || this.image == null) {
return;
}
dealReady4Paint(g, bounds);
int imageWidth = this.image.getWidth(new JPanel());
int imageHeight = this.image.getHeight(new JPanel());
Graphics2D g2d = (Graphics2D) g;
if (this.image != null) {// 太小会放大, 太大, 则默认拖动
g2d.drawImage(this.image, (int) moveLeft, (int) moveTop, imageWidth, imageHeight, new JPanel()); // 只是移动起始位置
}
g2d.translate(moveLeft, moveTop);
g2d.setStroke(new BasicStroke(1));
if (resultAreaShape != null && !resultAreaShape.isEmpty()) {
for (String key : resultAreaShape.keySet()) {
GeneralPath selectShape = getSelectedNodePath(key);
g2d.setColor(Color.green);
g2d.draw(selectShape);
}
}
g2d.setColor(Color.blue);
if (StringUtils.isNotEmpty(mouseSelectListName) && resultAreaShape.containsKey(mouseSelectListName)) {// 当前悬浮选中的 list, 自己画的悬浮提示, 背景 边框, 文字
GeneralPath highSelect = getSelectedNodePath(mouseSelectListName);
if (highSelect != null) {
g2d.fill(highSelect);
}
} else if (selectedShape != null) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
g2d.fill(selectedShape);
}
g2d.translate(-moveLeft, -moveTop);
}
private void dealReady4Paint(Graphics g, Rectangle bounds) {
super.paintComponent(g);
int x = (int) bounds.getX();
int y = (int) bounds.getY();
int width = (int) bounds.getWidth();
int height = (int) bounds.getHeight();
g.clipRect(x, y, width, height);
}
//初始化下图片的状态
private void initImage() {
this.image = currentSvgMap.getMapImage();
CoreGraphHelper.waitForImage(this.image);
this.selectedShape = null;
this.moveLeft = 0;
this.moveTop = 0;
}
/**
* 设置当前正在编辑的文件
* @param filePath 文件路径
*/
public void setSvgMap(String filePath){
currentSvgMap = new MapSvgAttr(filePath);
currentSvgMap.setMapTypeAndName(typeName, mapName);
initImage();
}
/**
* 设置当前正在编辑的文件
* @param attr 读取过的文件
*/
public void setSvgMap(MapSvgAttr attr){
currentSvgMap = attr;
initImage();
}
public void clearSvgMap(){
currentSvgMap = null;
this.image = BaseUtils.readImage("");;
this.selectedShape = null;
this.moveLeft = 0;
this.moveTop = 0;
this.dragged = false;
this.mouseStartX = 0;
this.mouseStartY = 0;
}
public Image getImage() {
return this.image;
}
@Override
public void mouseClicked(MouseEvent e) {
drawSelectShape(e);
if (e.getClickCount() == 2) {// 2次编辑, 不然很容易错乱 和 update 错误
showEditNamePane(e);
}
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
this.mouseStartX = e.getPoint().getX();
this.mouseStartY = e.getPoint().getY();
}
@Override
public void mouseReleased(MouseEvent e) {
drawWhenDragEnd(e);
}
public void mouseDragged(MouseEvent e) {
this.dragged = true;
}
public void mouseMoved(MouseEvent e) {
}
private void drawWhenDragEnd(MouseEvent e) {
if (this.image == null || this.getBounds() == null) {
return;
}
if (dragged) {
double endX = e.getPoint().getX();
double endY = e.getPoint().getY();
int imageWidth = image.getWidth(new JPanel());
int imageHeight = image.getHeight(new JPanel());
int paneWidth = (int) this.getBounds().getWidth();
int paneHeight = (int) this.getBounds().getHeight();
if (imageWidth > paneWidth) {
double offX = endX - this.mouseStartX;
this.moveLeft += offX;
this.moveLeft = Math.max(this.moveLeft, paneWidth - imageWidth);
this.moveLeft = Math.min(0, this.moveLeft);
} else {
this.moveLeft = 0;
}
if (imageHeight > paneHeight) {
double offY = endY - this.mouseStartY;
this.moveTop += offY;
this.moveTop = Math.max(this.moveTop, paneHeight - imageHeight);
this.moveTop = Math.min(0, this.moveTop);
} else {
this.moveTop = 0;
}
this.repaint();
}
this.dragged = false;
}
//画鼠标点击的区域
private void drawSelectShape(MouseEvent e) {
selectedShape = null;
mouseSelectListName = StringUtils.EMPTY;
if (this.image == null) {
return;
}
Point ePoint = e.getPoint();
Point select = new Point((int) (ePoint.getX() - moveLeft), (int) (ePoint.getY() - moveTop));// 支持ctrl 选定时的多选.. 只是记录多个鼠标位置 然后shape合并
boolean gotSelectedShape = false;
for (String key : resultAreaShape.keySet()) {
GeneralPath mapSelect = getSelectedNodePath(key);
if (mapSelect.contains(select)) {
selectedShape = mapSelect;
currentNodeName = currentSvgMap.getSelectedPathName(select);
gotSelectedShape = true;
break;
}
}
if (!gotSelectedShape) {// 根据坐标重新在图片中选取Shape
if (getEditType() == MapShapeValue.AREA) {
selectedShape = currentSvgMap.getSelectPath(select);
currentNodeName = currentSvgMap.getSelectedPathName(select);
} else {
//标记点类型的要不要待定
}
}
this.repaint();
}
private void showEditNamePane(MouseEvent e) {
if (this.image == null || selectedShape == null) {
return;
}
final EditNamePane namePane = new EditNamePane();
Point ePoint = e.getPoint();
final Point select = new Point((int) (ePoint.getX() - moveLeft), (int) (ePoint.getY() - moveTop));
namePane.setEditViewRow(getEditViewRow(select));
String isSelectName = StringUtils.EMPTY;
for (String name : resultAreaShape.keySet()) {
GeneralPath shape = getSelectedNodePath(name);
if (shape.contains(select)) {
isSelectName = name;
break;
}
}
namePane.populateBean(isSelectName);
namePane.resetPaneWithNewNameList(fromDataList);
UIDialog bg = namePane.showUnsizedWindow(SwingUtilities.getWindowAncestor(ImageEditPane.this), new DialogActionAdapter() {
public void doOk() {
namePane.changeList();
String endName = namePane.updateBean();
if (resultAreaShape.containsKey(endName)) {
if(ComparatorUtils.equals(endName,namePane.startName)) {
return;
}
ArrayList<String> pathID = resultAreaShape.get(endName);
if(!pathID.contains(currentNodeName)){
pathID.add(currentNodeName);
}
}else{
ArrayList<String> paths = new ArrayList<String>();
resultAreaShape.put(endName,paths);
paths.add(currentNodeName);
ArrayList<String> exists = resultAreaShape.get(namePane.startName);
if(exists!= null){
for(String id:exists){
paths.add(id);
}
resultAreaShape.remove(namePane.startName);
}
}
}
});
bg.setSize(NAME_EDIT_PANE_WIDTH, NAME_EDIT_PANE_HEIGHT);
bg.setLocation((int) (e.getLocationOnScreen().getX()) + LOCATIONOFFSET, (int) e.getLocationOnScreen().getY());
bg.setTitle(Inter.getLocText(new String[]{"Edit", "Filed", "WF-Name"}));
bg.setVisible(true);
}
// viewList 根据内容名称 得到是哪一行.
public int getEditViewRow(Point point) {
int rowIndex = recordTable.getRowCount();// 最差 没有找到应该也是返回 row + 1
// 根据编辑的位置, 是否有shape对应, 有则找出, 没有则是新的行
String isSelectName = StringUtils.EMPTY;
for (String name : resultAreaShape.keySet()) {
GeneralPath shape = getSelectedNodePath(name);
if (shape.contains(point)) {
isSelectName = name;
break;
}
}
if (resultAreaShape.containsKey(isSelectName)) {
for (int i = 0; i < recordTable.getRowCount(); i++) {
String tmp = (String) recordTable.getValueAt(i, 0);
if (ComparatorUtils.equals(isSelectName, tmp)) {
rowIndex = i;
break;
}
}
}// 没有则添加一行
return rowIndex;
}
}
// 图片界面 悬浮点击弹出的名称列表
private class EditNamePane extends BasicBeanPane<String> {// 点击编辑名称
private UITextField nameText; // 文本框
private JList dataList;
private String startName;
private JList hasNamedList;
private int editViewRow = -1;// 所对应的view的index行 , 确定当前正在编辑的viewList的行, 然后改变值
private UILabel namedLabel = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Pre_Defined") + "------");
private JPanel listPane = new JPanel();
public EditNamePane() {
initCom();
}
public void setEditViewRow(int index) {
this.editViewRow = index;
}
private void initCom() {
this.setLayout(new BorderLayout(0, 0));
nameText = new UITextField();
nameText.setPreferredSize(new Dimension(100, 20));
this.add(nameText, BorderLayout.NORTH);
listPane.setLayout(new BoxLayout(listPane, BoxLayout.Y_AXIS));
this.add(listPane, BorderLayout.CENTER);
listPane.add(new UIScrollPane(dataList = new JList(new DefaultListModel())));
dataList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && dataList.getSelectedValue() != null) {
String value = Utils.objectToString(dataList.getSelectedValue());
nameText.setText(value);// 直接对文本值改变, 让文本去触发事件
}
}
});
listPane.add(namedLabel);
listPane.add(new UIScrollPane(hasNamedList = new JList(new DefaultListModel())));
hasNamedList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2 && hasNamedList.getSelectedValue() != null) {
nameText.setText(Utils.objectToString(hasNamedList.getSelectedValue()));
}
}
});
}
private void relayoutList() {
listPane.removeAll();
listPane.setLayout(new BoxLayout(listPane, BoxLayout.Y_AXIS));
listPane.add(new UIScrollPane(dataList));
if (hasNamedList.getModel().getSize() > 0) {
listPane.add(namedLabel);
listPane.add(new UIScrollPane(hasNamedList));
}
}
//列表改变,选中的时候添加shape信息
private void changeList() {
String textValue = nameText.getText();
if (editViewRow >= recordTable.getRowCount()) {// 添加一行 确定的行数 即时大于viewCount
recordTable.addLine(new String[]{textValue});
} else if (editViewRow > -1) {
recordTable.setValueAt(textValue, editViewRow, 0);
}
recordTable.revalidate();
recordTable.repaint();
resetPaneWithNewNameList(fromDataList);
}
public void resetPaneWithNewNameList(List<String> list) {// 界面不变, 只是刷新重置list
DefaultListModel model = (DefaultListModel) dataList.getModel();
model.removeAllElements();
DefaultListModel hasNameModel = (DefaultListModel) hasNamedList.getModel();
hasNameModel.removeAllElements();
for (int i = 0; list != null && i < list.size(); i++) {
String value = list.get(i);
if (!resultAreaShape.containsKey(value)) {
model.addElement(value);
}
}
for (String name : resultAreaShape.keySet()) {
if (!hasNameModel.contains(name)) {
hasNameModel.addElement(name);
}
}
relayoutList();
}
public void populateBean(String list) {
nameText.setText(list);
startName = list;
nameText.setCaretPosition(list == null ? 0 : list.length());
}
@Override
public String updateBean() {
return nameText.getText();
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Edit", "Image"});
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText(new String[]{"Edit", "Image"});
}
/**
* 更新地图 名称列表以及正在编辑的图片
*/
public void populateBean(String ob) {// 确定要编辑的地图名称
this.editMapName = ob;// 当前编辑的地图名称
MapSvgXMLHelper mapHelper = MapSvgXMLHelper.getInstance();
if (mapHelper.containsMapName(editMapName)) {
MapSvgAttr svgAttr = mapHelper.getMapAttr(editMapName);
populateMapSvgAttr(svgAttr);
}else if(mapHelper.getNewMapAttr(editMapName) != null ){
clearSvgMap();
imageEditPane.currentSvgMap = mapHelper.getMapAttr(editMapName);
}else {
clearSvgMap();
}
}
/**
* 保存编辑的地图 形状等信息.
*/
public String updateBean() {
if(imageEditPane.currentSvgMap !=null){
this.editMapName = imageEditPane.currentSvgMap.getName();
}
// 将地图加入helper 固定存储 记录固定的hShape 原图片的坐标位置, 然后在根据现在现实的 实际坐标 展示
if (StringUtils.isNotEmpty(editMapName) && this.imageEditPane.getImage() != null) {
MapSvgXMLHelper mapHelper = MapSvgXMLHelper.getInstance();
MapSvgAttr mapAttr = imageEditPane.currentSvgMap;
if(mapHelper.getNewMapAttr(editMapName)!=null){
mapHelper.removeNewMapAttr(editMapName);
mapHelper.pushMapAttr(editMapName,mapAttr);
}
if(mapHelper.containsMapName(editMapName)){
//处理下mapAttr存节点name属性
updateMapShapePath(mapAttr);
mapHelper.addCustomSvgMap(editMapName, mapAttr);
//设置以后要写回
mapAttr.writeBack(editMapName);
}
}
return editMapName;
}
/**
* 更新界面
* @param svgAttr 地图属性
* */
public void populateMapSvgAttr(MapSvgAttr svgAttr){
if(svgAttr == null || svgAttr.getMapImage() == null){
clearSvgMap();
return;
}
setSvgMap(svgAttr);
Iterator names = svgAttr.shapeValuesIterator();
while (names.hasNext()) {
String name = Utils.objectToString(names.next());
ArrayList<String> pathIDs= svgAttr.getExistedShapePathID(name);
if (name != null) {
resultAreaShape.put(name,pathIDs);
recordTable.addLine(new String[]{name});
}
}
recordTable.revalidate();
}
/**
* 更新MapSvgAttr
* @return 返回属性
* */
public MapSvgAttr updateWithOutSave(){
if(imageEditPane.currentSvgMap !=null){
this.editMapName = imageEditPane.currentSvgMap.getName();
}
// 将地图加入helper 固定存储 记录固定的hShape 原图片的坐标位置, 然后在根据现在现实的 实际坐标 展示
if (StringUtils.isNotEmpty(editMapName) && this.imageEditPane.getImage() != null) {
MapSvgXMLHelper mapHelper = MapSvgXMLHelper.getInstance();
MapSvgAttr mapAttr = imageEditPane.currentSvgMap;
if(mapHelper.getNewMapAttr(editMapName)!=null){
mapHelper.removeNewMapAttr(editMapName);
mapHelper.pushMapAttr(editMapName,mapAttr);
}
if(mapHelper.containsMapName(editMapName)){
//处理下mapAttr存节点name属性
updateMapShapePath(mapAttr);
mapHelper.addCustomSvgMap(editMapName, mapAttr);
}
return mapAttr;
}
return null;
}
private void updateMapShapePath(MapSvgAttr mapSvgAttr){
mapSvgAttr.clearExistShape();
for(String key : resultAreaShape.keySet()){
ArrayList<String> nodeName = resultAreaShape.get(key);
if(nodeName == null){
continue;
}
for(String node :nodeName){
mapSvgAttr.setNodeName(node, key);
}
}
}
private GeneralPath getSelectedNodePath(String nodeName){
if(imageEditPane.currentSvgMap == null){
return new GeneralPath();
}
MapSvgAttr attr = imageEditPane.currentSvgMap;
ArrayList<String> pathsID = resultAreaShape.get(nodeName);
GeneralPath unionPath =new GeneralPath();
//这边必须在新建的一个path上append,不然直接在存的path上append,不然后面删除组合了,也不能正常的选单个
for(String id :pathsID){
unionPath.append(attr.getPath4PathID(id),false);
}
return unionPath;
}
}

86
designer_chart/src/com/fr/design/chart/series/PlotSeries/MapSelectShape.java

@ -0,0 +1,86 @@
package com.fr.design.chart.series.PlotSeries;
import java.awt.Point;
import java.awt.Shape;
import java.util.ArrayList;
import java.util.List;
/**
* 地图选中的shape, 封装选中的点, GeneralPath 做处理
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2012-11-12 下午05:00:34
*/
public class MapSelectShape {
private List<Point> selectPoint = new ArrayList<Point>();
private List<Shape> selectShape = new ArrayList<Shape>();
private int selectType;
public MapSelectShape(Shape[] shape, Point[] point, int selectType) {
for(int i = 0; i < shape.length; i++) {
this.selectShape.add(shape[i]);
}
for(int i = 0; i < point.length; i++) {
this.selectPoint.add(point[i]);
}
this.selectType = selectType;
}
/**
* 判断多个区域中 是否包含Point
*/
public boolean containsPoint(Point point) {
boolean contains = false;
for(int i = 0; selectShape != null && i < selectShape.size(); i++) {
Shape shape = (Shape)selectShape.get(i);
contains = shape.contains(point);
if(contains) {
break;
}
}
return contains;
}
/**
* 添加对应的选中点和选中的区域
*/
public void addSelectValue(Point point, Shape shape) {
if(!selectShape.contains(shape)) {
this.selectShape.add(shape);
}
if(!this.selectPoint.contains(point)) {
this.selectPoint.add(point);
}
}
/**
* 返回选中的点 数组
*/
public Point[] getSelectPoints() {
return (Point[])this.selectPoint.toArray(new Point[selectPoint.size()]);
}
/**
* 返回选中的区域 数组
*/
public Shape[] getSelectShapes() {
return (Shape[])this.selectShape.toArray(new Shape[selectShape.size()]);
}
/**
* 设置选中的类型: 区域 或者点
*/
public void setSelectType(int selectType) {
this.selectType = selectType;
}
/**
* 返回选中的类型: 区域 或者点
*/
public int getSelectType() {
return selectType;
}
}

1
designer_chart/src/com/fr/design/chart/series/PlotSeries/UIGroupExtensionPane.java

File diff suppressed because one or more lines are too long

173
designer_chart/src/com/fr/design/chart/series/PlotStyle/ChartSelectDemoPane.java

@ -0,0 +1,173 @@
package com.fr.design.chart.series.PlotStyle;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.dialog.BasicPane;
import com.fr.stable.ArrayUtils;
/**
* 图表选中demo的类. 用于 选中点击, 悬浮状态, 可以继承, 改变画的内容.
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2011-10-27 下午03:50:28
*/
public class ChartSelectDemoPane extends BasicPane implements UIObserver, MouseListener {
private static final long serialVersionUID = 7715973616632567352L;
public boolean isPressing;
// 所有统一参与的点击状态类. 相当于Group
protected ChartSelectDemoPane[] demoList = new ChartSelectDemoPane[0];
private boolean isRollOver;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
public void setDemoGroup(ChartSelectDemoPane[] demos) {
this.demoList = demos;
}
@Override
protected String title4PopupWindow() {
return "";
}
/**
* 鼠标点击
* @param e 事件
*/
public void mouseClicked(MouseEvent e) {
// list中的所有的都弄成非选中状态.
if(this.isEnabled()){
for (int i = 0; i < ArrayUtils.getLength(demoList); i++) {
demoList[i].isRollOver = false;
demoList[i].isPressing = false;
}
this.isPressing = true;
fireStateChange();
for (int i = 0; i < ArrayUtils.getLength(demoList); i++) {
demoList[i].checkBackground();
demoList[i].repaint();
}
}
}
/**
* 注册监听
* @param l 监听
*/
public void addChangeListener(ChangeListener l) {
changeListeners.add(l);
}
private void fireStateChange() {
for (int i = 0; i < changeListeners.size(); i++) {
changeListeners.get(i).stateChanged(new ChangeEvent(this));
}
}
/**
* 鼠标按压
* @param me 事件
*/
public void mousePressed(MouseEvent me) {
}
/**
* 鼠标放开
* @param me 事件
*/
public void mouseReleased(MouseEvent me) {
}
/**
* 鼠标进入
* @param me 事件
*/
public void mouseEntered(MouseEvent me) {
if(this.isEnabled()){
for (int i = 0; i < ArrayUtils.getLength(demoList); i++) {
demoList[i].isRollOver = false;
}
isRollOver = true;
for (int i = 0; i < ArrayUtils.getLength(demoList); i++) {
demoList[i].checkBackground();
demoList[i].repaint();
}
}
}
/**
* 鼠标移出
* @param me 事件
*/
public void mouseExited(MouseEvent me) {
// 限制在pane范围内!
if(this.isEnabled()){
int x = me.getX();
int y = me.getY();
Dimension d = this.getPreferredSize();
if (inDimension(d, x, y)) {
isRollOver = true;
} else {
isRollOver = false;
}
for (int i = 0; i < ArrayUtils.getLength(demoList); i++) {
demoList[i].checkBackground();
demoList[i].repaint();
}
}
}
private boolean inDimension(Dimension d, int x, int y) {
return x < d.getWidth() && y < d.getHeight() && x > 0 && y > 0;
}
/**
* 给组件登记一个观察者监听事件
*
* @param listener 观察者监听事件
*/
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
/**
* 组件是否需要响应添加的观察者事件
*
* @return 如果需要响应观察者事件则返回true否则返回false
*/
public boolean shouldResponseChangeListener() {
return true;
}
/**
* 修改背景颜色
*/
public void checkBackground() {
if (!isRollOver && !isPressing) {
this.setBackground(null);
} else if(isRollOver && !isPressing){
this.setBackground(new Color(182, 217, 253));
} else {
this.setBackground(new Color(164, 192, 220));
}
}
}

27
designer_chart/src/com/fr/design/chart/series/SeriesCondition/BubblePlotChartConditionPane.java

@ -0,0 +1,27 @@
/*
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved.
*/
package com.fr.design.chart.series.SeriesCondition;
import com.fr.chart.base.ChartConstants;
/**
* 气泡图 条件显示 参数 控制界面.
* Created by kunsnat on 14-3-11.
* kunsnat@gmail.com
*/
public class BubblePlotChartConditionPane extends ChartConditionPane{
/**
* 界面条件序号 列表
* @return 返回条件列表.
*/
public String[] columns2Populate() {
return new String[]{
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
ChartConstants.VALUE
};
}
}

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

Loading…
Cancel
Save