From 7479c1818608601ee4ec50664848555608442e28 Mon Sep 17 00:00:00 2001 From: Satoshi Eguchi Date: Sat, 20 Apr 2019 20:17:20 +0900 Subject: [PATCH 1/3] initial state --- .gitattributes | 1 + gwt-charts-showcase/.classpath | 23 + gwt-charts-showcase/.project | 45 + .../com.google.appengine.eclipse.core.prefs | 8 + .../com.google.gdt.eclipse.core.prefs | 5 + .../com.google.gwt.eclipse.core.prefs | 4 + .../org.eclipse.core.resources.prefs | 8 + .../.settings/org.eclipse.jdt.core.prefs | 8 + .../.settings/org.eclipse.m2e.core.prefs | 5 + gwt-charts-showcase/pom.xml | 142 +++ .../gwt/charts/showcase/Showcase.gwt.xml | 23 + .../charts/showcase/client/AppMainPanel.java | 228 ++++ .../charts/showcase/client/ExampleWidget.java | 113 ++ .../gwt/charts/showcase/client/Resources.java | 26 + .../gwt/charts/showcase/client/Showcase.java | 35 + .../gwt/charts/showcase/client/SideMenu.java | 87 ++ .../controls/CategoryFilterExample.java | 96 ++ .../controls/ChartRangeFilterExample.java | 123 ++ .../controls/DateRangeFilterExample.java | 117 ++ .../controls/NumberRangeFilterExample.java | 87 ++ .../client/controls/StringFilterExample.java | 81 ++ .../client/corechart/AreaChartExample.java | 68 + .../client/corechart/BarChartExample.java | 70 ++ .../client/corechart/BubbleChartExample.java | 75 ++ .../corechart/CandlestickChartExample.java | 55 + .../client/corechart/ColumnChartExample.java | 70 ++ .../client/corechart/ComboChartExample.java | 61 + .../client/corechart/HistogramExample.java | 63 + .../client/corechart/LineChartExample.java | 71 ++ .../client/corechart/PieChartExample.java | 77 ++ .../client/corechart/ScatterChartExample.java | 63 + .../corechart/SteppedAreaChartExample.java | 66 + .../client/diffchart/DiffBarChartExample.java | 53 + .../diffchart/DiffColumnChartExample.java | 53 + .../client/diffchart/DiffPieChartExample.java | 56 + .../diffchart/DiffScatterChartExample.java | 57 + .../client/others/AnnotationChartExample.java | 90 ++ .../client/others/CalendarExample.java | 76 ++ .../showcase/client/others/GaugeExample.java | 60 + .../client/others/GeoChartExample.java | 64 + .../client/others/IntervalExample.java | 83 ++ .../showcase/client/others/MapExample.java | 51 + .../client/others/OrgChartExample.java | 69 ++ .../showcase/client/others/SankeyExample.java | 80 ++ .../showcase/client/others/TableExample.java | 63 + .../client/others/TimelineExample.java | 69 ++ .../client/others/TreeMapExample.java | 61 + .../showcase/client/util/DateUtils.java | 12 + .../charts/showcase/shared/FieldVerifier.java | 42 + .../src/main/resources/META-INF/jdoconfig.xml | 15 + .../gwt/charts/showcase/client/headerLogo.png | Bin 0 -> 6656 bytes .../gwt/charts/showcase/client/showcase.css | 28 + .../src/main/resources/log4j.properties | 24 + gwt-charts/.checkstyle | 11 + gwt-charts/.classpath | 27 + gwt-charts/.project | 46 + .../com.google.gdt.eclipse.core.prefs | 4 + .../com.google.gwt.eclipse.core.prefs | 3 + gwt-charts/.settings/gwt-checkstyle.xml | 196 +++ .../org.eclipse.core.resources.prefs | 4 + .../.settings/org.eclipse.jdt.core.prefs | 374 ++++++ gwt-charts/.settings/org.eclipse.jdt.ui.prefs | 60 + .../.settings/org.eclipse.m2e.core.prefs | 5 + .../.settings/org.eclipse.wst.jsdt.core.prefs | 260 ++++ .../org.jboss.ide.eclipse.as.core.prefs | 3 + gwt-charts/pom.xml | 255 ++++ .../gwt/charts/client/BoundingBox.java | 60 + .../gwt/charts/client/ChartEditor.java | 115 ++ .../charts/client/ChartLayoutInterface.java | 150 +++ .../gwt/charts/client/ChartLoader.java | 117 ++ .../gwt/charts/client/ChartObject.java | 242 ++++ .../gwt/charts/client/ChartPackage.java | 102 ++ .../gwt/charts/client/ChartType.java | 133 ++ .../gwt/charts/client/ChartWidget.java | 189 +++ .../gwt/charts/client/ChartWrapper.java | 622 ++++++++++ .../gwt/charts/client/ChartWrapperObject.java | 596 +++++++++ .../gwt/charts/client/ChartWrapperSpec.java | 160 +++ .../gwt/charts/client/ColumnFunction.java | 29 + .../gwt/charts/client/ColumnRange.java | 158 +++ .../gwt/charts/client/ColumnType.java | 73 ++ .../gwt/charts/client/DataCell.java | 122 ++ .../gwt/charts/client/DataColumn.java | 162 +++ .../gwt/charts/client/DataLiteral.java | 67 + .../googlecode/gwt/charts/client/DataRow.java | 60 + .../gwt/charts/client/DataSource.java | 592 +++++++++ .../gwt/charts/client/DataTable.java | 1099 +++++++++++++++++ .../gwt/charts/client/DataView.java | 259 ++++ .../gwt/charts/client/DataViewColumn.java | 140 +++ .../gwt/charts/client/DateRange.java | 57 + .../gwt/charts/client/HasListeners.java | 94 ++ .../gwt/charts/client/Properties.java | 158 +++ .../gwt/charts/client/RoleType.java | 116 ++ .../gwt/charts/client/RowFilter.java | 209 ++++ .../gwt/charts/client/Selection.java | 106 ++ .../gwt/charts/client/SortColumn.java | 55 + .../gwt/charts/client/TimeOfDay.java | 115 ++ .../annotationchart/AnnotationChart.java | 133 ++ .../AnnotationChartOptions.java | 334 +++++ .../charts/client/apiloader/ApiLoader.java | 175 +++ .../client/apiloader/ApiLoaderOptions.java | 87 ++ .../client/apiloader/ExceptionHelper.java | 48 + .../gwt/charts/client/calendar/Calendar.java | 149 +++ .../client/calendar/CalendarOptions.java | 170 +++ .../gwt/charts/client/controls/Control.java | 32 + .../client/controls/ControlOptions.java | 55 + .../client/controls/ControlOptionsUi.java | 26 + .../charts/client/controls/ControlState.java | 26 + .../charts/client/controls/ControlType.java | 70 ++ .../client/controls/ControlWrapper.java | 303 +++++ .../client/controls/ControlWrapperObject.java | 271 ++++ .../client/controls/ControlWrapperSpec.java | 93 ++ .../gwt/charts/client/controls/Dashboard.java | 190 +++ .../client/controls/DashboardObject.java | 93 ++ .../controls/filter/CategoryFilter.java | 31 + .../filter/CategoryFilterOptions.java | 94 ++ .../controls/filter/CategoryFilterState.java | 182 +++ .../controls/filter/CategoryFilterUi.java | 138 +++ .../controls/filter/ChartRangeFilter.java | 32 + .../filter/ChartRangeFilterOptions.java | 33 + .../filter/ChartRangeFilterState.java | 51 + .../filter/ChartRangeFilterStateRange.java | 162 +++ .../controls/filter/ChartRangeFilterUi.java | 116 ++ .../controls/filter/DateRangeFilter.java | 31 + .../filter/DateRangeFilterOptions.java | 66 + .../controls/filter/DateRangeFilterState.java | 105 ++ .../controls/filter/DateRangeFilterUi.java | 148 +++ .../controls/filter/NumberRangeFilter.java | 31 + .../filter/NumberRangeFilterOptions.java | 53 + .../filter/NumberRangeFilterState.java | 105 ++ .../controls/filter/NumberRangeFilterUi.java | 127 ++ .../client/controls/filter/StringFilter.java | 31 + .../controls/filter/StringFilterOptions.java | 67 + .../controls/filter/StringFilterState.java | 72 ++ .../controls/filter/StringFilterUi.java | 85 ++ .../charts/client/corechart/AreaChart.java | 35 + .../client/corechart/AreaChartOptions.java | 316 +++++ .../client/corechart/AreaChartSeries.java | 137 ++ .../gwt/charts/client/corechart/BarChart.java | 48 + .../charts/client/corechart/BarChartDiff.java | 45 + .../client/corechart/BarChartOptions.java | 240 ++++ .../client/corechart/BarChartSeries.java | 61 + .../charts/client/corechart/BubbleChart.java | 38 + .../client/corechart/BubbleChartOptions.java | 114 ++ .../client/corechart/BubbleChartSeries.java | 50 + .../client/corechart/CandlestickChart.java | 40 + .../corechart/CandlestickChartOptions.java | 220 ++++ .../corechart/CandlestickChartSeries.java | 81 ++ .../charts/client/corechart/ColumnChart.java | 48 + .../client/corechart/ColumnChartDiff.java | 45 + .../client/corechart/ColumnChartOptions.java | 231 ++++ .../client/corechart/ColumnChartSeries.java | 72 ++ .../charts/client/corechart/ComboChart.java | 40 + .../client/corechart/ComboChartOptions.java | 362 ++++++ .../client/corechart/ComboChartSeries.java | 183 +++ .../client/corechart/CoreChartWidget.java | 161 +++ .../charts/client/corechart/Histogram.java | 38 + .../client/corechart/HistogramOptions.java | 234 ++++ .../client/corechart/HistogramSeries.java | 61 + .../charts/client/corechart/LineChart.java | 35 + .../client/corechart/LineChartOptions.java | 332 +++++ .../client/corechart/LineChartSeries.java | 141 +++ .../gwt/charts/client/corechart/PieChart.java | 47 + .../charts/client/corechart/PieChartDiff.java | 93 ++ .../client/corechart/PieChartOptions.java | 297 +++++ .../client/corechart/PieChartTooltip.java | 82 ++ .../charts/client/corechart/ScatterChart.java | 49 + .../client/corechart/ScatterChartDiff.java | 57 + .../client/corechart/ScatterChartOptions.java | 227 ++++ .../client/corechart/ScatterChartSeries.java | 107 ++ .../client/corechart/SteppedAreaChart.java | 35 + .../corechart/SteppedAreaChartOptions.java | 214 ++++ .../corechart/SteppedAreaChartSeries.java | 70 ++ .../client/event/AnimationFinishEvent.java | 35 + .../client/event/AnimationFinishHandler.java | 38 + .../gwt/charts/client/event/CancelEvent.java | 35 + .../charts/client/event/CancelHandler.java | 38 + .../charts/client/event/CollapseEvent.java | 52 + .../charts/client/event/CollapseHandler.java | 38 + .../gwt/charts/client/event/ErrorEvent.java | 70 ++ .../gwt/charts/client/event/ErrorHandler.java | 38 + .../gwt/charts/client/event/Event.java | 47 + .../gwt/charts/client/event/EventHandler.java | 35 + .../gwt/charts/client/event/HandlerRef.java | 26 + .../gwt/charts/client/event/OkEvent.java | 36 + .../gwt/charts/client/event/OkHandler.java | 38 + .../charts/client/event/OnMouseOutEvent.java | 58 + .../client/event/OnMouseOutHandler.java | 38 + .../charts/client/event/OnMouseOverEvent.java | 58 + .../client/event/OnMouseOverHandler.java | 38 + .../gwt/charts/client/event/PageEvent.java | 43 + .../gwt/charts/client/event/PageHandler.java | 38 + .../charts/client/event/RangeChangeEvent.java | 54 + .../client/event/RangeChangeHandler.java | 38 + .../gwt/charts/client/event/ReadyEvent.java | 37 + .../gwt/charts/client/event/ReadyHandler.java | 38 + .../charts/client/event/RegionClickEvent.java | 44 + .../client/event/RegionClickHandler.java | 38 + .../gwt/charts/client/event/RollUpEvent.java | 43 + .../charts/client/event/RollUpHandler.java | 38 + .../gwt/charts/client/event/SelectEvent.java | 35 + .../charts/client/event/SelectHandler.java | 38 + .../gwt/charts/client/event/SortEvent.java | 64 + .../gwt/charts/client/event/SortHandler.java | 39 + .../charts/client/event/StateChangeEvent.java | 37 + .../client/event/StateChangeHandler.java | 38 + .../gwt/charts/client/format/ArrowFormat.java | 46 + .../client/format/ArrowFormatOptions.java | 43 + .../gwt/charts/client/format/BarFormat.java | 45 + .../client/format/BarFormatOptions.java | 118 ++ .../gwt/charts/client/format/ColorFormat.java | 283 +++++ .../gwt/charts/client/format/DateFormat.java | 62 + .../client/format/DateFormatOptions.java | 80 ++ .../charts/client/format/NumberFormat.java | 64 + .../client/format/NumberFormatOptions.java | 108 ++ .../charts/client/format/PatternFormat.java | 83 ++ .../gwt/charts/client/gauge/Gauge.java | 36 + .../gwt/charts/client/gauge/GaugeOptions.java | 166 +++ .../gwt/charts/client/geochart/GeoChart.java | 142 +++ .../client/geochart/GeoChartColorAxis.java | 88 ++ .../client/geochart/GeoChartLegend.java | 46 + .../client/geochart/GeoChartOptions.java | 198 +++ .../client/geochart/GeoChartTooltip.java | 57 + .../client/geochart/MagnifyingGlass.java | 53 + .../googlecode/gwt/charts/client/map/Map.java | 110 ++ .../gwt/charts/client/map/MapOptions.java | 113 ++ .../client/options/AggregationTarget.java | 65 + .../gwt/charts/client/options/Animation.java | 57 + .../client/options/AnimationEasing.java | 64 + .../client/options/AnnotationTextStyle.java | 95 ++ .../charts/client/options/Annotations.java | 63 + .../gwt/charts/client/options/Axis.java | 280 +++++ .../client/options/AxisTitlesPosition.java | 61 + .../client/options/BackgroundColor.java | 74 ++ .../gwt/charts/client/options/Bar.java | 51 + .../charts/client/options/BarFormatColor.java | 61 + .../gwt/charts/client/options/BoxStyle.java | 76 ++ .../gwt/charts/client/options/Bubble.java | 60 + .../charts/client/options/Candlestick.java | 60 + .../gwt/charts/client/options/CellColor.java | 60 + .../gwt/charts/client/options/ChartArea.java | 124 ++ .../gwt/charts/client/options/Color.java | 69 ++ .../gwt/charts/client/options/ColorAxis.java | 96 ++ .../client/options/ColorAxisLegend.java | 64 + .../client/options/ColoredLegendPosition.java | 57 + .../charts/client/options/CoreOptions.java | 228 ++++ .../gwt/charts/client/options/Crosshair.java | 94 ++ .../client/options/CrosshairOrientation.java | 61 + .../client/options/CrosshairProperties.java | 50 + .../client/options/CrosshairTrigger.java | 61 + .../gwt/charts/client/options/CurveType.java | 57 + .../gwt/charts/client/options/Direction.java | 57 + .../charts/client/options/DisplayMode.java | 61 + .../gwt/charts/client/options/Explorer.java | 106 ++ .../charts/client/options/ExplorerAction.java | 63 + .../charts/client/options/ExplorerAxis.java | 57 + .../charts/client/options/FocusTarget.java | 59 + .../gwt/charts/client/options/FormatType.java | 61 + .../gwt/charts/client/options/Gradient.java | 100 ++ .../gwt/charts/client/options/Gridlines.java | 50 + .../gwt/charts/client/options/HAxis.java | 162 +++ .../gwt/charts/client/options/Interval.java | 117 ++ .../charts/client/options/IntervalStyle.java | 79 ++ .../charts/client/options/LabelStacking.java | 57 + .../gwt/charts/client/options/Legend.java | 94 ++ .../client/options/LegendAlignment.java | 61 + .../charts/client/options/LegendPosition.java | 69 ++ .../gwt/charts/client/options/MapType.java | 65 + .../gwt/charts/client/options/MatchType.java | 61 + .../gwt/charts/client/options/Options.java | 51 + .../charts/client/options/Orientation.java | 57 + .../charts/client/options/PieSliceText.java | 65 + .../gwt/charts/client/options/PointShape.java | 76 ++ .../charts/client/options/PointShapeType.java | 72 ++ .../gwt/charts/client/options/Resolution.java | 62 + .../gwt/charts/client/options/ScaleType.java | 78 ++ .../client/options/SelectedValuesLayout.java | 65 + .../charts/client/options/SelectionMode.java | 57 + .../gwt/charts/client/options/SeriesType.java | 69 ++ .../gwt/charts/client/options/SizeAxis.java | 71 ++ .../gwt/charts/client/options/Slice.java | 59 + .../charts/client/options/TextPosition.java | 61 + .../gwt/charts/client/options/TextStyle.java | 77 ++ .../gwt/charts/client/options/Tick.java | 142 +++ .../charts/client/options/TitlePosition.java | 61 + .../gwt/charts/client/options/Tooltip.java | 73 ++ .../charts/client/options/TooltipText.java | 61 + .../charts/client/options/TooltipTrigger.java | 61 + .../gwt/charts/client/options/Trendline.java | 110 ++ .../charts/client/options/TrendlineType.java | 61 + .../gwt/charts/client/options/VAxis.java | 44 + .../gwt/charts/client/options/ViewWindow.java | 182 +++ .../charts/client/options/ViewWindowMode.java | 61 + .../gwt/charts/client/orgchart/OrgChart.java | 169 +++ .../client/orgchart/OrgChartOptions.java | 86 ++ .../charts/client/orgchart/OrgChartSize.java | 61 + .../gwt/charts/client/query/Query.java | 103 ++ .../charts/client/query/QueryCallback.java | 24 + .../gwt/charts/client/query/QueryOptions.java | 52 + .../charts/client/query/QueryResponse.java | 98 ++ .../gwt/charts/client/query/SendMethod.java | 68 + .../gwt/charts/client/sankey/Sankey.java | 149 +++ .../gwt/charts/client/sankey/SankeyLink.java | 45 + .../gwt/charts/client/sankey/SankeyNode.java | 70 ++ .../charts/client/sankey/SankeyOptions.java | 73 ++ .../charts/client/table/CssClassNames.java | 101 ++ .../gwt/charts/client/table/Table.java | 144 +++ .../gwt/charts/client/table/TableOptions.java | 171 +++ .../gwt/charts/client/table/TablePage.java | 64 + .../gwt/charts/client/table/TableSort.java | 65 + .../charts/client/table/TableSortInfo.java | 62 + .../gwt/charts/client/timeline/Timeline.java | 83 ++ .../client/timeline/TimelineOptions.java | 172 +++ .../gwt/charts/client/treemap/TreeMap.java | 161 +++ .../charts/client/treemap/TreeMapOptions.java | 289 +++++ .../gwt/charts/client/util/ArrayHelper.java | 162 +++ .../gwt/charts/client/util/ChartHelper.java | 106 ++ .../gwt/charts/client/util/DateHelper.java | 49 + .../gwt/charts/client/util/GadgetHelper.java | 69 ++ .../com/googlecode/gwt/charts/Charts.gwt.xml | 7 + gwt-charts/src/main/webapp/WEB-INF/web.xml | 15 + gwt-charts/src/main/webapp/index.html | 42 + 321 files changed, 30540 insertions(+) create mode 100644 .gitattributes create mode 100644 gwt-charts-showcase/.classpath create mode 100644 gwt-charts-showcase/.project create mode 100644 gwt-charts-showcase/.settings/com.google.appengine.eclipse.core.prefs create mode 100644 gwt-charts-showcase/.settings/com.google.gdt.eclipse.core.prefs create mode 100644 gwt-charts-showcase/.settings/com.google.gwt.eclipse.core.prefs create mode 100644 gwt-charts-showcase/.settings/org.eclipse.core.resources.prefs create mode 100644 gwt-charts-showcase/.settings/org.eclipse.jdt.core.prefs create mode 100644 gwt-charts-showcase/.settings/org.eclipse.m2e.core.prefs create mode 100644 gwt-charts-showcase/pom.xml create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/Showcase.gwt.xml create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/AppMainPanel.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/ExampleWidget.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Resources.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Showcase.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/SideMenu.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/CategoryFilterExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/ChartRangeFilterExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/DateRangeFilterExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/NumberRangeFilterExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/StringFilterExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/AreaChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BarChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BubbleChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/CandlestickChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ColumnChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ComboChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/HistogramExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/LineChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/PieChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ScatterChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/SteppedAreaChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffBarChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffColumnChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffPieChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffScatterChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/AnnotationChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/CalendarExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GaugeExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GeoChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/IntervalExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/MapExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/OrgChartExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/SankeyExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TableExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TimelineExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TreeMapExample.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/util/DateUtils.java create mode 100644 gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/shared/FieldVerifier.java create mode 100644 gwt-charts-showcase/src/main/resources/META-INF/jdoconfig.xml create mode 100644 gwt-charts-showcase/src/main/resources/com/googlecode/gwt/charts/showcase/client/headerLogo.png create mode 100644 gwt-charts-showcase/src/main/resources/com/googlecode/gwt/charts/showcase/client/showcase.css create mode 100644 gwt-charts-showcase/src/main/resources/log4j.properties create mode 100644 gwt-charts/.checkstyle create mode 100644 gwt-charts/.classpath create mode 100644 gwt-charts/.project create mode 100644 gwt-charts/.settings/com.google.gdt.eclipse.core.prefs create mode 100644 gwt-charts/.settings/com.google.gwt.eclipse.core.prefs create mode 100644 gwt-charts/.settings/gwt-checkstyle.xml create mode 100644 gwt-charts/.settings/org.eclipse.core.resources.prefs create mode 100644 gwt-charts/.settings/org.eclipse.jdt.core.prefs create mode 100644 gwt-charts/.settings/org.eclipse.jdt.ui.prefs create mode 100644 gwt-charts/.settings/org.eclipse.m2e.core.prefs create mode 100644 gwt-charts/.settings/org.eclipse.wst.jsdt.core.prefs create mode 100644 gwt-charts/.settings/org.jboss.ide.eclipse.as.core.prefs create mode 100644 gwt-charts/pom.xml create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/BoundingBox.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartEditor.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLayoutInterface.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLoader.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartObject.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartPackage.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWidget.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperObject.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperSpec.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnFunction.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnRange.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataCell.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataColumn.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataLiteral.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataRow.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataSource.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataTable.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataView.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataViewColumn.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DateRange.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/HasListeners.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/Properties.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RoleType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RowFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/Selection.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/SortColumn.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/TimeOfDay.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/annotationchart/AnnotationChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/annotationchart/AnnotationChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/apiloader/ApiLoader.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/apiloader/ApiLoaderOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/apiloader/ExceptionHelper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/calendar/Calendar.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/calendar/CalendarOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/Control.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlOptionsUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlWrapper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlWrapperObject.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/ControlWrapperSpec.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/Dashboard.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/DashboardObject.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/CategoryFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/CategoryFilterOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/CategoryFilterState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/CategoryFilterUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/ChartRangeFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/ChartRangeFilterOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/ChartRangeFilterState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/ChartRangeFilterStateRange.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/ChartRangeFilterUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/DateRangeFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/DateRangeFilterOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/DateRangeFilterState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/DateRangeFilterUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/NumberRangeFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/NumberRangeFilterOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/NumberRangeFilterState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/NumberRangeFilterUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/StringFilter.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/StringFilterOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/StringFilterState.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/controls/filter/StringFilterUi.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/AreaChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/AreaChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/AreaChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BarChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BarChartDiff.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BarChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BarChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BubbleChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BubbleChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/BubbleChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/CandlestickChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/CandlestickChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/CandlestickChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ColumnChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ColumnChartDiff.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ColumnChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ColumnChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ComboChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ComboChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ComboChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/CoreChartWidget.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/Histogram.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/HistogramOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/HistogramSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/LineChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/LineChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/LineChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/PieChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/PieChartDiff.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/PieChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/PieChartTooltip.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ScatterChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ScatterChartDiff.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ScatterChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/ScatterChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/SteppedAreaChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/SteppedAreaChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/corechart/SteppedAreaChartSeries.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/AnimationFinishEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/AnimationFinishHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/CancelEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/CancelHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/CollapseEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/CollapseHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/ErrorEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/ErrorHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/Event.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/EventHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/HandlerRef.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OkEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OkHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OnMouseOutEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OnMouseOutHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OnMouseOverEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/OnMouseOverHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/PageEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/PageHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RangeChangeEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RangeChangeHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/ReadyEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/ReadyHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RegionClickEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RegionClickHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RollUpEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/RollUpHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/SelectEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/SelectHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/SortEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/SortHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/StateChangeEvent.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/event/StateChangeHandler.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/ArrowFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/ArrowFormatOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/BarFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/BarFormatOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/ColorFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/DateFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/DateFormatOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/NumberFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/NumberFormatOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/format/PatternFormat.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/gauge/Gauge.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/gauge/GaugeOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/GeoChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/GeoChartColorAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/GeoChartLegend.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/GeoChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/GeoChartTooltip.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/geochart/MagnifyingGlass.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/map/Map.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/map/MapOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/AggregationTarget.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Animation.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/AnimationEasing.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/AnnotationTextStyle.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Annotations.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Axis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/AxisTitlesPosition.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/BackgroundColor.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Bar.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/BarFormatColor.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/BoxStyle.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Bubble.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Candlestick.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CellColor.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ChartArea.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Color.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ColorAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ColorAxisLegend.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ColoredLegendPosition.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CoreOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Crosshair.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CrosshairOrientation.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CrosshairProperties.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CrosshairTrigger.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/CurveType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Direction.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/DisplayMode.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Explorer.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ExplorerAction.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ExplorerAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/FocusTarget.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/FormatType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Gradient.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Gridlines.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/HAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Interval.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/IntervalStyle.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/LabelStacking.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Legend.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/LegendAlignment.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/LegendPosition.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/MapType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/MatchType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Options.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Orientation.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/PieSliceText.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/PointShape.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/PointShapeType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Resolution.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ScaleType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/SelectedValuesLayout.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/SelectionMode.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/SeriesType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/SizeAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Slice.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TextPosition.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TextStyle.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Tick.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TitlePosition.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Tooltip.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TooltipText.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TooltipTrigger.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/Trendline.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/TrendlineType.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/VAxis.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ViewWindow.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/options/ViewWindowMode.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/orgchart/OrgChart.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/orgchart/OrgChartOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/orgchart/OrgChartSize.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/query/Query.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/query/QueryCallback.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/query/QueryOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/query/QueryResponse.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/query/SendMethod.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/sankey/Sankey.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/sankey/SankeyLink.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/sankey/SankeyNode.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/sankey/SankeyOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/CssClassNames.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/Table.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/TableOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/TablePage.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/TableSort.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/table/TableSortInfo.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/timeline/Timeline.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/timeline/TimelineOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/treemap/TreeMap.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/treemap/TreeMapOptions.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/util/ArrayHelper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/util/ChartHelper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/util/DateHelper.java create mode 100644 gwt-charts/src/main/java/com/googlecode/gwt/charts/client/util/GadgetHelper.java create mode 100644 gwt-charts/src/main/resources/com/googlecode/gwt/charts/Charts.gwt.xml create mode 100644 gwt-charts/src/main/webapp/WEB-INF/web.xml create mode 100644 gwt-charts/src/main/webapp/index.html diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/gwt-charts-showcase/.classpath b/gwt-charts-showcase/.classpath new file mode 100644 index 0000000..54b6cfa --- /dev/null +++ b/gwt-charts-showcase/.classpath @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt-charts-showcase/.project b/gwt-charts-showcase/.project new file mode 100644 index 0000000..7603df2 --- /dev/null +++ b/gwt-charts-showcase/.project @@ -0,0 +1,45 @@ + + + gwt-charts-showcase + + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.google.gdt.eclipse.core.webAppProjectValidator + + + + + com.google.gwt.eclipse.core.gwtProjectValidator + + + + + com.google.appengine.eclipse.core.projectValidator + + + + + com.google.appengine.eclipse.core.enhancerbuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + com.google.appengine.eclipse.core.gaeNature + com.google.gwt.eclipse.core.gwtNature + + diff --git a/gwt-charts-showcase/.settings/com.google.appengine.eclipse.core.prefs b/gwt-charts-showcase/.settings/com.google.appengine.eclipse.core.prefs new file mode 100644 index 0000000..c75ed8b --- /dev/null +++ b/gwt-charts-showcase/.settings/com.google.appengine.eclipse.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.9.17.jar|appengine-api-labs.jar|appengine-endpoints-deps.jar|appengine-endpoints.jar|appengine-jsr107cache-1.9.17.jar|datanucleus-appengine-1.0.10.final.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar|jsr107cache-1.1.jar +gaeDeployDialogSettings= +gaeHrdEnabled=true +gaeIsEclipseDefaultInstPath=true +gaeLaunchAppInBrowser=true +googleCloudSqlEnabled=false +localDevMySqlEnabled=true diff --git a/gwt-charts-showcase/.settings/com.google.gdt.eclipse.core.prefs b/gwt-charts-showcase/.settings/com.google.gdt.eclipse.core.prefs new file mode 100644 index 0000000..ab0a8b7 --- /dev/null +++ b/gwt-charts-showcase/.settings/com.google.gdt.eclipse.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +jarsExcludedFromWebInfLib= +launchConfigExternalUrlPrefix= +warSrcDir=war +warSrcDirIsOutput=true diff --git a/gwt-charts-showcase/.settings/com.google.gwt.eclipse.core.prefs b/gwt-charts-showcase/.settings/com.google.gwt.eclipse.core.prefs new file mode 100644 index 0000000..39b2cc6 --- /dev/null +++ b/gwt-charts-showcase/.settings/com.google.gwt.eclipse.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +entryPointModules= +filesCopiedToWebInfLib= +gwtCompileSettings=PGd3dC1jb21waWxlLXNldHRpbmdzPjxsb2ctbGV2ZWw+SU5GTzwvbG9nLWxldmVsPjxvdXRwdXQtc3R5bGU+T0JGVVNDQVRFRDwvb3V0cHV0LXN0eWxlPjxleHRyYS1hcmdzPjwhW0NEQVRBWy1zdHJpY3RdXT48L2V4dHJhLWFyZ3M+PHZtLWFyZ3M+PCFbQ0RBVEFbLVhteDUxMm1dXT48L3ZtLWFyZ3M+PGVudHJ5LXBvaW50LW1vZHVsZT5jb20uZ29vZ2xlY29kZS5nd3QuY2hhcnRzLnNob3djYXNlLlNob3djYXNlPC9lbnRyeS1wb2ludC1tb2R1bGU+PC9nd3QtY29tcGlsZS1zZXR0aW5ncz4\= diff --git a/gwt-charts-showcase/.settings/org.eclipse.core.resources.prefs b/gwt-charts-showcase/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..ac9e8f6 --- /dev/null +++ b/gwt-charts-showcase/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/java/com/googlecode/gwt/charts/showcase/client/controls=UTF-8 +encoding//src/main/java/com/googlecode/gwt/charts/showcase/client/corechart=UTF-8 +encoding//src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart=UTF-8 +encoding//src/main/java/com/googlecode/gwt/charts/showcase/client/others=UTF-8 +encoding//src/main/resources=UTF-8 +encoding/=UTF-8 diff --git a/gwt-charts-showcase/.settings/org.eclipse.jdt.core.prefs b/gwt-charts-showcase/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c788ee3 --- /dev/null +++ b/gwt-charts-showcase/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/gwt-charts-showcase/.settings/org.eclipse.m2e.core.prefs b/gwt-charts-showcase/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..7b3914c --- /dev/null +++ b/gwt-charts-showcase/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Tue May 29 15:10:13 BST 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/gwt-charts-showcase/pom.xml b/gwt-charts-showcase/pom.xml new file mode 100644 index 0000000..519755b --- /dev/null +++ b/gwt-charts-showcase/pom.xml @@ -0,0 +1,142 @@ + + + 4.0.0 + com.google.code.gwt-charts + gwt-charts-showcase + 0.9.10 + jar + + GWT Charts Showcase + Showcase for GWT Charts + http://gwt-charts.appspot.com + 2012 + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + http://gwt-charts.googlecode.com/svn/trunk/ + scm:svn:http://gwt-charts.googlecode.com/svn/trunk/ + + + + + com.google.gwt + gwt-user + 2.6.0 + provided + + + com.googlecode.gwt-charts + gwt-charts + 0.9.10 + provided + + + + + + + src/main/java/com/googlecode/gwt/charts/showcase/client/controls + source + + + src/main/java/com/googlecode/gwt/charts/showcase/client/corechart + source + + + src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart + source + + + src/main/java/com/googlecode/gwt/charts/showcase/client/others + source + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + maven-resources-plugin + 2.5 + + war + + + + org.apache.maven.plugins + maven-war-plugin + 2.1.1 + + src/main/webapp + src/main/webapp/WEB-INF/web.xml + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.codehaus.mojo + + + gwt-maven-plugin + + + [2.6.0,) + + + resources + + + + + + + + + + + + + + + + http://code.google.com/p/gwt-charts/issues + Google Code + + + + UTF-8 + + \ No newline at end of file diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/Showcase.gwt.xml b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/Showcase.gwt.xml new file mode 100644 index 0000000..8babf68 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/Showcase.gwt.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/AppMainPanel.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/AppMainPanel.java new file mode 100644 index 0000000..232bad3 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/AppMainPanel.java @@ -0,0 +1,228 @@ +package com.googlecode.gwt.charts.showcase.client; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; +import com.google.gwt.user.client.History; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.google.gwt.user.client.ui.Image; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.RequiresResize; +import com.google.gwt.user.client.ui.SplitLayoutPanel; +import com.google.gwt.user.client.ui.Widget; +import com.googlecode.gwt.charts.showcase.client.controls.CategoryFilterExample; +import com.googlecode.gwt.charts.showcase.client.controls.ChartRangeFilterExample; +import com.googlecode.gwt.charts.showcase.client.controls.DateRangeFilterExample; +import com.googlecode.gwt.charts.showcase.client.controls.NumberRangeFilterExample; +import com.googlecode.gwt.charts.showcase.client.controls.StringFilterExample; +import com.googlecode.gwt.charts.showcase.client.corechart.AreaChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.BarChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.BubbleChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.CandlestickChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.ColumnChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.ComboChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.HistogramExample; +import com.googlecode.gwt.charts.showcase.client.corechart.LineChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.PieChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.ScatterChartExample; +import com.googlecode.gwt.charts.showcase.client.corechart.SteppedAreaChartExample; +import com.googlecode.gwt.charts.showcase.client.diffchart.DiffBarChartExample; +import com.googlecode.gwt.charts.showcase.client.diffchart.DiffColumnChartExample; +import com.googlecode.gwt.charts.showcase.client.diffchart.DiffPieChartExample; +import com.googlecode.gwt.charts.showcase.client.diffchart.DiffScatterChartExample; +import com.googlecode.gwt.charts.showcase.client.others.AnnotationChartExample; +import com.googlecode.gwt.charts.showcase.client.others.CalendarExample; +import com.googlecode.gwt.charts.showcase.client.others.GaugeExample; +import com.googlecode.gwt.charts.showcase.client.others.GeoChartExample; +import com.googlecode.gwt.charts.showcase.client.others.IntervalExample; +import com.googlecode.gwt.charts.showcase.client.others.MapExample; +import com.googlecode.gwt.charts.showcase.client.others.OrgChartExample; +import com.googlecode.gwt.charts.showcase.client.others.SankeyExample; +import com.googlecode.gwt.charts.showcase.client.others.TableExample; +import com.googlecode.gwt.charts.showcase.client.others.TimelineExample; +import com.googlecode.gwt.charts.showcase.client.others.TreeMapExample; + +public class AppMainPanel extends Composite implements ValueChangeHandler, RequiresResize { + private SplitLayoutPanel splitLayoutPanel; + private DockLayoutPanel dockLayoutPanel; + private DockLayoutPanel headerPanel; + private SideMenu sideMenu; + private ExampleWidget simpleLayoutPanel; + + public AppMainPanel() { + super(); + initialize(); + } + + private void initialize() { + initWidget(getDockLayoutPanel()); + } + + private DockLayoutPanel getDockLayoutPanel() { + if (dockLayoutPanel == null) { + dockLayoutPanel = new DockLayoutPanel(Unit.PX); + dockLayoutPanel.addNorth(getHeaderPanel(), 70); + dockLayoutPanel.add(getSplitLayoutPanel()); + } + return dockLayoutPanel; + } + + private SplitLayoutPanel getSplitLayoutPanel() { + if (splitLayoutPanel == null) { + splitLayoutPanel = new SplitLayoutPanel(6); + splitLayoutPanel.addWest(getSideMenu(), 150); + splitLayoutPanel.add(getSimpleLayoutPanel()); + } + return splitLayoutPanel; + } + + private DockLayoutPanel getHeaderPanel() { + if (headerPanel == null) { + headerPanel = new DockLayoutPanel(Unit.PX); + headerPanel.addWest(new Image(Resources.INSTANCE.headerLogo()), 70); + Label label = new Label("GWT Charts - Unofficial Google Chart Tools API for Google Web Toolkit"); + label.setStyleName(Resources.INSTANCE.css().headerText()); + headerPanel.add(label); + } + return headerPanel; + } + + private ExampleWidget getSimpleLayoutPanel() { + if (simpleLayoutPanel == null) { + simpleLayoutPanel = new ExampleWidget(); + } + return simpleLayoutPanel; + } + + private SideMenu getSideMenu() { + if (sideMenu == null) { + sideMenu = new SideMenu(); + sideMenu.add("Charts"); + sideMenu.add("Annotation", "annotation"); + sideMenu.add("Area", "area"); + sideMenu.add("Bar", "bar"); + sideMenu.add("Bubble", "bubble"); + sideMenu.add("Calendar", "calendar"); + sideMenu.add("Candlestick", "candlestick"); + sideMenu.add("Column", "column"); + sideMenu.add("Combo", "combo"); + sideMenu.add("Gauge", "gauge"); + sideMenu.add("Geo Chart", "geochart"); + sideMenu.add("Histogram", "histogram"); + sideMenu.add("Line", "line"); + sideMenu.add("Map", "map"); + sideMenu.add("Org Chart", "orgchart"); + sideMenu.add("Pie", "pie"); + sideMenu.add("Sankey Diagram", "sankey"); + sideMenu.add("Scatter", "scatter"); + sideMenu.add("Stepped Area", "steppedarea"); + sideMenu.add("Table", "table"); + sideMenu.add("Timeline", "timeline"); + sideMenu.add("Tree Map", "treemap"); + sideMenu.add("Diff Charts"); + sideMenu.add("Bar", "diffbar"); + sideMenu.add("Column", "diffcolumn"); + sideMenu.add("Pie", "diffpie"); + sideMenu.add("Scatter", "diffscatter"); + sideMenu.add("Other Charts"); + sideMenu.add("Interval", "interval"); + sideMenu.add("Controls"); + sideMenu.add("Category Filter", "categoryfilter"); + sideMenu.add("Chart Range Filter", "chartrangefilter"); + sideMenu.add("Date Range Filter", "daterangefilter"); + sideMenu.add("Number Range Filter", "numberrangefilter"); + sideMenu.add("String Filter", "stringfilter"); + sideMenu.addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + History.newItem(event.getSelectedItem(), true); + } + }); + } + return sideMenu; + } + + private void fireSelectionChanged(String key) { + Widget widget = null; + if (key.equals("area")) { + widget = new AreaChartExample(); + } else if (key.equals("bar")) { + widget = new BarChartExample(); + } else if (key.equals("bubble")) { + widget = new BubbleChartExample(); + } else if (key.equals("candlestick")) { + widget = new CandlestickChartExample(); + } else if (key.equals("column")) { + widget = new ColumnChartExample(); + } else if (key.equals("combo")) { + widget = new ComboChartExample(); + } else if (key.equals("histogram")) { + widget = new HistogramExample(); + } else if (key.equals("line")) { + widget = new LineChartExample(); + } else if (key.equals("pie")) { + widget = new PieChartExample(); + } else if (key.equals("scatter")) { + widget = new ScatterChartExample(); + } else if (key.equals("steppedarea")) { + widget = new SteppedAreaChartExample(); + } else if (key.equals("diffbar")) { + widget = new DiffBarChartExample(); + } else if (key.equals("diffcolumn")) { + widget = new DiffColumnChartExample(); + } else if (key.equals("diffpie")) { + widget = new DiffPieChartExample(); + } else if (key.equals("diffscatter")) { + widget = new DiffScatterChartExample(); + } else if (key.equals("annotation")) { + widget = new AnnotationChartExample(); + } else if (key.equals("calendar")) { + widget = new CalendarExample(); + } else if (key.equals("gauge")) { + widget = new GaugeExample(); + } else if (key.equals("geochart")) { + widget = new GeoChartExample(); + } else if (key.equals("interval")) { + widget = new IntervalExample(); + } else if (key.equals("map")) { + widget = new MapExample(); + } else if (key.equals("orgchart")) { + widget = new OrgChartExample(); + } else if (key.equals("sankey")) { + widget = new SankeyExample(); + } else if (key.equals("table")) { + widget = new TableExample(); + } else if (key.equals("timeline")) { + widget = new TimelineExample(); + } else if (key.equals("treemap")) { + widget = new TreeMapExample(); + } else if (key.equals("categoryfilter")) { + widget = new CategoryFilterExample(); + } else if (key.equals("chartrangefilter")) { + widget = new ChartRangeFilterExample(); + } else if (key.equals("daterangefilter")) { + widget = new DateRangeFilterExample(); + } else if (key.equals("numberrangefilter")) { + widget = new NumberRangeFilterExample(); + } else if (key.equals("stringfilter")) { + widget = new StringFilterExample(); + } + + simpleLayoutPanel.setSampleWidget(widget); + } + + @Override + public void onResize() { + dockLayoutPanel.onResize(); + } + + @Override + public void onValueChange(ValueChangeEvent event) { + sideMenu.setSelection(event.getValue(), false); + fireSelectionChanged(event.getValue()); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/ExampleWidget.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/ExampleWidget.java new file mode 100644 index 0000000..b1649de --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/ExampleWidget.java @@ -0,0 +1,113 @@ +package com.googlecode.gwt.charts.showcase.client; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.event.logical.shared.BeforeSelectionEvent; +import com.google.gwt.event.logical.shared.BeforeSelectionHandler; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.http.client.Request; +import com.google.gwt.http.client.RequestBuilder; +import com.google.gwt.http.client.RequestCallback; +import com.google.gwt.http.client.RequestException; +import com.google.gwt.http.client.Response; +import com.google.gwt.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.ui.HTML; +import com.google.gwt.user.client.ui.ScrollPanel; +import com.google.gwt.user.client.ui.SimpleLayoutPanel; +import com.google.gwt.user.client.ui.TabLayoutPanel; +import com.google.gwt.user.client.ui.Widget; + +public class ExampleWidget extends TabLayoutPanel { + private SimpleLayoutPanel layoutPanel; + private ScrollPanel scrollPanel; + private HTML sourceCodeWidget; + + public ExampleWidget() { + super(30, Unit.PX); + initialize(); + } + + public void setSampleWidget(Widget widget) { + layoutPanel.setWidget(widget); + loadSource(); + } + + private SimpleLayoutPanel getLayoutPanel() { + if (layoutPanel == null) { + layoutPanel = new SimpleLayoutPanel(); + } + return layoutPanel; + } + + private ScrollPanel getScrollPanel() { + if (scrollPanel == null) { + scrollPanel = new ScrollPanel(); + scrollPanel.setWidget(getSourceCodeWidget()); + } + return scrollPanel; + } + + private HTML getSourceCodeWidget() { + if (sourceCodeWidget == null) { + sourceCodeWidget = new HTML(); + } + return sourceCodeWidget; + } + + private void initialize() { + add(getLayoutPanel(), "Example"); + add(getScrollPanel(), "Source Code"); + addBeforeSelectionHandler(new BeforeSelectionHandler() { + + @Override + public void onBeforeSelection(BeforeSelectionEvent event) { + if (event.getItem() == 1) { + loadSource(); + } + } + }); + addSelectionHandler(new SelectionHandler() { + + @Override + public void onSelection(SelectionEvent event) { + if (event.getSelectedItem() == 0) { + layoutPanel.onResize(); + } + } + }); + } + + protected void loadSource() { + RequestCallback callback = new RequestCallback() { + + @Override + public void onError(Request request, Throwable exception) { + // TODO Auto-generated method stub + } + + @Override + public void onResponseReceived(Request request, Response response) { + setSource(response.getText()); + } + }; + try { + String className = layoutPanel.getWidget().getClass().getName(); + className = className.substring(className.lastIndexOf(".") + 1); + + RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, "source/" + className + ".java"); + builder.setCallback(callback); + builder.send(); + } catch (RequestException e) { + callback.onError(null, e); + } + } + + protected void setSource(String text) { + SafeHtmlBuilder builder = new SafeHtmlBuilder(); + builder.appendHtmlConstant("
");
+		builder.appendEscaped(text);
+		builder.appendHtmlConstant("
"); + sourceCodeWidget.setHTML(builder.toSafeHtml()); + } + +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Resources.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Resources.java new file mode 100644 index 0000000..5bfbfe1 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Resources.java @@ -0,0 +1,26 @@ +package com.googlecode.gwt.charts.showcase.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.resources.client.ClientBundle; +import com.google.gwt.resources.client.CssResource; +import com.google.gwt.resources.client.ImageResource; + +public interface Resources extends ClientBundle { + Resources INSTANCE = GWT.create(Resources.class); + + public interface Stylesheet extends CssResource { + String menuHeader(); + + String menuItem(); + + String menuItemSelected(); + + String headerText(); + } + + @Source("showcase.css") + Stylesheet css(); + + ImageResource headerLogo(); + +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Showcase.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Showcase.java new file mode 100644 index 0000000..c2fc20f --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/Showcase.java @@ -0,0 +1,35 @@ +package com.googlecode.gwt.charts.showcase.client; + +import com.google.gwt.core.client.EntryPoint; +import com.google.gwt.user.client.History; +import com.google.gwt.user.client.Window; +import com.google.gwt.user.client.ui.RootLayoutPanel; + +/** + * Entry point classes define onModuleLoad(). + */ +public class Showcase implements EntryPoint { + private AppMainPanel appMainPanel; + + /** + * This is the entry point method. + */ + @Override + public void onModuleLoad() { + Window.enableScrolling(false); + Window.setMargin("0px"); + Resources.INSTANCE.css().ensureInjected(); + RootLayoutPanel.get().add(getAppMainPanel()); + History.addValueChangeHandler(getAppMainPanel()); + History.fireCurrentHistoryState(); + } + + private AppMainPanel getAppMainPanel() { + if (appMainPanel == null) { + appMainPanel = new AppMainPanel(); + } + return appMainPanel; + } + + +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/SideMenu.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/SideMenu.java new file mode 100644 index 0000000..4519380 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/SideMenu.java @@ -0,0 +1,87 @@ +package com.googlecode.gwt.charts.showcase.client; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.gwt.dom.client.Style.Overflow; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.logical.shared.HasSelectionHandlers; +import com.google.gwt.event.logical.shared.SelectionEvent; +import com.google.gwt.event.logical.shared.SelectionHandler; +import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.Widget; + +public class SideMenu extends Composite implements HasSelectionHandlers { + private FlowPanel flowPanel; + private Map keyMap; + + public SideMenu() { + super(); + initialize(); + } + + public void add(String string) { + Label label = new Label(string); + label.setStyleName(Resources.INSTANCE.css().menuHeader()); + flowPanel.add(label); + } + + public void add(String string, String key) { + final Label label = new Label(string); + label.setStyleName(Resources.INSTANCE.css().menuItem()); + label.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + setSelection(label, true); + } + }); + keyMap.put(key, label); + flowPanel.add(label); + } + + @Override + public HandlerRegistration addSelectionHandler(SelectionHandler handler) { + return addHandler(handler, SelectionEvent.getType()); + } + + public void setSelection(String key, boolean fireEvents) { + for (int i = 0; i < flowPanel.getWidgetCount(); i++) { + Label label = (Label) flowPanel.getWidget(i); + if (keyMap.get(key) == label) { + label.addStyleName(Resources.INSTANCE.css().menuItemSelected()); + } else { + label.removeStyleName(Resources.INSTANCE.css().menuItemSelected()); + } + } + if (fireEvents) { + SelectionEvent.fire(this, key); + } + } + + public void setSelection(Widget widget, boolean fireEvents) { + for (Entry entry : keyMap.entrySet()) { + if (entry.getValue().equals(widget)) { + setSelection(entry.getKey(), fireEvents); + } + } + } + + private FlowPanel getFlowPanel() { + if (flowPanel == null) { + flowPanel = new FlowPanel(); + flowPanel.getElement().getStyle().setOverflow(Overflow.AUTO); + } + return flowPanel; + } + + private void initialize() { + initWidget(getFlowPanel()); + keyMap = new HashMap(); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/CategoryFilterExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/CategoryFilterExample.java new file mode 100644 index 0000000..d1e8d02 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/CategoryFilterExample.java @@ -0,0 +1,96 @@ +package com.googlecode.gwt.charts.showcase.client.controls; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ChartType; +import com.googlecode.gwt.charts.client.ChartWrapper; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.controls.Dashboard; +import com.googlecode.gwt.charts.client.controls.filter.CategoryFilter; +import com.googlecode.gwt.charts.client.controls.filter.CategoryFilterOptions; +import com.googlecode.gwt.charts.client.controls.filter.CategoryFilterState; +import com.googlecode.gwt.charts.client.controls.filter.CategoryFilterUi; +import com.googlecode.gwt.charts.client.gauge.GaugeOptions; +import com.googlecode.gwt.charts.client.options.SelectedValuesLayout; + +public class CategoryFilterExample extends DockLayoutPanel { + private Dashboard dashboard; + private ChartWrapper gaugeWrapper; + private CategoryFilter categoryFilter; + + public CategoryFilterExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CONTROLS); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + addNorth(getDashboardWidget(), 0); + addWest(getCategoryFilter(), 200); + add(getGaugeWrapper()); + draw(); + } + }); + } + + private Dashboard getDashboardWidget() { + if (dashboard == null) { + dashboard = new Dashboard(); + } + return dashboard; + } + + private ChartWrapper getGaugeWrapper() { + if (gaugeWrapper == null) { + gaugeWrapper = new ChartWrapper(); + gaugeWrapper.setChartType(ChartType.GAUGE); + } + return gaugeWrapper; + } + + private CategoryFilter getCategoryFilter() { + if (categoryFilter == null) { + categoryFilter = new CategoryFilter(); + } + return categoryFilter; + } + + private void draw() { + // Set control options + CategoryFilterOptions categoryFilterOptions = CategoryFilterOptions.create(); + categoryFilterOptions.setFilterColumnIndex(0); + CategoryFilterUi categoryFilterUi = CategoryFilterUi.create(); + categoryFilterUi.setAllowMultiple(true); + categoryFilterUi.setAllowTyping(false); + categoryFilterUi.setSelectedValuesLayout(SelectedValuesLayout.BELOW_STACKED); + categoryFilterOptions.setUi(categoryFilterUi); + categoryFilter.setOptions(categoryFilterOptions); + CategoryFilterState categoryFilterState = CategoryFilterState.create(); + categoryFilterState.setSelectedValues("CPU", "Memory"); + categoryFilter.setState(categoryFilterState); + + // Set chart options + GaugeOptions gaugeOptions = GaugeOptions.create(); + gaugeWrapper.setOptions(gaugeOptions); + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Metric"); + dataTable.addColumn(ColumnType.NUMBER, "Value"); + dataTable.addRow("CPU" , 12); + dataTable.addRow("Memory", 20); + dataTable.addRow("Disk", 7); + dataTable.addRow("Network", 54); + + // Draw the chart + dashboard.bind(categoryFilter, gaugeWrapper); + dashboard.draw(dataTable); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/ChartRangeFilterExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/ChartRangeFilterExample.java new file mode 100644 index 0000000..cc57fbe --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/ChartRangeFilterExample.java @@ -0,0 +1,123 @@ +package com.googlecode.gwt.charts.showcase.client.controls; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ChartType; +import com.googlecode.gwt.charts.client.ChartWrapper; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.controls.Dashboard; +import com.googlecode.gwt.charts.client.controls.filter.ChartRangeFilter; +import com.googlecode.gwt.charts.client.controls.filter.ChartRangeFilterOptions; +import com.googlecode.gwt.charts.client.controls.filter.ChartRangeFilterState; +import com.googlecode.gwt.charts.client.controls.filter.ChartRangeFilterStateRange; +import com.googlecode.gwt.charts.client.controls.filter.ChartRangeFilterUi; +import com.googlecode.gwt.charts.client.corechart.LineChartOptions; +import com.googlecode.gwt.charts.client.options.ChartArea; +import com.googlecode.gwt.charts.client.options.Legend; +import com.googlecode.gwt.charts.client.options.LegendPosition; +import com.googlecode.gwt.charts.showcase.client.util.DateUtils; + +public class ChartRangeFilterExample extends DockLayoutPanel { + private Dashboard dashboard; + private ChartWrapper lineChart; + private ChartRangeFilter numberRangeFilter; + + public ChartRangeFilterExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CONTROLS); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + addNorth(getDashboardWidget(), 0); + addSouth(getNumberRangeFilter(), 100); + add(getLineChart()); + draw(); + } + }); + } + + private Dashboard getDashboardWidget() { + if (dashboard == null) { + dashboard = new Dashboard(); + } + return dashboard; + } + + private ChartWrapper getLineChart() { + if (lineChart == null) { + lineChart = new ChartWrapper(); + lineChart.setChartType(ChartType.LINE); + } + return lineChart; + } + + private ChartRangeFilter getNumberRangeFilter() { + if (numberRangeFilter == null) { + numberRangeFilter = new ChartRangeFilter(); + } + return numberRangeFilter; + } + + private void draw() { + // Set control options + ChartRangeFilterOptions chartRangeFilterOptions = ChartRangeFilterOptions.create(); + chartRangeFilterOptions.setFilterColumnIndex(0); // Filter by the date axis + LineChartOptions controlChartOptions = LineChartOptions.create(); + controlChartOptions.setHeight(100); + ChartArea chartArea = ChartArea.create(); + chartArea.setWidth("90%"); + chartArea.setHeight("90%"); + controlChartOptions.setChartArea(chartArea); + ChartRangeFilterUi chartRangeFilterUi = ChartRangeFilterUi.create(); + chartRangeFilterUi.setChartType(ChartType.LINE); + chartRangeFilterUi.setChartOptions(controlChartOptions); + chartRangeFilterUi.setMinRangeSize(2 * 24 * 60 * 60 * 1000); // 2 days in milliseconds + chartRangeFilterOptions.setUi(chartRangeFilterUi); + ChartRangeFilterStateRange stateRange = ChartRangeFilterStateRange.create(); + stateRange.setStart(DateUtils.create(2012, 2, 9)); + stateRange.setEnd(DateUtils.create(2012, 3, 20)); + ChartRangeFilterState controlState = ChartRangeFilterState.create(); + controlState.setRange(stateRange); + numberRangeFilter.setState(controlState); + numberRangeFilter.setOptions(chartRangeFilterOptions); + + // Set chart options + LineChartOptions lineChartOptions = LineChartOptions.create(); + lineChartOptions.setLineWidth(3); + lineChartOptions.setLegend(Legend.create(LegendPosition.NONE)); + lineChartOptions.setChartArea(chartArea); + lineChart.setOptions(lineChartOptions); + + // Generate random data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.DATE, "Date"); + dataTable.addColumn(ColumnType.NUMBER, "Stock value"); + dataTable.addRows(121); + + double open, close = 300; + double low, high; + for (int day = 1; day < 121; ++day) { + double change = (Math.sin(day / 2.5 + Math.PI) + Math.sin(day / 3) - Math.cos(day * 0.7)) * 150; + change = change >= 0 ? change + 10 : change - 10; + open = close; + close = Math.max(50, open + change); + low = Math.min(open, close) - (Math.cos(day * 1.7) + 1) * 15; + low = Math.max(0, low); + high = Math.max(open, close) + (Math.cos(day * 1.3) + 1) * 15; + dataTable.setValue(day, 0, DateUtils.create(2012, 1, day)); + dataTable.setValue(day, 1, Math.round(high)); + } + + // Draw the chart + dashboard.bind(numberRangeFilter, lineChart); + dashboard.draw(dataTable); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/DateRangeFilterExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/DateRangeFilterExample.java new file mode 100644 index 0000000..7d2c757 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/DateRangeFilterExample.java @@ -0,0 +1,117 @@ +package com.googlecode.gwt.charts.showcase.client.controls; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ChartType; +import com.googlecode.gwt.charts.client.ChartWrapper; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.controls.Dashboard; +import com.googlecode.gwt.charts.client.controls.filter.DateRangeFilter; +import com.googlecode.gwt.charts.client.controls.filter.DateRangeFilterOptions; +import com.googlecode.gwt.charts.client.controls.filter.DateRangeFilterUi; +import com.googlecode.gwt.charts.client.format.DateFormatOptions; +import com.googlecode.gwt.charts.client.table.TableOptions; +import com.googlecode.gwt.charts.client.util.ChartHelper; +import com.googlecode.gwt.charts.showcase.client.util.DateUtils; + +public class DateRangeFilterExample extends DockLayoutPanel { + private Dashboard dashboard; + private ChartWrapper tableWrapper; + private DateRangeFilter dateRangeFilter; + + public DateRangeFilterExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CONTROLS); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + addNorth(getDashboardWidget(), 0); + addNorth(getDateRangeFilter(), 30); + add(getTableWrapper()); + draw(); + } + }); + } + + private Dashboard getDashboardWidget() { + if (dashboard == null) { + dashboard = new Dashboard(); + } + return dashboard; + } + + private ChartWrapper getTableWrapper() { + if (tableWrapper == null) { + tableWrapper = new ChartWrapper(); + tableWrapper.setChartType(ChartType.TABLE); + } + return tableWrapper; + } + + private DateRangeFilter getDateRangeFilter() { + if (dateRangeFilter == null) { + dateRangeFilter = new DateRangeFilter(); + } + return dateRangeFilter; + } + + private void draw() { + // Set control options + DateRangeFilterOptions dateRangeFilterOptions = DateRangeFilterOptions.create(); + dateRangeFilterOptions.setFilterColumnLabel("Year"); + DateRangeFilterUi dateRangeFilterUi = DateRangeFilterUi.create(); + dateRangeFilterUi.setFormat(DateFormatOptions.create("yyyy")); + dateRangeFilterOptions.setUi(dateRangeFilterUi); + dateRangeFilter.setOptions(dateRangeFilterOptions); + + // Set chart options + TableOptions tableOptions = TableOptions.create(); + tableWrapper.setOptions(tableOptions); + + // Generate data + Object[][] dataArray = new Object[][] { + { "Extrasolar planet", "Comment", "Year" }, + { "Gamma Cephei Ab", "Deduced from radial velocity variations of the star Gamma Cephei", + DateUtils.create(1988, 6, 13) }, + { "HD 114762 b", "At least 11 times the mass of Jupiter", DateUtils.create(1989, 4, 4) }, + { "PSR B1257+12", "First confirmed discovery of an extrasolar planet", DateUtils.create(1992, 0, 22) }, + { "51 Pegasi b", "Hot Jupiter with a 4.2 day orbit", DateUtils.create(1995, 9, 6) }, + { "47 Ursae Majoris b", "First long-period planet discovered", DateUtils.create(1996, 0, 17) }, + { "Upsilon Andromedae", "First multiple planetary system around a main sequence star", + DateUtils.create(1996, 7, 12) }, + { "Gliese 876 b", "First planet found orbiting a red dwarf", DateUtils.create(1998, 5, 23) }, + { "HD 209458 b", "First exoplanet seen transiting its parent star", DateUtils.create(1999, 10, 5) }, + { "Iota Draconis b", "Provided evidence that planets can exist around giant stars", + DateUtils.create(2002, 0, 8) }, + { "PSR B1620-26 b", "12.7 billion year old planet orbiting a binary star system", + DateUtils.create(2003, 6, 10) }, + { "2M1207 b", "First planet found orbiting a brown dwarf", DateUtils.create(2004, 6, 22) }, + { "Mu Arae c", "Hot Neptune", DateUtils.create(2004, 7, 25) }, + { "TrES-1 and HD 209458 b", "First detection of light from exoplanets", DateUtils.create(2005, 2, 22) }, + { "OGLE-2005-BLG-390Lb", "Detected used gravitational microlensing", DateUtils.create(2006, 1, 25) }, + { "Gliese 581 c", "Inhospitable due to runaway greenhouse effect", DateUtils.create(2007, 3, 4) }, + { "Fomalhaut b", "First exoplanet directly imaged by optical telescope", DateUtils.create(2008, 10, 13) }, + { "GJ 1214 b", "Might be 75% water and 25% rock", DateUtils.create(2009, 11, 16) }, + { "HD 10180", "Seven planets orbiting a sun-like star", DateUtils.create(2010, 7, 24) }, + { "55 Cancri e", "Orbital period of just 0.73 days", DateUtils.create(2011, 3, 27) }, + { "Alpha Centauri Bb", "Earth-mass planet in the star system closest to ours", + DateUtils.create(2012, 9, 16) }, + { "PH2 b", "Potentially habitable Jupiter-sized planet", DateUtils.create(2013, 0, 13) }, + { "Kepler-69c", "First potentially habitable Earth-sized planet orbiting a sun-sized star", + DateUtils.create(2013, 3, 18) } }; + + // Prepare the data + DataTable dataTable = ChartHelper.arrayToDataTable(dataArray); + + // Draw the chart + dashboard.bind(dateRangeFilter, tableWrapper); + dashboard.draw(dataTable); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/NumberRangeFilterExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/NumberRangeFilterExample.java new file mode 100644 index 0000000..1891070 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/NumberRangeFilterExample.java @@ -0,0 +1,87 @@ +package com.googlecode.gwt.charts.showcase.client.controls; + +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsonUtils; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ChartType; +import com.googlecode.gwt.charts.client.ChartWrapper; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.controls.Dashboard; +import com.googlecode.gwt.charts.client.controls.filter.NumberRangeFilter; +import com.googlecode.gwt.charts.client.controls.filter.NumberRangeFilterOptions; +import com.googlecode.gwt.charts.client.corechart.BarChartOptions; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class NumberRangeFilterExample extends DockLayoutPanel { + private Dashboard dashboard; + private ChartWrapper barChartWrapper; + private NumberRangeFilter numberRangeFilter; + + public NumberRangeFilterExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CONTROLS); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + addNorth(getDashboardWidget(), 0); + addNorth(getNumberRangeFilter(), 100); + add(getBarChartWrapper()); + draw(); + } + }); + } + + private Dashboard getDashboardWidget() { + if (dashboard == null) { + dashboard = new Dashboard(); + } + return dashboard; + } + + private ChartWrapper getBarChartWrapper() { + if (barChartWrapper == null) { + barChartWrapper = new ChartWrapper(); + barChartWrapper.setChartType(ChartType.BAR); + } + return barChartWrapper; + } + + private NumberRangeFilter getNumberRangeFilter() { + if (numberRangeFilter == null) { + numberRangeFilter = new NumberRangeFilter(); + } + return numberRangeFilter; + } + + private void draw() { + // Set control options + NumberRangeFilterOptions numberRangeFilterOptions = NumberRangeFilterOptions.create(); + numberRangeFilterOptions.setFilterColumnLabel("Age"); + numberRangeFilterOptions.setMinValue(0); + numberRangeFilterOptions.setMaxValue(60); + numberRangeFilter.setOptions(numberRangeFilterOptions); + + // Set chart options + BarChartOptions barChartOptions = BarChartOptions.create(); + barChartWrapper.setOptions(barChartOptions); + + // Generate data + JsArrayMixed dataArray = JsonUtils + .unsafeEval("[['Name', 'Age'],['Michael' , 12],['Elisa', 20],['Robert', 7],['John', 54],['Jessica', 22],['Aaron', 3],['Margareth', 42],['Miranda', 33]]"); + + // Prepare the data + DataTable dataTable = ChartHelper.arrayToDataTable(dataArray); + + // Draw the chart + dashboard.bind(numberRangeFilter, barChartWrapper); + dashboard.draw(dataTable); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/StringFilterExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/StringFilterExample.java new file mode 100644 index 0000000..3680270 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/controls/StringFilterExample.java @@ -0,0 +1,81 @@ +package com.googlecode.gwt.charts.showcase.client.controls; + +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsonUtils; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ChartType; +import com.googlecode.gwt.charts.client.ChartWrapper; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.controls.Dashboard; +import com.googlecode.gwt.charts.client.controls.filter.StringFilter; +import com.googlecode.gwt.charts.client.controls.filter.StringFilterOptions; +import com.googlecode.gwt.charts.client.table.TableOptions; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class StringFilterExample extends DockLayoutPanel { + private Dashboard dashboard; + private ChartWrapper tableWrapper; + private StringFilter stringFilter; + + public StringFilterExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CONTROLS); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + addNorth(getDashboardWidget(), 0); + addNorth(getStringFilter(), 30); + add(getTableWrapper()); + draw(); + } + }); + } + + private Dashboard getDashboardWidget() { + if (dashboard == null) { + dashboard = new Dashboard(); + } + return dashboard; + } + + private ChartWrapper getTableWrapper() { + if (tableWrapper == null) { + tableWrapper = new ChartWrapper(); + tableWrapper.setChartType(ChartType.TABLE); + } + return tableWrapper; + } + + private StringFilter getStringFilter() { + if (stringFilter == null) { + stringFilter = new StringFilter(); + } + return stringFilter; + } + + private void draw() { + // Set control options + StringFilterOptions stringFilterOptions = StringFilterOptions.create(); + stringFilterOptions.setFilterColumnIndex(0); + stringFilter.setOptions(stringFilterOptions); + + // Generate data + JsArrayMixed dataArray = JsonUtils + .unsafeEval("[['Name', 'Age'],['Michael' , 12],['Elisa', 20],['Robert', 7],['John', 54],['Jessica', 22],['Aaron', 3],['Margareth', 42],['Miranda', 33]]"); + + // Prepare the data + DataTable dataTable = ChartHelper.arrayToDataTable(dataArray); + + // Draw the chart + dashboard.bind(stringFilter, tableWrapper); + dashboard.draw(dataTable); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/AreaChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/AreaChartExample.java new file mode 100644 index 0000000..105dde0 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/AreaChartExample.java @@ -0,0 +1,68 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.AreaChart; +import com.googlecode.gwt.charts.client.corechart.AreaChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class AreaChartExample extends DockLayoutPanel { + private AreaChart chart; + + public AreaChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new AreaChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + String[] countries = new String[] { "Bolivia", "Ecuador", "Madagascar", "Papua Guinea", "Rwanda" }; + String[] months = new String[] { "2004/05", "2005/06", "2006/07", "2007/08", "2008/09" }; + int[][] values = new int[][] { { 165, 135, 157, 139, 136 }, { 938, 1120, 1167, 1110, 691 }, + { 522, 599, 587, 615, 629 }, { 998, 1268, 807, 968, 1026 }, { 450, 288, 397, 215, 366 } }; + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Year"); + for (int i = 0; i < countries.length; i++) { + dataTable.addColumn(ColumnType.NUMBER, countries[i]); + } + dataTable.addRows(months.length); + for (int i = 0; i < months.length; i++) { + dataTable.setValue(i, 0, months[i]); + } + for (int col = 0; col < values.length; col++) { + for (int row = 0; row < values[col].length; row++) { + dataTable.setValue(row, col + 1, values[col][row]); + } + } + + // Set options + AreaChartOptions options = AreaChartOptions.create(); + options.setTitle("Monthly Coffee Production by Country"); + options.setIsStacked(true); + options.setHAxis(HAxis.create("Cups")); + options.setVAxis(VAxis.create("Year")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BarChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BarChartExample.java new file mode 100644 index 0000000..2f5ea18 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BarChartExample.java @@ -0,0 +1,70 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.BarChart; +import com.googlecode.gwt.charts.client.corechart.BarChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class BarChartExample extends DockLayoutPanel { + private BarChart chart; + + public BarChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new BarChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + String[] countries = new String[] { "Austria", "Bulgaria", "Denmark", "Greece" }; + int[] years = new int[] { 2003, 2004, 2005, 2006, 2007, 2008 }; + int[][] values = new int[][] { { 1336060, 1538156, 1576579, 1600652, 1968113, 1901067 }, + { 400361, 366849, 440514, 434552, 393032, 517206 }, + { 1001582, 1119450, 993360, 1004163, 979198, 916965 }, + { 997974, 941795, 930593, 897127, 1080887, 1056036 } }; + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Year"); + for (int i = 0; i < countries.length; i++) { + dataTable.addColumn(ColumnType.NUMBER, countries[i]); + } + dataTable.addRows(years.length); + for (int i = 0; i < years.length; i++) { + dataTable.setValue(i, 0, String.valueOf(years[i])); + } + for (int col = 0; col < values.length; col++) { + for (int row = 0; row < values[col].length; row++) { + dataTable.setValue(row, col + 1, values[col][row]); + } + } + + // Set options + BarChartOptions options = BarChartOptions.create(); + options.setFontName("Tahoma"); + options.setTitle("Yearly Coffee Consumption by Country"); + options.setHAxis(HAxis.create("Cups")); + options.setVAxis(VAxis.create("Year")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BubbleChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BubbleChartExample.java new file mode 100644 index 0000000..b5569b6 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/BubbleChartExample.java @@ -0,0 +1,75 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.BubbleChart; +import com.googlecode.gwt.charts.client.corechart.BubbleChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class BubbleChartExample extends DockLayoutPanel { + private BubbleChart chart; + + public BubbleChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new BubbleChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "ID"); + dataTable.addColumn(ColumnType.NUMBER, "Life Expectancy"); + dataTable.addColumn(ColumnType.NUMBER, "Fertility Rate"); + dataTable.addColumn(ColumnType.STRING, "Region"); + dataTable.addColumn(ColumnType.NUMBER, "Population"); + dataTable.addRows(4); + dataTable.setValue(0, 0, "CAN"); + dataTable.setValue(1, 0, "DEU"); + dataTable.setValue(2, 0, "DNK"); + dataTable.setValue(3, 0, "EGY"); + dataTable.setValue(0, 1, 80.66); + dataTable.setValue(1, 1, 79.84); + dataTable.setValue(2, 1, 78.6); + dataTable.setValue(3, 1, 72.73); + dataTable.setValue(0, 2, 1.67); + dataTable.setValue(1, 2, 1.36); + dataTable.setValue(2, 2, 1.84); + dataTable.setValue(3, 2, 2.78); + dataTable.setValue(0, 3, "North America"); + dataTable.setValue(1, 3, "Europe"); + dataTable.setValue(2, 3, "Europe"); + dataTable.setValue(3, 3, "Africa"); + dataTable.setValue(0, 4, 33739900); + dataTable.setValue(1, 4, 81902307); + dataTable.setValue(2, 4, 5523095); + dataTable.setValue(3, 4, 79716203); + + // Set options + BubbleChartOptions options = BubbleChartOptions.create(); + options.setTitle("Correlation between life expectancy, fertility rate and population of some world countries (2010)"); + options.setHAxis(HAxis.create("Life Expectancy")); + options.setVAxis(VAxis.create("Fertility Rate")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/CandlestickChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/CandlestickChartExample.java new file mode 100644 index 0000000..3d5f20b --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/CandlestickChartExample.java @@ -0,0 +1,55 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsonUtils; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.CandlestickChart; +import com.googlecode.gwt.charts.client.corechart.CandlestickChartOptions; +import com.googlecode.gwt.charts.client.options.BackgroundColor; +import com.googlecode.gwt.charts.client.options.Legend; +import com.googlecode.gwt.charts.client.options.LegendPosition; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class CandlestickChartExample extends DockLayoutPanel { + private CandlestickChart chart; + + public CandlestickChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new CandlestickChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + JsArrayMixed dataArray = JsonUtils + .unsafeEval("[['Mon',20,28,38,45],['Tue',31,38,55,66],['Wed',50,55,77,80],['Thu',77,77,66,50],['Fri',68,66,22,15]]"); + + // Prepare the data + DataTable dataTable = ChartHelper.arrayToDataTable(dataArray, true); + + // Set options + CandlestickChartOptions options = CandlestickChartOptions.create(); + options.setLegend(Legend.create(LegendPosition.NONE)); + options.setFallingColor(BackgroundColor.create(null, "red", 2)); + options.setRisingColor(BackgroundColor.create(null, "orange", 2)); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ColumnChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ColumnChartExample.java new file mode 100644 index 0000000..c10118a --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ColumnChartExample.java @@ -0,0 +1,70 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.ColumnChart; +import com.googlecode.gwt.charts.client.corechart.ColumnChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class ColumnChartExample extends DockLayoutPanel { + private ColumnChart chart; + + public ColumnChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new ColumnChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + String[] countries = new String[] { "Austria", "Bulgaria", "Denmark", "Greece" }; + int[] years = new int[] { 2003, 2004, 2005, 2006, 2007, 2008 }; + int[][] values = new int[][] { { 1336060, 1538156, 1576579, 1600652, 1968113, 1901067 }, + { 400361, 366849, 440514, 434552, 393032, 517206 }, + { 1001582, 1119450, 993360, 1004163, 979198, 916965 }, + { 997974, 941795, 930593, 897127, 1080887, 1056036 } }; + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Year"); + for (int i = 0; i < countries.length; i++) { + dataTable.addColumn(ColumnType.NUMBER, countries[i]); + } + dataTable.addRows(years.length); + for (int i = 0; i < years.length; i++) { + dataTable.setValue(i, 0, String.valueOf(years[i])); + } + for (int col = 0; col < values.length; col++) { + for (int row = 0; row < values[col].length; row++) { + dataTable.setValue(row, col + 1, values[col][row]); + } + } + + // Set options + ColumnChartOptions options = ColumnChartOptions.create(); + options.setFontName("Tahoma"); + options.setTitle("Yearly Coffee Consumption by Country"); + options.setHAxis(HAxis.create("Cups")); + options.setVAxis(VAxis.create("Year")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ComboChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ComboChartExample.java new file mode 100644 index 0000000..58bd813 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ComboChartExample.java @@ -0,0 +1,61 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsonUtils; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.ComboChart; +import com.googlecode.gwt.charts.client.corechart.ComboChartOptions; +import com.googlecode.gwt.charts.client.corechart.ComboChartSeries; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.SeriesType; +import com.googlecode.gwt.charts.client.options.VAxis; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class ComboChartExample extends DockLayoutPanel { + private ComboChart chart; + + public ComboChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new ComboChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + JsArrayMixed dataArray = JsonUtils + .unsafeEval("[['Month', 'Bolivia', 'Ecuador', 'Madagascar', 'Papua Guinea', 'Rwanda', 'Average'],['2004/05', 165, 938, 522, 998, 450, 614.6],['2005/06', 135, 1120, 599, 1268, 288, 682],['2006/07', 157, 1167, 587, 807, 397, 623],['2007/08', 139, 1110, 615, 968, 215, 609.4],['2008/09', 136, 691, 629, 1026, 366, 569.6]]"); + + // Prepare the data + DataTable dataTable = ChartHelper.arrayToDataTable(dataArray); + + // Set options + ComboChartOptions options = ComboChartOptions.create(); + options.setFontName("Tahoma"); + options.setTitle("Monthly Coffee Production by Country"); + options.setHAxis(HAxis.create("Cups")); + options.setVAxis(VAxis.create("Month")); + options.setSeriesType(SeriesType.BARS); + ComboChartSeries series = ComboChartSeries.create(); + series.setType(SeriesType.LINE); + options.setSeries(5, series); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/HistogramExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/HistogramExample.java new file mode 100644 index 0000000..ccf0f39 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/HistogramExample.java @@ -0,0 +1,63 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.Histogram; +import com.googlecode.gwt.charts.client.corechart.HistogramOptions; +import com.googlecode.gwt.charts.client.options.Legend; +import com.googlecode.gwt.charts.client.options.LegendPosition; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class HistogramExample extends DockLayoutPanel { + private Histogram chart; + + public HistogramExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new Histogram(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + Object[][] data = new Object[][] { { "Dinosaur", "Length" }, { "Acrocanthosaurus (top-spined lizard)", 12.2 }, + { "Albertosaurus (Alberta lizard)", 9.1 }, { "Allosaurus (other lizard)", 12.2 }, + { "Apatosaurus (deceptive lizard)", 22.9 }, { "Archaeopteryx (ancient wing)", 0.9 }, + { "Argentinosaurus (Argentina lizard)", 36.6 }, { "Baryonyx (heavy claws)", 9.1 }, + { "Brachiosaurus (arm lizard)", 30.5 }, { "Ceratosaurus (horned lizard)", 6.1 }, + { "Coelophysis (hollow form)", 2.7 }, { "Compsognathus (elegant jaw)", 0.9 }, + { "Deinonychus (terrible claw)", 2.7 }, { "Diplodocus (double beam)", 27.1 }, + { "Dromicelomimus (emu mimic)", 3.4 }, { "Gallimimus (fowl mimic)", 5.5 }, + { "Mamenchisaurus (Mamenchi lizard)", 21.0 }, { "Megalosaurus (big lizard)", 7.9 }, + { "Microvenator (small hunter)", 1.2 }, { "Ornithomimus (bird mimic)", 4.6 }, + { "Oviraptor (egg robber)", 1.5 }, { "Plateosaurus (flat lizard)", 7.9 }, + { "Sauronithoides (narrow-clawed lizard)", 2.0 }, { "Seismosaurus (tremor lizard)", 45.7 }, + { "Spinosaurus (spiny lizard)", 12.2 }, { "Supersaurus (super lizard)", 30.5 }, + { "Tyrannosaurus (tyrant lizard)", 15.2 }, { "Ultrasaurus (ultra lizard)", 30.5 }, + { "Velociraptor (swift robber)", 1.8 } }; + DataTable dataTable = ChartHelper.arrayToDataTable(data); + + // Set options + HistogramOptions options = HistogramOptions.create(); + options.setTitle("Lengths of dinosaurs, in meters"); + options.setLegend(Legend.create(LegendPosition.NONE)); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/LineChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/LineChartExample.java new file mode 100644 index 0000000..3d98617 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/LineChartExample.java @@ -0,0 +1,71 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.LineChart; +import com.googlecode.gwt.charts.client.corechart.LineChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class LineChartExample extends DockLayoutPanel { + private LineChart chart; + + public LineChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new LineChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + String[] countries = new String[] { "Austria", "Bulgaria", "Denmark", "Greece" }; + int[] years = new int[] { 2003, 2004, 2005, 2006, 2007, 2008 }; + int[][] values = new int[][] { { 1336060, 1538156, 1576579, 1600652, 1968113, 1901067 }, + { 400361, 366849, 440514, 434552, 393032, 517206 }, + { 1001582, 1119450, 993360, 1004163, 979198, 916965 }, + { 997974, 941795, 930593, 897127, 1080887, 1056036 } }; + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Year"); + for (int i = 0; i < countries.length; i++) { + dataTable.addColumn(ColumnType.NUMBER, countries[i]); + } + dataTable.addRows(years.length); + for (int i = 0; i < years.length; i++) { + dataTable.setValue(i, 0, String.valueOf(years[i])); + } + for (int col = 0; col < values.length; col++) { + for (int row = 0; row < values[col].length; row++) { + dataTable.setValue(row, col + 1, values[col][row]); + } + } + + // Set options + LineChartOptions options = LineChartOptions.create(); + options.setBackgroundColor("#f0f0f0"); + options.setFontName("Tahoma"); + options.setTitle("Yearly Coffee Consumption by Country"); + options.setHAxis(HAxis.create("Year")); + options.setVAxis(VAxis.create("Cups")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/PieChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/PieChartExample.java new file mode 100644 index 0000000..c387bbd --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/PieChartExample.java @@ -0,0 +1,77 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.Selection; +import com.googlecode.gwt.charts.client.corechart.PieChart; +import com.googlecode.gwt.charts.client.corechart.PieChartOptions; +import com.googlecode.gwt.charts.client.event.ReadyEvent; +import com.googlecode.gwt.charts.client.event.ReadyHandler; + +public class PieChartExample extends DockLayoutPanel { + private PieChart chart; + + public PieChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new PieChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Task"); + dataTable.addColumn(ColumnType.NUMBER, "Hours per Day"); + dataTable.addRows(5); + dataTable.setValue(0, 0, "Work"); + dataTable.setValue(0, 1, 11); + dataTable.setValue(1, 0, "Sleep"); + dataTable.setValue(1, 1, 7); + dataTable.setValue(2, 0, "Watch TV"); + dataTable.setValue(2, 1, 3); + dataTable.setValue(3, 0, "Eat"); + dataTable.setValue(3, 1, 2); + dataTable.setValue(4, 0, "Commute"); + dataTable.setValue(4, 1, 1); + + // Set options + PieChartOptions options = PieChartOptions.create(); + options.setBackgroundColor("#f0f0f0"); + + // options.setColors(colors); + options.setFontName("Tahoma"); + options.setIs3D(false); + options.setPieResidueSliceColor("#000000"); + options.setPieResidueSliceLabel("Others"); + options.setSliceVisibilityThreshold(0.1); + options.setTitle("So, how was your day?"); + + // Draw the chart + chart.draw(dataTable, options); + chart.addReadyHandler(new ReadyHandler() { + + @Override + public void onReady(ReadyEvent event) { + chart.setSelection(Selection.create(1, null)); + } + }); + } + +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ScatterChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ScatterChartExample.java new file mode 100644 index 0000000..86a95f3 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/ScatterChartExample.java @@ -0,0 +1,63 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.ScatterChart; +import com.googlecode.gwt.charts.client.corechart.ScatterChartOptions; +import com.googlecode.gwt.charts.client.options.HAxis; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class ScatterChartExample extends DockLayoutPanel { + private ScatterChart chart; + + public ScatterChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new ScatterChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.NUMBER, "X"); + dataTable.addColumn(ColumnType.NUMBER, "Shape 1"); + dataTable.addColumn(ColumnType.NUMBER, "Shape 2"); + dataTable.addRows(1000); + for (int i = 0; i < 500; ++i) { + dataTable.setValue(i, 0, Math.sin(i / 5.0) * 0.25); + dataTable.setValue(i, 1, Math.cos(i / 25.0)); + } + for (int i = 0; i < 500; i++) { + dataTable.setValue(i + 500, 0, Math.sin(i / 25.0)); + dataTable.setValue(i + 500, 2, Math.cos(i / 10.0) * 0.5); + } + + // Set options + ScatterChartOptions options = ScatterChartOptions.create(); + options.setBackgroundColor("#f0f0f0"); + options.setFontName("Tahoma"); + options.setTitle("Cool shapes"); + options.setHAxis(HAxis.create("X")); + options.setVAxis(VAxis.create("Y")); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/SteppedAreaChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/SteppedAreaChartExample.java new file mode 100644 index 0000000..ae3f66f --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/corechart/SteppedAreaChartExample.java @@ -0,0 +1,66 @@ +package com.googlecode.gwt.charts.showcase.client.corechart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.SteppedAreaChart; +import com.googlecode.gwt.charts.client.corechart.SteppedAreaChartOptions; +import com.googlecode.gwt.charts.client.options.VAxis; + +public class SteppedAreaChartExample extends DockLayoutPanel { + private SteppedAreaChart chart; + + public SteppedAreaChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new SteppedAreaChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Director (Year)"); + dataTable.addColumn(ColumnType.NUMBER, "Rotten Tomatoes"); + dataTable.addColumn(ColumnType.NUMBER, "IMDB"); + dataTable.addRows(4); + dataTable.setValue(0, 0, "Alfred Hitchcock (1935)"); + dataTable.setValue(1, 0, "Ralph Thomas (1959)"); + dataTable.setValue(2, 0, "Don Sharp (1978)"); + dataTable.setValue(3, 0, "James Hawes (2008)"); + dataTable.setValue(0, 1, 8.4); + dataTable.setValue(1, 1, 6.9); + dataTable.setValue(2, 1, 6.5); + dataTable.setValue(3, 1, 4.4); + dataTable.setValue(0, 2, 7.9); + dataTable.setValue(1, 2, 6.5); + dataTable.setValue(2, 2, 6.4); + dataTable.setValue(3, 2, 6.2); + + // Set options + SteppedAreaChartOptions options = SteppedAreaChartOptions.create(); + options.setBackgroundColor("#f0f0f0"); + options.setFontName("Tahoma"); + options.setTitle("The decline of 'The 39 Steps'"); + options.setVAxis(VAxis.create("Accumulated Rating")); + options.setIsStacked(true); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffBarChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffBarChartExample.java new file mode 100644 index 0000000..2134640 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffBarChartExample.java @@ -0,0 +1,53 @@ +package com.googlecode.gwt.charts.showcase.client.diffchart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.BarChart; + +public class DiffBarChartExample extends DockLayoutPanel { + private BarChart chart; + + public DiffBarChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new BarChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable colOldData = DataTable.create(); + colOldData.addColumn(ColumnType.STRING, "Name"); + colOldData.addColumn(ColumnType.NUMBER, "Popularity"); + colOldData.addRow("Cesar", 250); + colOldData.addRow("Rachel", 4200); + colOldData.addRow("Patrick", 2900); + colOldData.addRow("Eric", 8200); + + DataTable colNewData = DataTable.create(); + colNewData.addColumn(ColumnType.STRING, "Name"); + colNewData.addColumn(ColumnType.NUMBER, "Popularity"); + colNewData.addRow("Cesar", 370); + colNewData.addRow("Rachel", 600); + colNewData.addRow("Patrick", 700); + colNewData.addRow("Eric", 1500); + + chart.draw(chart.computeDiff(colOldData, colNewData)); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffColumnChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffColumnChartExample.java new file mode 100644 index 0000000..703b288 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffColumnChartExample.java @@ -0,0 +1,53 @@ +package com.googlecode.gwt.charts.showcase.client.diffchart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.ColumnChart; + +public class DiffColumnChartExample extends DockLayoutPanel { + private ColumnChart chart; + + public DiffColumnChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new ColumnChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable colOldData = DataTable.create(); + colOldData.addColumn(ColumnType.STRING, "Name"); + colOldData.addColumn(ColumnType.NUMBER, "Popularity"); + colOldData.addRow("Cesar", 250); + colOldData.addRow("Rachel", 4200); + colOldData.addRow("Patrick", 2900); + colOldData.addRow("Eric", 8200); + + DataTable colNewData = DataTable.create(); + colNewData.addColumn(ColumnType.STRING, "Name"); + colNewData.addColumn(ColumnType.NUMBER, "Popularity"); + colNewData.addRow("Cesar", 370); + colNewData.addRow("Rachel", 600); + colNewData.addRow("Patrick", 700); + colNewData.addRow("Eric", 1500); + + chart.draw(chart.computeDiff(colOldData, colNewData)); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffPieChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffPieChartExample.java new file mode 100644 index 0000000..fd71ead --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffPieChartExample.java @@ -0,0 +1,56 @@ +package com.googlecode.gwt.charts.showcase.client.diffchart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.PieChart; + +public class DiffPieChartExample extends DockLayoutPanel { + private PieChart chart; + + public DiffPieChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new PieChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable pieOldData = DataTable.create(); + pieOldData.addColumn(ColumnType.STRING, "Major"); + pieOldData.addColumn(ColumnType.NUMBER, "Degrees"); + pieOldData.addRow("Business", 256070); + pieOldData.addRow("Education", 108034); + pieOldData.addRow("Social Sciences & History", 127101); + pieOldData.addRow("Health", 81863); + pieOldData.addRow("Psychology", 74194); + + DataTable pieNewData = DataTable.create(); + pieNewData.addColumn(ColumnType.STRING, "Major"); + pieNewData.addColumn(ColumnType.NUMBER, "Degrees"); + pieNewData.addRow("Business", 358293); + pieNewData.addRow("Education", 101265); + pieNewData.addRow("Social Sciences & History", 172780); + pieNewData.addRow("Health", 129634); + pieNewData.addRow("Psychology", 97216); + + // Draw the chart + chart.draw(chart.computeDiff(pieOldData, pieNewData)); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffScatterChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffScatterChartExample.java new file mode 100644 index 0000000..ef757e8 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/diffchart/DiffScatterChartExample.java @@ -0,0 +1,57 @@ +package com.googlecode.gwt.charts.showcase.client.diffchart; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.corechart.ScatterChart; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class DiffScatterChartExample extends DockLayoutPanel { + private ScatterChart chart; + + public DiffScatterChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new ScatterChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable scatterOldData = ChartHelper.arrayToDataTable(new Object[][] { { "", "Medicine 1", "Medicine 2" }, + { 23, null, 12 }, { 9, null, 39 }, { 15, null, 28 }, { 37, null, 30 }, { 21, null, 14 }, + { 12, null, 18 }, { 29, null, 34 }, { 8, null, 12 }, { 38, null, 28 }, { 35, null, 12 }, + { 26, null, 10 }, { 10, null, 29 }, { 11, null, 10 }, { 27, null, 38 }, { 39, null, 17 }, + { 34, null, 20 }, { 38, null, 5 }, { 33, null, 27 }, { 23, null, 39 }, { 12, null, 10 }, + { 8, 15, null }, { 39, 15, null }, { 27, 31, null }, { 30, 24, null }, { 31, 39, null }, + { 35, 6, null }, { 5, 5, null }, { 19, 39, null }, { 22, 8, null }, { 19, 23, null }, { 27, 20, null }, + { 11, 6, null }, { 34, 33, null }, { 38, 8, null }, { 39, 29, null }, { 13, 23, null }, + { 13, 36, null }, { 39, 6, null }, { 14, 37, null }, { 13, 39, null } }, false); + DataTable scatterNewData = ChartHelper.arrayToDataTable(new Object[][] { { "", "Medicine 1", "Medicine 2" }, + { 22, null, 12 }, { 7, null, 40 }, { 14, null, 31 }, { 37, null, 30 }, { 18, null, 17 }, + { 9, null, 20 }, { 26, null, 36 }, { 5, null, 13 }, { 36, null, 30 }, { 35, null, 15 }, + { 24, null, 12 }, { 7, null, 31 }, { 10, null, 12 }, { 24, null, 40 }, { 37, null, 18 }, + { 32, null, 21 }, { 35, null, 7 }, { 31, null, 30 }, { 21, null, 42 }, { 12, null, 10 }, + { 10, 13, null }, { 40, 12, null }, { 28, 29, null }, { 32, 22, null }, { 31, 37, null }, + { 38, 5, null }, { 6, 4, null }, { 21, 36, null }, { 22, 8, null }, { 21, 22, null }, { 28, 17, null }, + { 12, 5, null }, { 37, 30, null }, { 41, 7, null }, { 41, 27, null }, { 15, 20, null }, + { 14, 36, null }, { 42, 3, null }, { 14, 37, null }, { 15, 36, null } }); + + // Draw the chart + chart.draw(chart.computeDiff(scatterOldData, scatterNewData)); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/AnnotationChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/AnnotationChartExample.java new file mode 100644 index 0000000..a51c531 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/AnnotationChartExample.java @@ -0,0 +1,90 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.annotationchart.AnnotationChart; +import com.googlecode.gwt.charts.client.annotationchart.AnnotationChartOptions; +import com.googlecode.gwt.charts.showcase.client.util.DateUtils; + +public class AnnotationChartExample extends DockLayoutPanel { + private AnnotationChart chart; + + public AnnotationChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.ANNOTATIONCHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new AnnotationChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.DATE, "Country"); + dataTable.addColumn(ColumnType.NUMBER, "Kepler-22b mission"); + dataTable.addColumn(ColumnType.STRING, "Kepler title"); + dataTable.addColumn(ColumnType.STRING, "Kepler text"); + dataTable.addColumn(ColumnType.NUMBER, "Gliese 163 mission"); + dataTable.addColumn(ColumnType.STRING, "Gliese title"); + dataTable.addColumn(ColumnType.STRING, "Gliese text"); + dataTable.addRows(6); + dataTable.setValue(0, 0, DateUtils.create(2314, 2, 15)); + dataTable.setValue(0, 1, 12400); + dataTable.setValue(0, 4, 10645); + dataTable.setValue(1, 0, DateUtils.create(2314, 2, 16)); + dataTable.setValue(1, 1, 24045); + dataTable.setValue(1, 2, "Lalibertines"); + dataTable.setValue(1, 3, "First encounter"); + dataTable.setValue(1, 4, 12374); + dataTable.setValue(2, 0, DateUtils.create(2314, 2, 17)); + dataTable.setValue(2, 1, 35022); + dataTable.setValue(2, 2, "Lalibertines"); + dataTable.setValue(2, 3, "They are very tall"); + dataTable.setValue(2, 4, 15766); + dataTable.setValue(2, 5, "Gallantors"); + dataTable.setValue(2, 6, "First Encounter"); + dataTable.setValue(3, 0, DateUtils.create(2314, 2, 18)); + dataTable.setValue(3, 1, 12284); + dataTable.setValue(3, 2, "Lalibertines"); + dataTable.setValue(3, 3, "Attack on our crew!"); + dataTable.setValue(3, 4, 34334); + dataTable.setValue(3, 5, "Gallantors"); + dataTable.setValue(3, 6, "Statement of shared principles"); + dataTable.setValue(4, 0, DateUtils.create(2314, 2, 19)); + dataTable.setValue(4, 1, 8476); + dataTable.setValue(4, 2, "Lalibertines"); + dataTable.setValue(4, 3, "Heavy casualties"); + dataTable.setValue(4, 4, 66467); + dataTable.setValue(4, 5, "Gallantors"); + dataTable.setValue(4, 6, "Mysteries revealed"); + dataTable.setValue(5, 0, DateUtils.create(2314, 2, 20)); + dataTable.setValue(5, 1, 0); + dataTable.setValue(5, 2, "Lalibertines"); + dataTable.setValue(5, 3, "All crew lost"); + dataTable.setValue(5, 4, 79463); + dataTable.setValue(5, 5, "Gallantors"); + dataTable.setValue(5, 6, "Omniscience achieved"); + + // Set options + AnnotationChartOptions options = AnnotationChartOptions.create(); + options.setDisplayAnnotations(true); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/CalendarExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/CalendarExample.java new file mode 100644 index 0000000..86ca7fc --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/CalendarExample.java @@ -0,0 +1,76 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.calendar.Calendar; +import com.googlecode.gwt.charts.client.calendar.CalendarOptions; +import com.googlecode.gwt.charts.showcase.client.util.DateUtils; + +public class CalendarExample extends DockLayoutPanel { + private Calendar chart; + + public CalendarExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CALENDAR); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new Calendar(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.DATE, "Date"); + dataTable.addColumn(ColumnType.NUMBER, "Won/Loss"); + dataTable.addRows(13); + dataTable.setValue(0, 0, DateUtils.create(2012, 3, 13)); + dataTable.setValue(0, 1, 37032); + dataTable.setValue(1, 0, DateUtils.create(2012, 3, 14)); + dataTable.setValue(1, 1, 38024); + dataTable.setValue(2, 0, DateUtils.create(2012, 3, 15)); + dataTable.setValue(2, 1, 38024); + dataTable.setValue(3, 0, DateUtils.create(2012, 3, 16)); + dataTable.setValue(3, 1, 38108); + dataTable.setValue(4, 0, DateUtils.create(2012, 3, 17)); + dataTable.setValue(4, 1, 38229); + // Many rows omitted for brevity. + dataTable.setValue(5, 0, DateUtils.create(2013, 9, 4)); + dataTable.setValue(5, 1, 38177); + dataTable.setValue(6, 0, DateUtils.create(2013, 9, 5)); + dataTable.setValue(6, 1, 38705); + dataTable.setValue(7, 0, DateUtils.create(2013, 9, 12)); + dataTable.setValue(7, 1, 38210); + dataTable.setValue(8, 0, DateUtils.create(2013, 9, 13)); + dataTable.setValue(8, 1, 38029); + dataTable.setValue(9, 0, DateUtils.create(2013, 9, 19)); + dataTable.setValue(9, 1, 38823); + dataTable.setValue(10, 0, DateUtils.create(2013, 9, 23)); + dataTable.setValue(10, 1, 38345); + dataTable.setValue(11, 0, DateUtils.create(2013, 9, 24)); + dataTable.setValue(11, 1, 38436); + dataTable.setValue(12, 0, DateUtils.create(2013, 9, 30)); + dataTable.setValue(12, 1, 38447); + + // Set options + CalendarOptions options = CalendarOptions.create(); + options.setTitle("Red Sox Attendance"); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GaugeExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GaugeExample.java new file mode 100644 index 0000000..92b4c19 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GaugeExample.java @@ -0,0 +1,60 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.gauge.Gauge; +import com.googlecode.gwt.charts.client.gauge.GaugeOptions; + +public class GaugeExample extends DockLayoutPanel { + private Gauge gauge; + + public GaugeExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.GAUGE); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + gauge = new Gauge(); + add(gauge); + draw(); + } + }); + } + + private void draw() { + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "LabelStyle"); + dataTable.addColumn(ColumnType.NUMBER, "Value"); + dataTable.addRows(3); + dataTable.setValue(0, 0, "Memory"); + dataTable.setValue(0, 1, 80); + dataTable.setValue(1, 0, "CPU"); + dataTable.setValue(1, 1, 55); + dataTable.setValue(2, 0, "Network"); + dataTable.setValue(2, 1, 68); + + // Set options + GaugeOptions options = GaugeOptions.create(); + options.setGreenFrom(0); + options.setGreenTo(40); + options.setYellowFrom(40); + options.setYellowTo(80); + options.setRedFrom(80); + options.setRedTo(100); + + // Draw the chart + gauge.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GeoChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GeoChartExample.java new file mode 100644 index 0000000..94cb6c5 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/GeoChartExample.java @@ -0,0 +1,64 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.geochart.GeoChart; +import com.googlecode.gwt.charts.client.geochart.GeoChartColorAxis; +import com.googlecode.gwt.charts.client.geochart.GeoChartOptions; + +public class GeoChartExample extends DockLayoutPanel { + private GeoChart geoChart; + + public GeoChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.GEOCHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + geoChart = new GeoChart(); + add(geoChart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Country"); + dataTable.addColumn(ColumnType.NUMBER, "Popularity"); + dataTable.addRows(6); + dataTable.setValue(0, 0, "Germany"); + dataTable.setValue(0, 1, 200); + dataTable.setValue(1, 0, "United States"); + dataTable.setValue(1, 1, 300); + dataTable.setValue(2, 0, "Brazil"); + dataTable.setValue(2, 1, 400); + dataTable.setValue(3, 0, "Canada"); + dataTable.setValue(3, 1, 500); + dataTable.setValue(4, 0, "France"); + dataTable.setValue(4, 1, 600); + dataTable.setValue(5, 0, "RU"); + dataTable.setValue(5, 1, 700); + + // Set options + GeoChartOptions options = GeoChartOptions.create(); + GeoChartColorAxis geoChartColorAxis = GeoChartColorAxis.create(); + geoChartColorAxis.setColors("green", "yellow", "red"); + options.setColorAxis(geoChartColorAxis); + options.setDatalessRegionColor("gray"); + + // Draw the chart + geoChart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/IntervalExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/IntervalExample.java new file mode 100644 index 0000000..4144734 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/IntervalExample.java @@ -0,0 +1,83 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataColumn; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.RoleType; +import com.googlecode.gwt.charts.client.corechart.LineChart; +import com.googlecode.gwt.charts.client.corechart.LineChartOptions; +import com.googlecode.gwt.charts.client.options.CurveType; +import com.googlecode.gwt.charts.client.options.Interval; +import com.googlecode.gwt.charts.client.options.IntervalStyle; +import com.googlecode.gwt.charts.client.options.Legend; +import com.googlecode.gwt.charts.client.options.LegendPosition; + +public class IntervalExample extends DockLayoutPanel { + private LineChart chart; + + public IntervalExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new LineChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "x"); + dataTable.addColumn(ColumnType.NUMBER, "values"); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i0")); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i1")); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i2")); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i2")); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i2")); + dataTable.addColumn(DataColumn.create(ColumnType.NUMBER, RoleType.INTERVAL, "i2")); + dataTable.addRow("a", 100, 90, 110, 85, 96, 104, 120); + dataTable.addRow("b", 120, 95, 130, 90, 113, 124, 140); + dataTable.addRow("c", 130, 105, 140, 100, 117, 133, 139); + dataTable.addRow("d", 90, 85, 95, 85, 88, 92, 95); + dataTable.addRow("e", 70, 74, 63, 67, 69, 70, 72); + dataTable.addRow("f", 30, 39, 22, 21, 28, 34, 40); + dataTable.addRow("g", 80, 77, 83, 70, 77, 85, 90); + dataTable.addRow("h", 100, 90, 110, 85, 95, 102, 110); + + // Set options + LineChartOptions options = LineChartOptions.create(); + options.setCurveType(CurveType.FUNCTION); + options.setLineWidth(4); + options.setTitle("Line intervals, default"); + options.setLegend(Legend.create(LegendPosition.NONE)); + Interval interval0 = Interval.create(IntervalStyle.LINE); + interval0.setColor("#D3362D"); + interval0.setLineWidth(0.5); + options.setInterval("i0", interval0); + Interval interval1 = Interval.create(IntervalStyle.LINE); + interval1.setColor("#F1CA3A"); + interval1.setLineWidth(1); + options.setInterval("i1", interval1); + Interval interval2 = Interval.create(IntervalStyle.LINE); + interval2.setColor("#5F9654"); + interval2.setLineWidth(2); + options.setInterval("i2", interval2); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/MapExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/MapExample.java new file mode 100644 index 0000000..61f6bbe --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/MapExample.java @@ -0,0 +1,51 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.map.Map; +import com.googlecode.gwt.charts.client.map.MapOptions; +import com.googlecode.gwt.charts.client.util.ChartHelper; + +public class MapExample extends DockLayoutPanel { + private Map chart; + + public MapExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.MAP); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new Map(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + Object[][] data = new Object[][] { { "Country", "Population" }, { "China", "China: 1,363,800,000" }, + { "India", "India: 1,242,620,000" }, { "US", "US: 317,842,000" }, + { "Indonesia", "Indonesia: 247,424,598" }, { "Brazil", "Brazil: 201,032,714" }, + { "Pakistan", "Pakistan: 186,134,000" }, { "Nigeria", "Nigeria: 173,615,000" }, + { "Bangladesh", "Bangladesh: 152,518,015" }, { "Russia", "Russia: 146,019,512" }, + { "Japan", "Japan: 127,120,000" } }; + DataTable dataTable = ChartHelper.arrayToDataTable(data); + + // Set options + MapOptions options = MapOptions.create(); + options.setShowTip(true); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/OrgChartExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/OrgChartExample.java new file mode 100644 index 0000000..28a145c --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/OrgChartExample.java @@ -0,0 +1,69 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.format.PatternFormat; +import com.googlecode.gwt.charts.client.orgchart.OrgChart; +import com.googlecode.gwt.charts.client.orgchart.OrgChartOptions; + +public class OrgChartExample extends DockLayoutPanel { + private OrgChart chart; + + public OrgChartExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.ORGCHART); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + chart = new OrgChart(); + add(chart); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Name"); + dataTable.addColumn(ColumnType.STRING, "Manager"); + dataTable.addColumn(ColumnType.STRING, "ToolTip"); + dataTable.addRows(5); + + dataTable.setValue(0, 0, "Mike"); + dataTable.setValue(0, 1, ""); + dataTable.setValue(0, 2, "The President"); + dataTable.setValue(1, 0, "Jim"); + dataTable.setValue(1, 1, "Mike"); + dataTable.setValue(1, 2, "VP"); + dataTable.setValue(2, 0, "Alice"); + dataTable.setValue(2, 1, "Mike"); + dataTable.setValue(2, 2, ""); + dataTable.setValue(3, 0, "Bob"); + dataTable.setValue(3, 1, "Jim"); + dataTable.setValue(3, 2, "Bob Sponge"); + dataTable.setValue(4, 0, "Carol"); + dataTable.setValue(4, 1, "Bob"); + dataTable.setValue(4, 2, ""); + + PatternFormat format = PatternFormat.create("{0}
{1}
"); + format.format(dataTable, 0, 2); + + // Set options + OrgChartOptions options = OrgChartOptions.create(); + options.setAllowHtml(true); + + // Draw the chart + chart.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/SankeyExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/SankeyExample.java new file mode 100644 index 0000000..eaae179 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/SankeyExample.java @@ -0,0 +1,80 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.options.TextStyle; +import com.googlecode.gwt.charts.client.sankey.Sankey; +import com.googlecode.gwt.charts.client.sankey.SankeyNode; +import com.googlecode.gwt.charts.client.sankey.SankeyOptions; +import com.googlecode.gwt.charts.client.util.ArrayHelper; + +public class SankeyExample extends DockLayoutPanel { + private Sankey sankey; + + public SankeyExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.SANKEY); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + sankey = new Sankey(); + add(sankey); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + Object[][] data = new Object[][] { { "Brazil", "Portugal", 5 }, { "Brazil", "France", 1 }, + { "Brazil", "Spain", 1 }, { "Brazil", "England", 1 }, { "Canada", "Portugal", 1 }, + { "Canada", "France", 5 }, { "Canada", "England", 1 }, { "Mexico", "Portugal", 1 }, + { "Mexico", "France", 1 }, { "Mexico", "Spain", 5 }, { "Mexico", "England", 1 }, + { "USA", "Portugal", 1 }, { "USA", "France", 1 }, { "USA", "Spain", 1 }, { "USA", "England", 5 }, + { "Portugal", "Angola", 2 }, { "Portugal", "Senegal", 1 }, { "Portugal", "Morocco", 1 }, + { "Portugal", "South Africa", 3 }, { "France", "Angola", 1 }, { "France", "Senegal", 3 }, + { "France", "Mali", 3 }, { "France", "Morocco", 3 }, { "France", "South Africa", 1 }, + { "Spain", "Senegal", 1 }, { "Spain", "Morocco", 3 }, { "Spain", "South Africa", 1 }, + { "England", "Angola", 1 }, { "England", "Senegal", 1 }, { "England", "Morocco", 2 }, + { "England", "South Africa", 7 }, { "South Africa", "China", 5 }, { "South Africa", "India", 1 }, + { "South Africa", "Japan", 3 }, { "Angola", "China", 5 }, { "Angola", "India", 1 }, + { "Angola", "Japan", 3 }, { "Senegal", "China", 5 }, { "Senegal", "India", 1 }, + { "Senegal", "Japan", 3 }, { "Mali", "China", 5 }, { "Mali", "India", 1 }, { "Mali", "Japan", 3 }, + { "Morocco", "China", 5 }, { "Morocco", "India", 1 }, { "Morocco", "Japan", 3 } }; + + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "From"); + dataTable.addColumn(ColumnType.STRING, "To"); + dataTable.addColumn(ColumnType.NUMBER, "Weight"); + + JsArray dataJsArray = JavaScriptObject.createArray().cast(); + for (Object[] object : data) { + dataJsArray.push(ArrayHelper.createArray(object)); + } + dataTable.addRows(dataJsArray); + + // Set options + SankeyOptions options = SankeyOptions.create(); + SankeyNode sankeyNode = SankeyNode.create(); + TextStyle textStyle = TextStyle.create(); + textStyle.setColor("red"); + sankeyNode.setLabel(textStyle); + options.setNode(sankeyNode); + + // Draw the chart + sankey.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TableExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TableExample.java new file mode 100644 index 0000000..9c78391 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TableExample.java @@ -0,0 +1,63 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.table.Table; +import com.googlecode.gwt.charts.client.table.TableOptions; + +public class TableExample extends DockLayoutPanel { + private Table table; + + public TableExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.TABLE); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + table = new Table(); + add(table); + draw(); + } + }); + } + + private void draw() { + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Name"); + dataTable.addColumn(ColumnType.NUMBER, "Salary"); + dataTable.addColumn(ColumnType.BOOLEAN, "Full Time Employee"); + dataTable.addRows(4); + dataTable.setCell(0, 0, "Mike"); + dataTable.setCell(0, 1, 10000, "$10,000"); + dataTable.setCell(0, 2, true); + dataTable.setCell(1, 0, "Jim"); + dataTable.setCell(1, 1, 8000, "$8,000"); + dataTable.setCell(1, 2, false); + dataTable.setCell(2, 0, "Alice"); + dataTable.setCell(2, 1, 12500, "$12,500"); + dataTable.setCell(2, 2, true); + dataTable.setCell(3, 0, "Bob"); + dataTable.setCell(3, 1, 7000, "$7,000"); + dataTable.setCell(3, 2, true); + + // Set options + TableOptions options = TableOptions.create(); + options.setAlternatingRowStyle(true); + options.setShowRowNumber(true); + + // Draw the chart + table.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TimelineExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TimelineExample.java new file mode 100644 index 0000000..9c8026e --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TimelineExample.java @@ -0,0 +1,69 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.format.PatternFormat; +import com.googlecode.gwt.charts.client.timeline.Timeline; +import com.googlecode.gwt.charts.client.timeline.TimelineOptions; +import com.googlecode.gwt.charts.showcase.client.util.DateUtils; + +public class TimelineExample extends DockLayoutPanel { + private Timeline timeline; + + public TimelineExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.TIMELINE); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + timeline = new Timeline(); + add(timeline); + draw(); + } + }); + } + + private void draw() { + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Term"); + dataTable.addColumn(ColumnType.STRING, "Name"); + dataTable.addColumn(ColumnType.DATE, "Start"); + dataTable.addColumn(ColumnType.DATE, "End"); + dataTable.addRows(3); + + dataTable.setValue(0, 0, "1"); + dataTable.setValue(0, 1, "George Washington"); + dataTable.setValue(0, 2, DateUtils.create(1789, 3, 29)); + dataTable.setValue(0, 3, DateUtils.create(1797, 2, 3)); + dataTable.setValue(1, 0, "2"); + dataTable.setValue(1, 1, "John Adams"); + dataTable.setValue(1, 2, DateUtils.create(1797, 2, 3)); + dataTable.setValue(1, 3, DateUtils.create(1801, 2, 3)); + dataTable.setValue(2, 0, "3"); + dataTable.setValue(2, 1, "Thomas Jefferson"); + dataTable.setValue(2, 2, DateUtils.create(1801, 2, 3)); + dataTable.setValue(2, 3, DateUtils.create(1809, 2, 3)); + + + PatternFormat format = PatternFormat.create("{0}
{1}
"); + format.format(dataTable, 0, 2); + + // Set options + TimelineOptions options = TimelineOptions.create(); + options.setShowRowLabels(false); + + // Draw the chart + timeline.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TreeMapExample.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TreeMapExample.java new file mode 100644 index 0000000..bc3fa2b --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/others/TreeMapExample.java @@ -0,0 +1,61 @@ +package com.googlecode.gwt.charts.showcase.client.others; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsonUtils; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.user.client.ui.DockLayoutPanel; +import com.googlecode.gwt.charts.client.ChartLoader; +import com.googlecode.gwt.charts.client.ChartPackage; +import com.googlecode.gwt.charts.client.ColumnType; +import com.googlecode.gwt.charts.client.DataTable; +import com.googlecode.gwt.charts.client.treemap.TreeMap; +import com.googlecode.gwt.charts.client.treemap.TreeMapOptions; + +public class TreeMapExample extends DockLayoutPanel { + private TreeMap treeMap; + + public TreeMapExample() { + super(Unit.PX); + initialize(); + } + + private void initialize() { + ChartLoader chartLoader = new ChartLoader(ChartPackage.TREEMAP); + chartLoader.loadApi(new Runnable() { + + @Override + public void run() { + // Create and attach the chart + treeMap = new TreeMap(); + add(treeMap); + draw(); + } + }); + } + + private void draw() { + JsArray dataArray = JsonUtils + .unsafeEval("[['Global',null,0,0],['America','Global',0,0],['Europe','Global',0,0],['Asia','Global',0,0],['Australia','Global',0,0],['Africa','Global',0,0],['Brazil','America',11,10],['USA','America',52,31],['Mexico','America',24,12],['Canada','America',16,-23],['France','Europe',42,-11],['Germany','Europe',31,-2],['Sweden','Europe',22,-13],['Italy','Europe',17,4],['UK','Europe',21,-5],['China','Asia',36,4],['Japan','Asia',20,-12],['India','Asia',40,63],['Laos','Asia',4,34],['Mongolia','Asia',1,-5],['Israel','Asia',12,24],['Iran','Asia',18,13],['Pakistan','Asia',11,-52],['Egypt','Africa',21,0],['S. Africa','Africa',30,43],['Sudan','Africa',12,2],['Congo','Africa',10,12],['Zair','Africa',8,10]]"); + + // Prepare the data + DataTable dataTable = DataTable.create(); + dataTable.addColumn(ColumnType.STRING, "Location"); + dataTable.addColumn(ColumnType.STRING, "Parent"); + dataTable.addColumn(ColumnType.NUMBER, "Market trade volume (size)"); + dataTable.addColumn(ColumnType.NUMBER, "Market increase/decrease (color)"); + + dataTable.addRows(dataArray); + + // Set options + TreeMapOptions options = TreeMapOptions.create(); + options.setMinColor("#ff7777"); + options.setMidColor("#ffff77"); + options.setMaxColor("#77ff77"); + options.setHeaderHeight(15); + options.setShowScale(true); + + // Draw the chart + treeMap.draw(dataTable, options); + } +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/util/DateUtils.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/util/DateUtils.java new file mode 100644 index 0000000..c267833 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/client/util/DateUtils.java @@ -0,0 +1,12 @@ +package com.googlecode.gwt.charts.showcase.client.util; + +import java.util.Date; + +public class DateUtils { + + @SuppressWarnings("deprecation") + public static Date create(int year, int month, int day) { + return new Date(year - 1900, month, day); + } + +} diff --git a/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/shared/FieldVerifier.java b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/shared/FieldVerifier.java new file mode 100644 index 0000000..80cd774 --- /dev/null +++ b/gwt-charts-showcase/src/main/java/com/googlecode/gwt/charts/showcase/shared/FieldVerifier.java @@ -0,0 +1,42 @@ +package com.googlecode.gwt.charts.showcase.shared; + +/** + *

+ * FieldVerifier validates that the name the user enters is valid. + *

+ *

+ * This class is in the shared package because we use it in both + * the client code and on the server. On the client, we verify that the name is + * valid before sending an RPC request so the user doesn't have to wait for a + * network round trip to get feedback. On the server, we verify that the name is + * correct to ensure that the input is correct regardless of where the RPC + * originates. + *

+ *

+ * When creating a class that is used on both the client and the server, be sure + * that all code is translatable and does not use native JavaScript. Code that + * is not translatable (such as code that interacts with a database or the file + * system) cannot be compiled into client side JavaScript. Code that uses native + * JavaScript (such as Widgets) cannot be run on the server. + *

+ */ +public class FieldVerifier { + + /** + * Verifies that the specified name is valid for our service. + * + * In this example, we only require that the name is at least four + * characters. In your application, you can use more complex checks to ensure + * that usernames, passwords, email addresses, URLs, and other fields have the + * proper syntax. + * + * @param name the name to validate + * @return true if valid, false if invalid + */ + public static boolean isValidName(String name) { + if (name == null) { + return false; + } + return name.length() > 3; + } +} diff --git a/gwt-charts-showcase/src/main/resources/META-INF/jdoconfig.xml b/gwt-charts-showcase/src/main/resources/META-INF/jdoconfig.xml new file mode 100644 index 0000000..5f56aa1 --- /dev/null +++ b/gwt-charts-showcase/src/main/resources/META-INF/jdoconfig.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/gwt-charts-showcase/src/main/resources/com/googlecode/gwt/charts/showcase/client/headerLogo.png b/gwt-charts-showcase/src/main/resources/com/googlecode/gwt/charts/showcase/client/headerLogo.png new file mode 100644 index 0000000000000000000000000000000000000000..a29ec78ccb2b4c1f40931948b13504954cca2a68 GIT binary patch literal 6656 zcmV+b8vo^qP)UcdI3} zvSj68Fizl%!4_aMjtm*&f#nAn7G}p7m>se)FvMLigV`m`47On~!p5?VEh{)Ewqoa` zu1=M!Ub=VwsOpwv1%olmoc?v!>#nZ%?sw0*=bU@a6!Ql~(^mLQW+b z(RMMz5tQ`dD$qiJ*4U0kVrYO5-*zK+y#IZ#=I~CDR|S6N7TH{mZO?9Ja%z%vIzuv* z#!-qw(PAQ*A!pgRT3~ycf^Ct_7fGcvq%&#qnJl?f8q2ZKJ|EFYl$P2!|M8>mF>lTs z3h6YVSnSURK3QHh%`2t&`_Fuq^&2;$rNMAwibFjE9PRC6G?5^iFHkJxDddaf3VB@1 zLO3pdp$S%1vAA;%7j9fnu8`;3|MIUO1<`nnH?%jfZeKscL*3N0&E>)my^Bq^-9)%5 zj^XnGXScThZ}4CI%GWq_e45=|N9i3LAYUlp*$&FKAzuLHVN}LgzF;mJSFhy!^Ea?& z^?9^3H4?BKhIhWmp~s$N^x5b5%4k2`N+7gi-u!kh_`~zmxRMMm5(l5*qh?_T=UsUf z8{c&^Ez1_aqDgpF;B&bgH@@c%CX2BB*=^tp&=#+tuDPCN3m5RZ4Qsgg!q>21P6rf< zObv~4{NNFufAC=rZ+Vi$NDnSHCPBi4$W(;5zrGqAm-^-w-kM7B(Ss8V3y(e63~7%% zP$Y|sMcdqEyzb8Tvf}E?sP1UT7YzJSlkuv+=ks~4x#gV@i1EZT&k*xVQpfhq4&cCV zxANQrKd1MpZA?#%pllD}8F)w(f)IiRVX#OTv}l94Hh8+yo|+E9!WGVU?T7X4w^CH(St)jiiCEt$>YbM`Mjkpz2XY4`X3)76pf&T;N&TIMexe= z@N5SwSEO&}bL{`sBRu!m6Kr3%3T=CA+qH}Je#!aWYQ1Bt{zqtIwT zmxmBUl+~G7ri`uc4CTbVw~Z92RZP_7LGmn zEQ!8jSQPOQBtQfcNkj;$5p-bEgh4=i-2TRmxCNWuBZqnXxJRX<5J117m|C>}y>=N* zi#rK6H4tp9$Be}&N|Q(=g5^QZQkaGWX_6^=f)1>O?M(VzMj!eGS#9BJHR}jx zz9)ek;0Vb9T~FPLc0T>WHiRK(E&3GAj~(si?uF+O7BOnIOC1IcB1kQQYHi?0pb$7{ zyz*L`aXdi;Q8eFJSVz$Gaeeo3=31K1-*`SB_|{kPh2v;lnkZL6(F0QowAM&8rW6RF zQJ%u~G-!oFpge^Xf)}6q9nt^!1$_B5`N2L^u81)UTY@QhkkX=X5R9TRfIXrXS1a!B z-A!#r+pOm0$!5^?o8RMM(q5V2<~OY2qJ`(tX+T_;LQ(;Ziy|nX9?3imIuXo4QV)cX z{QZ$}KGrotn+3-Lg7Aiw{O-}m(ZF!hVLa`UvlTuRTlQrcoN}oSn?wT!LDRtRGYJJu zB7T#w-yjk&3Hl`~H@=2F)iJC?hcR*%CIWd9IOS_W$$|Q3!XFT!h>OSLU;5T5W`7F& zfrqx>U@|{0X#UClRQ}{1qTl=+HEWmCMvnOy%)_8nOR5q0$}7-Amsg_3Mq(ooXtpe@ zW66?b_%E21CKJewqDw zCea8&l$>I#&H(|o{oqHqj(a-1(wg3FyYM6EoLhq#j#IyADeaptqW=Cb;=BDeBz74Q zX2v*Ub|+pnC7vdSmRV6 zs9SvjUZH^WEQISJswC#8-+|Lmi~Q2pk%Z4M>kgVC8b3x`2l6#*X%(-7xim(CG*+5??!jqx54gP0ZPE9QW(-;K53T~KHMx9|EARXW zgHQf}xk;B$;cK+n&EWPrQli@X^2ag~TG>8Jxi>^Uid8B8f zl?#rG>DkCn+=Bh&v*;bWO1G3zt%kX$qvrhDjfOoZN$5#H7LaqItA* zF66mgySVDQxg^pyS}AIylB;VYfX4AOMO$(CiU9XqS3%E&%g%0xO&ta;H6~h@oMX$p zPPT8_MBUb{$aox;N}X{6N=rjifnXXJRK!r1Zo+D)WV-JN!&`n$=Fy!DOB3IsMFf{D$GzxMayMOvYK}6{ zGeEn!1jFz#(0!O-T?b0T(3H*MW&^DyQfThIwFXBC3>5cmN%P2F8=?H%-V(s^GqL3)d;m`}+EMDAKA|`Lz z{5C%OqaP7Tj1g;T;rxS#kenRqzyJ(186bm!gNa5_(b#-Ce7Ld-iJ&%Su>BuCP5Tf3 znJ6x31)f5?9>N|cwtg|A5C1C?fkcq?`6%B04!-(@FEE@|*nq1{j^(!DWFkxsR3dWA zIiCJ03*3eHeLl3EC2jc-0>;xtsv=}vjLwJxKiNQ3ZE&kJ$TJRKl7Um z*3S)KQo~d-&s{%wfnqkzM-TPjC=Z`u^1vrIF*Y(xV`~S2yYFG&d)`H)wu$Ct9kho8 zqJM}~_aHrez4(>FBaVknyt#39-!cmyZ)rl~k;hMQbb!~2XV~-Pdd^$k44wwhMR+cz zQ)JQCzs8;$-i`?jFJ4S*I81VSnp`GH(Wt?13eeR=qb~l~80q9*lu=}0LA*3W%C~)luKfH)1&4)iN)b*uoc>K5&L)2@WyKxIM_woz#w~ezsQo;UC6}51TBd^yl^XM z!L-$dOA)O#j_snVlMM6^(9qn7lbga025{X1qbZM;h{edzC}U%zOpcF}7)#)K9)Umr zDNDJSC?`Hb2-2ApS6*{1+H;XY($e0}Z{G1vTK@6#v)cAfdUX-_2@|QVI(^NDswxpE z3Qnn_f);2)6aDcwsJLq>hetdX#tYzj7`Y798`shU1U--7FCS!j`3mB(7`;ai(6qFX zyy`)_A;vPjAT-MJuq!6%?;E74rHOoUg8q^HXxGKHi*)a>ky4i7AQ%b(0x2a@g3(a~xq3O5ZBii1|;G~UkEf9i=${=PrysR7;5F*WVVStdn zf(lmRkDAy;56^Z<(vRnQ^!4`Q=Cim~0p)qK+Eq$Xv@CMDEXk>HMhE*C?mou&k%OeW z_L1Aam%9D?8TgKH7Arm5I){%k_A^pW3^&1M0?@X;4(j9$v_kuMW9 zRx-ElMl2_T=V&tK7{fy&q*EEPQw7En$I0cgSXL3A-^ZfGOIWpLE$44KpVtKZyg3+P zb3DfD{RV4Y#iHai{_zBpC?5ap-QLJ`yF$L}+l8}T8fLg@m9={?lcHIu&OmXZ~fbyv_P0!8D}&Qsvc zlYfad)HB`JOWqYkeHwQreUu>6DZFEcSl8IbqZ8F^(j!zX+fYUqgguS>`^T`>ufyl} zGuGe5il&d_swxH&_v80hP;hMKH~#~fVi!)nA7}g+o~!8_KS*s&6F#4hzMfu|EM7t| z7{KsJDh!i=X&@s}Yy@o!7BG>VqV=+?XnyIl_r}`Vb~5Y{`@B#dSnZ`9{m-M{bUOd{qSkF z??{lD93)azN7LWF1G_YITqFii)7f!$&DYGG1KXZqqUfVF;^LM+JhQEq1O2FZLl~(^ zUf|T(ps;YdYE3S%cR-z(YHp#aX%(p#!u=R?s#4LqehDY*_d+y2W!$CU@g$ z5S~TUY+`xKhe)QjQc%;lZY6=ZpQ*_SYHI2*+dFvh@!wNbQ$xt-M=OQxdgO`)?0la2 zW{CHE`FVPFZ(->0HnPc4T9;l%GLz%tn{MVm?!A{-Hiv_WL{Zh=c6RuxdF@CvX}8oF zaWzN{sthlDppWfGFJ4WcXAgJWbv-@b{65yvF8ZFD!UI~Wswn^$cv#gJ8#C2UP%c8Ndk>2iZS}*Qk^LPIjhkyMLJHPvFCWc4Q z8mih`S+jXF%in%8{>o~!63kn39c|}bi&hFPC5F;eHZOn6dG3e1-v(as#dP>^T7`BojTy zXx+WLoZbpTvG{5Ix>MjQTN*Ku6x&P%Ey;-leL^!lG{o5G2%{sT7^aD7 znn)=zghVMd3sjl_h1QVCr-(oF5Mj&05)!l~9Ipg%4$Vhut1+Yx%PSeXI#Z!UfG89p zmqBGyP(C1VvUH9N^YkN+Fn8ZR+DAq)UAOeDPZS-`RCx zFN7lz3|UIO3xxuXW0Oj!a4ZWmkszAS2f9f6n+6ZlfuX(5vF;X=Hs@*H4i>?hMAk0zq6N|8xI{Ko6V3&lxl63 zRYavyketSvn84THM{O!iY+{1CY!)c3x;)@g@(X79dWrz!MDQpQYi&5U*-I%1R7J>* zI(U>02PsM=p;JTxMHljEglWF?-9JfAEiP8y#H*a(IRGeH=IfxyP}`MBh+J5PJ|DI*s`5{k#kjwH(ufe8;9%@e8O z?Eku;lH>4a!p}^>%-w6Ilf3Dh-#q1=@;;M1kVQ~D>64`%yKe4_=edax7c}IVb~Pahv6A1IO?WgQ)6*D+aYo1Z z$I45Wz=;ZsE_Z_<4P==yYmKDbp2o*GVWtS;;9{Vtm=oiI>)y$wpSY8%rpD4e%f9Ai z%wBTCeP814H7j{)w2_!!u_#t#)P|5Bd?z_eA;HUM5youv%jGVHmF%{A6H&BBgyop3=U;pww}35v1@lMTiVR z3ObKLfsXSxu>OX(v2ybpscvtXWtfqdJDGLXlNtBl@E&&k;%E4b0Cy~%M4$;vL7Tta zt8;<5^Vrs1L1E9HKMMZj{$A;|XY5c|nql4V4Bo`9OI+17d+LXms(Bc!sq(+A$?66mm-oE{u{j!;#Ub%yk)!HKF8uKOsBLe3#gJ!{v&JbQ1Qqo)d}_~jJ~M9xdlMDRudtaDwHdZGW&lF2Li$e2 z0%of_B`udUoGk;-)Y41cQ^6P!#tGqK;*!H7%j)Z{=bC#yN#mjgv(D=;A?G}bHe*)L z{NMq8_}+Kor-s`WO;Qyo)y(FHLc9>!#MI+knF(4mA*w*hc@C@Vf9tK}y-OzWH1roV zvbwafF*sq?>2lsyIyO>X%R-XSVMd9RJEjiO@3Q9VYkBK^|3ppMtp5~m{pZRbbqH~0 zyZD9G7csQ=0F4pBZ40L;+I~h_E+F~4$7ju2QGzzg*As-8AdH2N0y#WvmRxuVSA6O& zI@YZsQuFFKuU8^}(h1CBCdX&yuOc&^WnDvti|ZW@wqC^0Bah)*`9|LuL$&S?k!I>0B(ADx(MtqE2{_~38 + + + + + + + + + + diff --git a/gwt-charts/.classpath b/gwt-charts/.classpath new file mode 100644 index 0000000..d9ea1ab --- /dev/null +++ b/gwt-charts/.classpath @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt-charts/.project b/gwt-charts/.project new file mode 100644 index 0000000..382db27 --- /dev/null +++ b/gwt-charts/.project @@ -0,0 +1,46 @@ + + + gwt-charts + + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.google.gdt.eclipse.core.webAppProjectValidator + + + + + com.google.gwt.eclipse.core.gwtProjectValidator + + + + + net.sourceforge.metrics.builder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + net.sf.eclipsecs.core.CheckstyleBuilder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + com.google.gwt.eclipse.core.gwtNature + net.sourceforge.metrics.nature + net.sf.eclipsecs.core.CheckstyleNature + + diff --git a/gwt-charts/.settings/com.google.gdt.eclipse.core.prefs b/gwt-charts/.settings/com.google.gdt.eclipse.core.prefs new file mode 100644 index 0000000..d169f00 --- /dev/null +++ b/gwt-charts/.settings/com.google.gdt.eclipse.core.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +jarsExcludedFromWebInfLib= +warSrcDir=src/main/webapp +warSrcDirIsOutput=false diff --git a/gwt-charts/.settings/com.google.gwt.eclipse.core.prefs b/gwt-charts/.settings/com.google.gwt.eclipse.core.prefs new file mode 100644 index 0000000..b7c1376 --- /dev/null +++ b/gwt-charts/.settings/com.google.gwt.eclipse.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +entryPointModules= +filesCopiedToWebInfLib=gwt-servlet.jar diff --git a/gwt-charts/.settings/gwt-checkstyle.xml b/gwt-charts/.settings/gwt-checkstyle.xml new file mode 100644 index 0000000..48e6eeb --- /dev/null +++ b/gwt-charts/.settings/gwt-checkstyle.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gwt-charts/.settings/org.eclipse.core.resources.prefs b/gwt-charts/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..cf6931b --- /dev/null +++ b/gwt-charts/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding/=UTF-8 diff --git a/gwt-charts/.settings/org.eclipse.jdt.core.prefs b/gwt-charts/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..8fc4c4d --- /dev/null +++ b/gwt-charts/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,374 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.doc.comment.support=enabled +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=warning +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning +org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled +org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore +org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag +org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled +org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=warning +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameter=warning +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning +org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=true +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.jdt.core.formatter.comment.line_length=120 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=false +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/gwt-charts/.settings/org.eclipse.jdt.ui.prefs b/gwt-charts/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..f1bb5cc --- /dev/null +++ b/gwt-charts/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,60 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=false +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=true +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_trailing_whitespaces=false +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_blocks=true +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_eclipse-cs gwt-charts +cleanup_settings_version=2 +eclipse.preferences.version=1 +formatter_profile=_eclipse-cs gwt-charts +formatter_settings_version=12 +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=\#com.google;com.google;\#com;com;\#junit;junit;\#net;net;\#org;org;\#java;java;\#javax;javax;\#;; +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.staticondemandthreshold=99 diff --git a/gwt-charts/.settings/org.eclipse.m2e.core.prefs b/gwt-charts/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..56da862 --- /dev/null +++ b/gwt-charts/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,5 @@ +#Fri Mar 23 15:55:46 GMT 2012 +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/gwt-charts/.settings/org.eclipse.wst.jsdt.core.prefs b/gwt-charts/.settings/org.eclipse.wst.jsdt.core.prefs new file mode 100644 index 0000000..fe0b684 --- /dev/null +++ b/gwt-charts/.settings/org.eclipse.wst.jsdt.core.prefs @@ -0,0 +1,260 @@ +#Mon May 23 16:47:32 EDT 2011 +eclipse.preferences.version=1 +org.eclipse.wst.jsdt.core.formatter.align_type_members_on_columns=false +org.eclipse.wst.jsdt.core.formatter.alignment_for_arguments_in_allocation_expression=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_arguments_in_enum_constant=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_arguments_in_method_invocation=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_assignment=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_binary_expression=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_compact_if=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_conditional_expression=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.wst.jsdt.core.formatter.alignment_for_expressions_in_array_initializer=48 +org.eclipse.wst.jsdt.core.formatter.alignment_for_multiple_fields=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_parameters_in_constructor_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_parameters_in_method_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_selector_in_method_invocation=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_superclass_in_type_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=4 +org.eclipse.wst.jsdt.core.formatter.alignment_for_throws_clause_in_method_declaration=4 +org.eclipse.wst.jsdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_after_package=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_field=0 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_method=2 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_before_package=0 +org.eclipse.wst.jsdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.wst.jsdt.core.formatter.blank_lines_between_type_declarations=0 +org.eclipse.wst.jsdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_objlit_initializer=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.wst.jsdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.wst.jsdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.wst.jsdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true +org.eclipse.wst.jsdt.core.formatter.comment.format_block_comments=true +org.eclipse.wst.jsdt.core.formatter.comment.format_header=true +org.eclipse.wst.jsdt.core.formatter.comment.format_html=true +org.eclipse.wst.jsdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.wst.jsdt.core.formatter.comment.format_line_comments=true +org.eclipse.wst.jsdt.core.formatter.comment.format_source_code=true +org.eclipse.wst.jsdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.wst.jsdt.core.formatter.comment.indent_root_tags=true +org.eclipse.wst.jsdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.wst.jsdt.core.formatter.comment.insert_new_line_for_parameter=do not insert +org.eclipse.wst.jsdt.core.formatter.comment.line_length=80 +org.eclipse.wst.jsdt.core.formatter.compact_else_if=true +org.eclipse.wst.jsdt.core.formatter.continuation_indentation=4 +org.eclipse.wst.jsdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.wst.jsdt.core.formatter.continuation_indentation_for_objlit_initializer=2 +org.eclipse.wst.jsdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.wst.jsdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.wst.jsdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.wst.jsdt.core.formatter.indent_empty_lines=false +org.eclipse.wst.jsdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.wst.jsdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.wst.jsdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.wst.jsdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.wst.jsdt.core.formatter.indentation.size=2 +org.eclipse.wst.jsdt.core.formatter.insert_new_line_after_annotation=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_after_comma_in_objlit_initializer=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_after_opening_brace_in_objlit_initializer=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_closing_brace_in_objlit_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.wst.jsdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_colon_in_object_initializer=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_colon_in_object_initializer=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.wst.jsdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.wst.jsdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.wst.jsdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.wst.jsdt.core.formatter.keep_empty_objlit_initializer_on_one_line=false +org.eclipse.wst.jsdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.wst.jsdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.wst.jsdt.core.formatter.lineSplit=80 +org.eclipse.wst.jsdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.wst.jsdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.wst.jsdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.wst.jsdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.wst.jsdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.wst.jsdt.core.formatter.tabulation.char=space +org.eclipse.wst.jsdt.core.formatter.tabulation.size=2 +org.eclipse.wst.jsdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.wst.jsdt.core.formatter.wrap_before_binary_operator=false diff --git a/gwt-charts/.settings/org.jboss.ide.eclipse.as.core.prefs b/gwt-charts/.settings/org.jboss.ide.eclipse.as.core.prefs new file mode 100644 index 0000000..ff2efb8 --- /dev/null +++ b/gwt-charts/.settings/org.jboss.ide.eclipse.as.core.prefs @@ -0,0 +1,3 @@ +#Wed Mar 28 11:03:00 BST 2012 +eclipse.preferences.version=1 +org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/gwt-charts/pom.xml b/gwt-charts/pom.xml new file mode 100644 index 0000000..dd720df --- /dev/null +++ b/gwt-charts/pom.xml @@ -0,0 +1,255 @@ + + 4.0.0 + com.googlecode.gwt-charts + gwt-charts + 0.9.11-SNAPSHOT + jar + + GWT Charts + Unofficial Google Chart Tools API for Google Web Toolkit + http://code.google.com/p/gwt-charts + 2012 + + + org.sonatype.oss + oss-parent + 9 + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + http://gwt-charts.googlecode.com/svn/trunk/gwt-charts + scm:svn:http://gwt-charts.googlecode.com/svn/trunk/gwt-charts + scm:svn:https://gwt-charts.googlecode.com/svn/trunk/gwt-charts + + + + + Rui Afonso + + + + + + com.google.gwt + gwt-user + 2.6.0 + provided + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + + + + org.codehaus.mojo + gwt-maven-plugin + 2.6.0 + + + + resources + compile + + + + + + org.apache.maven.plugins + maven-war-plugin + 2.3 + + src/main/webapp + src/main/webapp/WEB-INF/web.xml + + + + org.apache.maven.plugins + maven-site-plugin + 3.2 + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + verify + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9 + + + attach-sources + verify + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.codehaus.mojo + + + gwt-maven-plugin + + + [2.4.0,) + + + resources + + + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + [1.0.0,) + + enforce + + + + + + + + + + + + + + + + http://code.google.com/p/gwt-charts/issues + Google Code + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8.1 + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.9 + false + + + + checkstyle + + + + + .settings/gwt-checkstyle.xml + + + + org.apache.maven.plugins + maven-pmd-plugin + 2.6 + + true + 1.5 + + + + + org.apache.maven.plugins + maven-jxr-plugin + 2.3 + + true + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.11 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.4 + + + org.codehaus.mojo + taglist-maven-plugin + 2.4 + + + TODO + FIXME + + + + + target/site + + + + UTF-8 + + \ No newline at end of file diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/BoundingBox.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/BoundingBox.java new file mode 100644 index 0000000..94eaa09 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/BoundingBox.java @@ -0,0 +1,60 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +/** + * Represents the boundaries of a box, defined by left, top, width and height. + */ +public class BoundingBox extends JavaScriptObject { + + protected BoundingBox() { + } + + /** + * Returns the height of this box. + * + * @return value in pixels + */ + public final native int getHeight()/*-{ + return this.height; + }-*/; + + /** + * Returns the left coordinate of this box. + * + * @return value in pixels + */ + public final native int getLeft()/*-{ + return this.left; + }-*/; + + /** + * Returns the top coordinate of this box. + * + * @return value in pixels + */ + public final native int getTop()/*-{ + return this.top; + }-*/; + + /** + * Returns the width of this box. + * + * @return value in pixels + */ + public final native int getWidth()/*-{ + return this.width; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartEditor.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartEditor.java new file mode 100644 index 0000000..c03d4b8 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartEditor.java @@ -0,0 +1,115 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.googlecode.gwt.charts.client.event.CancelEvent; +import com.googlecode.gwt.charts.client.event.CancelHandler; +import com.googlecode.gwt.charts.client.event.HandlerRef; +import com.googlecode.gwt.charts.client.event.OkEvent; +import com.googlecode.gwt.charts.client.event.OkHandler; + +/** + * The ChartEditor class is used to open an in-page dialog box that enables a user to customize a visualization on the + * fly.
+ * To use ChartEditor: + *
    + *
  • Load the {@link ChartPackage#CHARTEDITOR} package. You do not need to load the packages for the chart type that + * you render in the editor; the chart editor will load that package for you.
  • + *
  • Create a ChartWrapperObject object that defines the chart for the user to customize. This chart will be shown in the + * dialog, and the user uses the editor to redesign the chart, change chart types, or even change the source data.
  • + *
  • Create a new ChartEditor instance, and register to listen for the "ok" event. This event is thrown when the user + * clicks the "OK" button on the dialog. When received, you should call ChartEditor.getChartWrapper() to retrieve the + * user-modified chart.
  • + *
  • Call ChartEditor.openDialog(), passing in the ChartWrapperObject. This opens the dialog. The dialog buttons enable the + * user to close the editor. The ChartEditor instance is available as long as it is in scope; it is not automatically + * destroyed after the user closes the dialog.
  • + *
  • To update the chart in code, call setChartWrapper().
  • + *
+ */ +public class ChartEditor extends HasListeners { + /** + * Creates a empty ChartEditor instance. + * + * @return a new ChartEditor instance + */ + public static native ChartEditor create() /*-{ + return new $wnd.google.visualization.ChartEditor(); + }-*/; + + // TODO implement chart editor options: dataSourceInput + protected ChartEditor() { + // Default constructor. + } + + /** + * Fired when the user clicks the "Cancel" button on the dialog. + * + * @param handler the error handler + * @return a reference for removing this handler + */ + public final HandlerRef addCancelHandler(CancelHandler handler) { + return addListener(CancelEvent.NAME, handler); + } + + /** + * Fired when the user clicks the "OK" button on the dialog. After receiving this method, you should call + * getChartWrapper() to retrieve the user-configured chart. + * + * @param handler the ready handler + * @return a reference for removing this handler + */ + public final HandlerRef addOkHandler(OkHandler handler) { + return addListener(OkEvent.NAME, handler); + } + + /** + * Closes the chart editor dialog box. + */ + public final native void closeDialog()/*-{ + this.closeDialog(chartWrapperObject); + }-*/; + + /** + * Returns a ChartWrapperObject representing the chart, with user modifications. + * + * @return a ChartWrapperObject representing the chart + */ + public final native ChartWrapper getChartWrapper()/*-{ + return this.getChartWrapper(); + }-*/; + + /** + * Opens the chart editor as an embedded dialog box on the page. The function returns immediately; it does not wait + * for the dialog to be closed. If you do not lose scope of the instance, you can call openDialog() again to reopen + * the dialog, although you must pass in a ChartWrapperObject object again. + * + * @param chartWrapperObject A ChartWrapperObject object defining the initial chart to render in the window. The chart + * must either have a populated DataTable, or be connected to a valid data source. This wrapper is copied + * internally to the chart editor, so any later changes that you make to your ChartWrapperObject handle will not be + * reflected in + * the chart editor's copy. + */ + public final native void openDialog(ChartWrapper chartWrapperObject)/*-{ + this.openDialog(chartWrapperObject); + }-*/; + + /** + * Use this method to update the rendered chart on the editor. + * + * @param chartWrapperObject A ChartWrapperObject object representing the new chart to render. The chart must either have + * a populated DataTable, or be connected to a valid data source. + */ + public final native void setChartWrapper(ChartWrapper chartWrapperObject)/*-{ + this.setChartWrapper(chartWrapperObject); + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLayoutInterface.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLayoutInterface.java new file mode 100644 index 0000000..5ce21c3 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLayoutInterface.java @@ -0,0 +1,150 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +/** + * Represents an object containing information about the onscreen placement of the chart and its elements. + */ +public class ChartLayoutInterface extends JavaScriptObject { + + protected ChartLayoutInterface() { + } + + /** + * Returns an object containing the left, top, width, and height of chart element id.
+ * The format for id isn't yet + * documented (they're the return values of event handlers), but here are some examples: + *

+ * ChartLayoutInterface cli = chart.getChartLayoutInterface(); + *

+ *

Height of the chart area

cli.getBoundingBox("chartarea").getHeight()

Width of the third + * bar in the first series of a bar or column chart

cli.getBoundingBox("bar#0#2").getWidth()

+ * Bounding box of the fifth wedge of a pie chart

cli.getBoundingBox("slice#4")

Bounding box + * of the chart data of a vertical (e.g., column) chart:

cli.getBoundingBox("vAxis#0#gridline") + *

+ * Bounding box of the chart data of a horizontal (e.g., bar) chart:

+ * cli.getBoundingBox("hAxis#0#gridline") + *

+ * Values are relative to the container of the chart. Call this after the chart is drawn. + *

+ * + * @return a BoundingBox + */ + public final native BoundingBox getBoundingBox()/*-{ + return this.getBoundingBox(); + }-*/; + + /** + * Returns an object containing the left, top, width, and height of the chart content.
+ * Call this after the chart is drawn. + * + * @return a BoundingBox + */ + public final native BoundingBox getChartAreaBoundingBox()/*-{ + return this.getChartAreaBoundingBox(); + }-*/; + + /** + * Returns the logical horizontal value at position, which is an offset from the chart container's left edge.
+ * Can be negative. Call this after the chart is drawn. + * + * @param position offset from the chart container's left edge + * @return logical horizontal value in pixels + */ + public final native int getHAxisValue(int position) /*-{ + return this.getHAxisValue(position); + }-*/; + + /** + * Returns the logical horizontal value at position, which is an offset from the chart container's left edge.
+ * Can be negative. Call this after the chart is drawn. + * + * @param position offset from the chart container's left edge + * @param axisIndex axis index + * @return logical horizontal value in pixels + */ + public final native int getHAxisValue(int position, int axisIndex) /*-{ + return this.getHAxisValue(position, axisIndex); + }-*/; + + /** + * Returns the logical horizontal value at position, which is an offset from the chart container's top edge.
+ * Can be negative. Call this after the chart is drawn. + * + * @param position offset from the chart container's top edge + * @return logical horizontal value in pixels + */ + public final native int getVAxisValue(int position) /*-{ + return this.getVAxisValue(position); + }-*/; + + /** + * Returns the logical vertical value at position, which is an offset from the chart container's top edge.
+ * Can be negative. Call this after the chart is drawn. + * + * @param position offset from the chart container's top edge + * @param axisIndex axis index + * @return logical vertical value in pixels + */ + public final native int getVAxisValue(int position, int axisIndex) /*-{ + return this.getVAxisValue(position, axisIndex); + }-*/; + + /** + * Returns the screen x-coordinate of position relative to the chart's container.
+ * Call this after the chart is drawn. + * + * @param position offset + * @return screen x-coordinate of position + */ + public final native int getXLocation(int position)/*-{ + return this.getXLocation(position); + }-*/; + + /** + * Returns the screen x-coordinate of position relative to the chart's container.
+ * Call this after the chart is drawn. + * + * @param position offset + * @param axisIndex axis index + * @return screen x-coordinate of position + */ + public final native int getXLocation(int position, int axisIndex) /*-{ + return this.getXLocation(position, axisIndex); + }-*/; + + /** + * Returns the screen y-coordinate of position relative to the chart's container.
+ * Call this after the chart is drawn. + * + * @param position horizontal offset + * @return screen y-coordinate of position + */ + public final native int getYLocation(int position) /*-{ + return this.getYLocation(position); + }-*/; + + /** + * Returns the screen y-coordinate of position relative to the chart's container.
+ * Call this after the chart is drawn. + * + * @param position vertical offset + * @param axisIndex axis index + * @return screen y-coordinate of position + */ + public final native int getYLocation(int position, int axisIndex) /*-{ + return this.getYLocation(position, axisIndex); + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLoader.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLoader.java new file mode 100644 index 0000000..f482d03 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartLoader.java @@ -0,0 +1,117 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.i18n.client.LocaleInfo; + +import com.googlecode.gwt.charts.client.apiloader.ApiLoader; +import com.googlecode.gwt.charts.client.apiloader.ApiLoaderOptions; + +/** + * Utility class for loading the Chart Tools API using the Google Ajax Loader. + */ +public class ChartLoader { + private static final String API_NAME = "visualization"; + private static final String API_VERSION = "1.1"; + + private ChartPackage[] packages; + private String language; + private String version; + + /** + * Creates a chart loader with the specified packages. + * + * @param packages a list of ChartPackage's + */ + public ChartLoader(ChartPackage... packages) { + setPackages(packages); + setLanguage(LocaleInfo.getCurrentLocale().getLocaleName()); + setVersion(API_VERSION); + } + + /** + * Returns the current language. + * + * @return the language + */ + public String getLanguage() { + return language; + } + + /** + * Returns the current packages. + * + * @return the packages + */ + public ChartPackage[] getPackages() { + return packages; + } + + /** + * Returns the current version. + * + * @return the version + */ + public String getVersion() { + return version; + } + + /** + * Loads requested API libraries and calls an handler after finished. + * + * @param callback the handler to be called + */ + public void loadApi(Runnable callback) { + String[] packagesArray = new String[packages.length]; + for (int i = 0; i < packages.length; i++) { + packagesArray[i] = packages[i].getName(); + } + ApiLoaderOptions options = ApiLoaderOptions.create(); + options.setPackages(packagesArray); + if (language != null) { + options.setLanguage(language); + } + ApiLoader.loadApi(API_NAME, version, callback, options); + } + + /** + * Sets the display language for the charts. + * Must be set before {@link #loadApi(Runnable)} is called. + * + * @param language the language to set + */ + public void setLanguage(String language) { + this.language = language; + } + + /** + * Sets the packages for loading + * Must be set before {@link #loadApi(Runnable)} is called. + * + * @param packages the packages to load + */ + public void setPackages(ChartPackage... packages) { + this.packages = packages; + } + + /** + * Sets the api version for loading + * Must be set before {@link #loadApi(Runnable)} is called. + * + * @param version the version to use + */ + public void setVersion(String version) { + this.version = version; + } + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartObject.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartObject.java new file mode 100644 index 0000000..b38d72c --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartObject.java @@ -0,0 +1,242 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayInteger; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.options.Options; +import com.googlecode.gwt.charts.client.table.TableSortInfo; + +/** + * Represents a generic chart javascript object with all common methods. + * Each chart implementation adds their own specific methods. + */ +public class ChartObject extends HasListeners { + + protected ChartObject() { + } + + /** + * Clears the chart, and releases all of its allocated resources. + */ + public final native void clearChart() /*-{ + this.clearChart(); + }-*/; + + /** + * Collapses or expands the node on an OrgChart. + * + * @param row index of the row to expand or collapse. + * @param collapsed whether to collapse or expand the row, where true means collapse. + */ + public final native void collapse(int row, boolean collapsed) /*-{ + this.collapse(row, collapsed); + }-*/; + + /** + * Create a diff chart with two datasets to generate a third dataset representing the diff. + * + * @param oldData a first dataset + * @param newData a second dataset + * @return a third dataset representing the diff + */ + public final native DataSource computeDiff(DataSource oldData, DataSource newData) /*-{ + return this.computeDiff(oldData, newData); + }-*/; + + /** + * Draws the visualization on the page. Behind the scenes this can be fetching a graphic from a server or creating + * the graphic on the page using the linked visualization code. You should call this method every time the data or + * options change. The object should be drawn inside the DOM element passed into the constructor. + * + * @param data tipically a {@link DataTable} or {@link DataView} holding the data to use to draw the chart. + * @see draw() API + * reference + */ + public final native void draw(DataSource data) /*-{ + this.draw(data); + }-*/; + + /** + * Draws the visualization on the page. Behind the scenes this can be fetching a graphic from a server or creating + * the graphic on the page using the linked visualization code. You should call this method every time the data or + * options change. The object should be drawn inside the DOM element passed into the constructor. + * + * @param data a {@link DataTable} or {@link DataView} holding the data to use to draw the chart. + * @param options A map of name/value pairs of custom options. + * @see draw API reference + */ + public final native void draw(DataSource data, Options options) /*-{ + this.draw(data, options); + }-*/; + + /** + * Returns an object containing information about the onscreen placement of the chart and its elements.
+ * Call this after the chart is drawn. + * + * @return a ChartLayoutInterface + */ + public final native ChartLayoutInterface getChartLayoutInterface() /*-{ + return this.getChartLayoutInterface(); + }-*/; + + /** + * Returns an array with the indexes of the children of the given node. + * + * @param row the given node + * @return an array of indexes + */ + public final native JsArrayInteger getChildrenIndexes(int row) /*-{ + return this.getChildrenIndexes(row); + }-*/; + + /** + * Returns an array with the list of the collapsed node's indexes. + * + * @return an array of indexes + */ + public final native JsArrayInteger getCollapsedNodes() /*-{ + return this.getCollapsedNodes(); + }-*/; + + /** + * Returns the chart serialized as an image URI.
+ * + * Call this after the chart is drawn. + * + * @return a serialized image URI + * @see Printing PNG Charts + */ + public final native String getImageURI() /*-{ + return this.getImageURI(); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.treemap.TreeMap}.
+ * Returns the maximum possible depth for the current view. + * + * @return the maximum possible depth + */ + public final native int getMaxPossibleDepth() /*-{ + this.getMaxPossibleDepth(); + }-*/; + + /** + * This is optionally exposed by visualizations that want to let you access the currently selected data in the + * graphic.
+ * Returns an array of selected objects, each one describing a data element in the underlying table used to create + * the visualization (a DataView or a DataTable). Each object has properties row and/or column, with the index of + * the row and/or column of the selected item in the underlying DataTable. If the row property is null, then the + * selection is a column; if the column property is null, then the selection is a row; if both are non-null, then it + * is a specific data item. You can call one of the {@link DataTable}.getValue() methods to get the value of the + * selected item. The retrieved array can be passed into {@link #setSelection(JsArray)}. + * + * @return an array of selected objects + * @see getSelection + * API reference + */ + public final native JsArray getSelection() /*-{ + return this.getSelection(); + }-*/; + + /** + * Call this method to retrieve information about the current sort state of a table that has been sorted (typically + * by the user, who has clicked on a column heading to sort the rows by a specific column). If you have disabled + * sorting, this method will not work. + * + * If you have not sorted data in code, or the user has not sorted data by selecting code, the default sort values + * will be returned. + * + * @return information about the current sort state + */ + public final native TableSortInfo getSortInfo() /*-{ + return this.getSortInfo(); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.annotationchart.AnnotationChart}.
+ * Returns an object with start and end properties, which each one of them is a Date object, representing the + * current time selection. + * + * @return an object with start and end + */ + public final native DateRange getVisibleChartRange() /*-{ + return this.getVisibleChartRange(); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.treemap.TreeMap}.
+ * Move up the tree by one level and redraw it. Does not throw an error if the node is the root node. This is fired + * automatically when the user right-clicks a node. + */ + public final native void goUpAndDraw() /*-{ + this.goUpAndDraw(); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.annotationchart.AnnotationChart}.
+ * Hides the specified data series from the chart. Accepts one parameter which can be a number or an array of + * numbers, in which 0 refers to the first data series, and so on. + * + * @param columnIndexes + */ + public final native void hideDataColumns(JsArrayInteger columnIndexes) /*-{ + this.hideDataColumns(columnIndexes); + }-*/; + + /** + * Selects a data entry in the visualization—for example, a point in an area chart, or a bar in a bar chart. When + * this method is called, the visualization should visually indicate what the new selection is. The implementation + * of setSelection() should not fire a "select" event. Visualizations may ignore part of the selection. For example, + * a table that can show only selected rows may ignore cell or column elements in its setSelection() implementation, + * or it can select the entire row. + * + * Every time this method is called, all selected items are deselected, and the new selection list passed in should + * be applied. There is no explicit way to deselect individual items; to deselect individual items, call + * setSelection() with the items to remain selected; to deselect all elements, call setSelection(), + * setSelection(null), or setSelection([]). + * + * @param selection an array of objects, each with a numeric row and/or column property + * @see setSelection + * API reference + */ + public final native void setSelection(JsArray selection) /*-{ + this.setSelection(selection); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.annotationchart.AnnotationChart}.
+ * Sets the visible range (zoom) to the specified range. Accepts two parameters of type Date that represent the + * first and last times of the wanted selected visible range. + * + * @param start set to null to include everything from the earliest date to end + * @param end set to null to include everything from start to the last date + */ + public final native void setVisibleChartRange(JsDate start, JsDate end) /*-{ + this.setVisibleChartRange(start, end); + }-*/; + + /** + * Currently only applies to {@link com.googlecode.gwt.charts.client.annotationchart.AnnotationChart}.
+ * Shows the specified data series from the chart, after they were hidden using hideDataColumns method. Accepts one + * parameter which can be a number or an array of numbers, in which 0 refers to the first data series, and so on. + * + * @param columnIndexes + */ + public final native void showDataColumns(JsArrayInteger columnIndexes) /*-{ + this.showDataColumns(columnIndexes); + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartPackage.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartPackage.java new file mode 100644 index 0000000..de91b8b --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartPackage.java @@ -0,0 +1,102 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +/** + * A definition of available packages. + */ +public enum ChartPackage { + /** + * Exclusive use for annotation charts. + */ + ANNOTATIONCHART("annotationchart"), + /** + * Exclusive use for calendar charts. + */ + CALENDAR("calendar"), + /** + * Used for chart editor. No need to load the packages for the chart type that you render in the editor; the + * chart editor will load that package for you. + */ + CHARTEDITOR("charteditor"), + /** + * Used for controls and dashboards. + */ + CONTROLS("controls"), + /** + * Use for area, bar, bubble, candlestick, column, combo, line, pie, scatter and stepped area charts. + */ + CORECHART("corechart"), + /** + * Exclusive use for gauge charts. + */ + GAUGE("gauge"), + /** + * Exclusive use for geochart charts. + */ + GEOCHART("geochart"), + /** + * Exclusive use for map charts. + */ + MAP("map"), + /** + * Exclusive use for orgchart charts. + */ + ORGCHART("orgchart"), + /** + * Exclusive use for sankey diagrams. + */ + SANKEY("sankey"), + /** + * Exclusive use for tables. + */ + TABLE("table"), + /** + * Exclusive use for timelines. + */ + TIMELINE("timeline"), + /** + * Exclusive use for treemap charts. + */ + TREEMAP("treemap"); + + /** + * Get a ChartPackage by providing its name. + * + * @param name the ChartPackage name. + * @return a ChartPackage corresponding to the provided name. + */ + public static ChartPackage findByName(String name) { + for (ChartPackage chartPackage : ChartPackage.values()) { + if (chartPackage.getName().equals(name)) { + return chartPackage; + } + } + return null; + } + + private final String name; + + private ChartPackage(String name) { + this.name = name; + } + + /** + * Get the name of the ChartPackage. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartType.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartType.java new file mode 100644 index 0000000..b43aa42 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartType.java @@ -0,0 +1,133 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +/** + * A definition of currently available chart types. + */ +public enum ChartType { + /** + * Annotation chart. + */ + ANNOTATION("Annotation"), + /** + * Area chart. + */ + AREA("AreaChart"), + /** + * Bar chart. + */ + BAR("BarChart"), + /** + * Bubble chart. + */ + BUBBLE("BubbleChart"), + /** + * Annotation chart. + */ + CALENDAR("Calendar"), + /** + * Candlestick chart. + */ + CANDLESTICK("CandlestickChart"), + /** + * Column chart. + */ + COLUMN("ColumnChart"), + /** + * Combo chart, a mix of lines, bars, and area charts. + */ + COMBO("ComboChart"), + /** + * Gauge chart. + */ + GAUGE("Gauge"), + /** + * Geo chart. + */ + GEO_CHART("GeoChart"), + /** + * Histogram. + */ + HISTOGRAM("Histogram"), + /** + * Line chart. + */ + LINE("LineChart"), + /** + * Map. + */ + MAP("Map"), + /** + * Org chart. + */ + ORGCHART("OrgChart"), + /** + * Pie chart. + */ + PIE("PieChart"), + /** + * Sankey chart. + */ + SANKEY("Sankey"), + /** + * Scatter chart. + */ + SCATTER("ScatterChart"), + /** + * Stepped area chart. + */ + STEPPED_AREA("SteppedAreaChart"), + /** + * Table. + */ + TABLE("Table"), + /** + * Timeline. + */ + TIMELINE("Timeline"), + /** + * Tree map. + */ + TREE_MAP("TreeMap"); + + /** + * Get a ChartType by providing its name. + * + * @param name the ChartType name. + * @return a ChartType corresponding to the provided name. + */ + public static ChartType findByName(String name) { + for (ChartType chartType : ChartType.values()) { + if (chartType.getName().equals(name)) { + return chartType; + } + } + return null; + } + + private final String name; + + private ChartType(String name) { + this.name = name; + } + + /** + * Get the name of the ChartType. + * + * @return the name + */ + public String getName() { + return name; + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWidget.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWidget.java new file mode 100644 index 0000000..99ce7a1 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWidget.java @@ -0,0 +1,189 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.dom.client.Element; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.ui.RequiresResize; +import com.google.gwt.user.client.ui.Widget; + +import com.googlecode.gwt.charts.client.event.Event; +import com.googlecode.gwt.charts.client.event.EventHandler; +import com.googlecode.gwt.charts.client.event.HandlerRef; +import com.googlecode.gwt.charts.client.options.Options; + +import java.util.HashMap; + +/** + * This class is used as a widget wrapper for all chart types. + * Supports automatically resizing via {@link RequiresResize}, which means that all parents + * must implement {@link com.google.gwt.user.client.ui.ProvidesResize} for this to work. + * It also supports attach/detach funcionality. + * + * @param the chart options type + */ +public abstract class ChartWidget extends Widget implements RequiresResize { + protected ChartObject chartObject; + private DataSource data; + private Options options; + private HashMap eventMap; + private boolean unloaded; + private boolean pending; + + /** + * Creates a new ChartWidget. + */ + public ChartWidget() { + super(); + Element chartDiv = DOM.createDiv(); + chartObject = createChartObject(chartDiv); + setElement(chartDiv); + eventMap = new HashMap(); + } + + /** + * Clears the chart, and releases all of its allocated resources. + */ + public void clearChart() { + chartObject.clearChart(); + } + + /** + * Draws the visualization on the page. Behind the scenes this can be fetching a graphic from a server or creating + * the graphic on the page using the linked visualization code. You should call this method every time the data or + * options change. + * + * @param data a {@link DataTable} or {@link DataView} holding the data to use to draw the chart. + * @see draw API reference + */ + public void draw(DataSource data) { + draw(data, null); + } + + /** + * Draws the visualization on the page. Behind the scenes this can be fetching a graphic from a server or creating + * the graphic on the page using the linked visualization code. You should call this method every time the data or + * options change. + * + * @param data a {@link DataTable} or {@link DataView} holding the data to use to draw the chart. + * @param options A map of name/value pairs of custom options. + * @see draw API reference + */ + public void draw(DataSource data, T options) { + this.data = data; + this.options = options; + redraw(); + } + + /** + * Fires an event to all listeners. + * + * @param event the event object to fire + */ + public void fireEvent(Event event) { + chartObject.trigger(event.getEventName(), event.getProperties()); + } + + @Override + public void onResize() { + redraw(); + } + + /** + * Redraws the chart with last used data and options. + */ + public void redraw() { + if (pending) { + return; + } + pending = true; + // Double deferred command because of layout issues + Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { + + @Override + public void execute() { + Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { + + @Override + public void execute() { + redrawNow(); + } + }); + } + }); + } + + /** + * Removes all existing handlers from this chart. + */ + public void removeAllHandlers() { + eventMap.clear(); + chartObject.removeAllListeners(); + } + + /** + * Removes a single handler matching the given handler reference. + * + * @param handlerRef an handler reference + */ + public void removeHandler(HandlerRef handlerRef) { + eventMap.remove(handlerRef); + chartObject.removeListener(handlerRef); + } + + /** + * Call this method to register to receive events fired by a visualization hosted on your page. Note that this will + * not work for visualizations embedded in a gadget. + * + * @param + * @param handler the function to call when the event is fired + * @return the new handler reference. Can be used for removing by calling {@link #removeHandler(HandlerRef)}. + */ + protected final HandlerRef addHandler(H handler) { + HandlerRef handlerRef = chartObject.addListener(handler.getEventName(), handler); + eventMap.put(handlerRef, handler); + return handlerRef; + } + + protected abstract ChartObject createChartObject(Element parent); + + @Override + protected void onLoad() { + if (!unloaded) { + return; + } + unloaded = false; + recreate(); + redraw(); + } + + @Override + protected void onUnload() { + this.unloaded = true; + } + + protected void recreate() { + chartObject = createChartObject(getElement()); + for (EventHandler eventHandler : eventMap.values()) { + chartObject.addListener(eventHandler.getEventName(), eventHandler); + } + } + + protected void redrawNow() { + if (data != null) { + chartObject.draw(data, options); + } + pending = false; + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapper.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapper.java new file mode 100644 index 0000000..228fc3d --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapper.java @@ -0,0 +1,622 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsArrayString; +import com.google.gwt.dom.client.Document; +import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.ui.RequiresResize; +import com.google.gwt.user.client.ui.Widget; + +import com.googlecode.gwt.charts.client.event.ErrorHandler; +import com.googlecode.gwt.charts.client.event.EventHandler; +import com.googlecode.gwt.charts.client.event.HandlerRef; +import com.googlecode.gwt.charts.client.event.ReadyHandler; +import com.googlecode.gwt.charts.client.event.SelectHandler; +import com.googlecode.gwt.charts.client.options.Options; + +import java.util.Date; + +/** + * A ChartWrapper class is used to wrap your chart and handle all loading, drawing, and Datasource querying for your + * chart. The class exposes convenience methods for setting values on the chart and drawing it. This class simplifies + * reading from a data source, because you do not have to create a query callback handler. You can also use it to save a + * chart easily for reuse. + * + * Another bonus of using ChartWrapper is that you can reduce the number of library loads by using dynamic loading. + * Additionally, you don't need to load the JSAPI library explicitly, and ChartWrapperObject will handle looking up the + * chart + * libraries for you, so you do not need to specify any chart libraries in your loading statement. See the examples + * below for details. + * + * However, ChartWrapper currently only propagates a subset of events thrown by charts: select, ready, and error. Other + * events are not transmitted through the ChartWrapper instance; to get other events, you must call getChart() and + * subscribe to events directly on the chart handle. + * + * Supports automatically resizing via {@link RequiresResize}, which means that all parents + * must implement {@link com.google.gwt.user.client.ui.ProvidesResize} for this to work. + * + * @param the options this chart implements + */ +public class ChartWrapper extends Widget implements RequiresResize { + private ChartWrapperObject chartWrapperObject; + + /** + * Creates a empty ChartWrapperObject instance. + * You must set all the appropriate properties using the set... methods exposed by this object. + */ + public ChartWrapper() { + super(); + setElement(Document.get().createDivElement()); + chartWrapperObject = ChartWrapperObject.create(); + setContainerId(DOM.createUniqueId()); + } + + /** + * Creates a ChartWrapperObject instance with the provided properties. + * + * @param chartWrapperSpec chart properties specification + */ + public ChartWrapper(ChartWrapperSpec chartWrapperSpec) { + super(); + setElement(Document.get().createDivElement()); + chartWrapperObject = ChartWrapperObject.create(chartWrapperSpec); + } + + /** + * Fired when an error occurs when attempting to render the chart. + * + * @param handler the error handler + * @return a reference for removing this handler + */ + public HandlerRef addErrorHandler(ErrorHandler handler) { + return chartWrapperObject.addErrorHandler(handler); + } + + /** + * Adds an event directly to the chart. + * Make sure the underlying chart supports the supplied event + * + * @param handler the chart handler + * @return a reference for removing this handler + */ + public HandlerRef addHandler(EventHandler handler) { + return chartWrapperObject.addHandler(handler); + } + + /** + * The chart is ready for external method calls. If you want to interact with the chart, and call methods after you + * draw it, you should set up a listener for this event before you call the draw method, and call them only after + * the event was fired + * + * @param handler the ready handler + * @return a reference for removing this handler + */ + public HandlerRef addReadyHandler(ReadyHandler handler) { + return chartWrapperObject.addReadyHandler(handler); + } + + /** + * Fired when the user clicks a bar or legend. When a chart element is selected, the corresponding cell in the data + * table is selected; when a legend is selected, the corresponding column in the data table is selected. To learn + * what has been selected, call getSelection(). Note that this will only be thrown + * when the + * underlying chart type throws a selection event. + * + * @param handler the select handler + * @return a reference for removing this handler + */ + public HandlerRef addSelectHandler(SelectHandler handler) { + return chartWrapperObject.addSelectHandler(handler); + } + + /** + * Returns a deep copy of the chart wrapper. + * + * @return a deep copy of the ChartWrapperObject + */ + public ChartWrapperObject cloneObject() { + return chartWrapperObject.cloneObject(); + } + + /** + * Draws the chart. You must call this method after any changes that you make to the chart or data to show the + * changes. + */ + public void draw() { + chartWrapperObject.draw(); + } + + /** + * Returns a reference to the chart created by this ChartWrapperObject, for example a google.visualization.BarChart + * or a + * google.visualization.ColumnChart. This will return null until after you have called draw() on the + * ChartWrapperObject + * object, and it throws a ready event. Methods called on the returned object will be reflected on the page. + * + * @return a reference to the chart object + */ + public ChartObject getChart() { + return chartWrapperObject.getChart(); + } + + /** + * Returns the chart name assigned by {@link #setChartName(String)}. + * + * @return chart name + */ + public String getChartName() { + return chartWrapperObject.getChartName(); + } + + /** + * The class name of the wrapped chart. If this is a Google chart, the name will not be qualified with + * google.visualization. So, for example, if this were a Treemap chart, it would return "Treemap" rather than + * "google.visualization.treemap". + * + * @return class name of the wrapped chart + */ + public String getChartType() { + return chartWrapperObject.getChartType(); + } + + /** + * The ID of the chart's DOM container element. + * + * @return DOM container ID + */ + public String getContainerId() { + return chartWrapperObject.getContainerId(); + } + + /** + * If this chart gets its data from a data source, returns the URL for this data source. Otherwise, returns null. + * + * @return URL for this data source + */ + public String getDataSourceUrl() { + return chartWrapperObject.getDataSourceUrl(); + } + + /** + * If this chart gets its data from a locally-defined DataTable, will return a reference to the chart's DataTable. + * If this chart gets its data from a data source, it will return null. + * Any changes that you make to the returned object will be reflected by the chart the next time you call + * {@link #draw()}. + * + * @return a reference to the chart's DataTable + */ + public DataTable getDataTable() { + return chartWrapperObject.getDataTable(); + } + + /** + * Returns the underlying chart object. + * + * @return the underlying chart object + */ + public ChartWrapperObject getObject() { + return chartWrapperObject; + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public boolean getOptionBoolean(String key) { + return chartWrapperObject.getOptionBoolean(key); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public boolean getOptionBoolean(String key, boolean defaultValue) { + return chartWrapperObject.getOptionBoolean(key, defaultValue); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public Date getOptionDate(String key) { + return chartWrapperObject.getOptionDate(key); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public Date getOptionDate(String key, Date defaultValue) { + return chartWrapperObject.getOptionDate(key, defaultValue); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public double getOptionNumber(String key) { + return chartWrapperObject.getOptionNumber(key); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public double getOptionNumber(String key, double defaultValue) { + return chartWrapperObject.getOptionNumber(key, defaultValue); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public JavaScriptObject getOptionObject(String key) { + return chartWrapperObject.getOptionObject(key); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public JavaScriptObject getOptionObject(String key, JavaScriptObject defaultValue) { + return chartWrapperObject.getOptionObject(key, defaultValue); + } + + /** + * Returns the options object for this chart. + * + * @return the options object for this chart + */ + public T getOptions() { + return chartWrapperObject.getOptions(); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public String getOptionString(String key) { + return chartWrapperObject.getOptionString(key); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public String getOptionString(String key, String defaultValue) { + return chartWrapperObject.getOptionString(key, defaultValue); + } + + /** + * The query string for this chart, if it has one and queries, a data source. + * + * @return query string for this chart + */ + public String getQuery() { + return chartWrapperObject.getQuery(); + } + + /** + * Any refresh interval for this chart, if it queries a data source. Zero indicates no refresh. + * + * @return refresh interval in seconds + */ + public int getRefreshInterval() { + return chartWrapperObject.getRefreshInterval(); + } + + /** + * Returns an array of selected objects, each one describing a data element in the underlying table used to create + * the + * visualization (a DataView or a DataTable). Each object has properties row and/or column, with the index of the + * row and/or column of the selected item in the underlying DataTable. If the row property is null, then the + * selection is a column; if the column property is null, then the selection is a row; if both are non-null, then it + * is a specific data item. You can call the DataTable.getValue() method to get the value of the selected item. The + * retrieved array can be passed into setSelection(). + * + * @return an array of selected objects + */ + public JsArray getSelection() { + return chartWrapperObject.getSelection(); + } + + /** + * Returns the DataView initializer object. + * + * @return the DataView initializer object + */ + public DataView getView() { + return chartWrapperObject.getView(); + } + + /** + * Returns an array of DataView initializer objects. + * + * @return an array of DataView initializer objects + */ + public JsArray getViewArray() { + return chartWrapperObject.getViewArray(); + } + + @Override + public void onResize() { + if (chartWrapperObject.getChart() != null) { + draw(); + } + } + + /** + * Unregister all event handlers. + */ + public void removeAllHandlers() { + chartWrapperObject.removeAllListeners(); + } + + /** + * Unregister an existing event handlers. + * + * @param handlerRef event handler reference + */ + public void removeHandler(HandlerRef handlerRef) { + chartWrapperObject.removeListener(handlerRef); + } + + /** + * Sets an arbitrary name for the chart. This is not shown anywhere on the chart, unless a custom chart is + * explicitly designed to use it. + * + * @param chartName an arbitrary name for the chart + */ + public void setChartName(String chartName) { + chartWrapperObject.setChartName(chartName); + } + + /** + * Sets the chart type. + * + * @param chartType the chart type to display + */ + public void setChartType(ChartType chartType) { + chartWrapperObject.setChartType(chartType); + } + + /** + * Sets the ID of the containing DOM element for the chart. + * + * @param containerId the DOM element ID + */ + public void setContainerId(String containerId) { + getElement().setId(containerId); + chartWrapperObject.setContainerId(containerId); + } + + /** + * Sets the URL of a data source to use for this chart. If you also set a data table for this object, the data + * source URL will be ignored. + * + * @param url the URL of a data source to use for this chart + */ + public void setDataSourceUrl(String url) { + chartWrapperObject.setDataSourceUrl(url); + } + + /** + * Sets the DataTable for the chart. + * + * @param dataTable the DataTable object for the chart + */ + public void setDataTable(DataTable dataTable) { + chartWrapperObject.setDataTable(dataTable); + } + + /** + * Sets the DataTable for the chart. + * + * @param dataTable an array following the syntax of + * {@link com.googlecode.gwt.charts.client.util.ChartHelper#arrayToDataTable(JsArrayMixed)} + */ + public void setDataTable(JsArrayMixed dataTable) { + chartWrapperObject.setDataTable(dataTable); + } + + /** + * Sets the DataTable for the chart. + * + * @param json a JSON representation of a DataTable + */ + public void setDataTable(String json) { + chartWrapperObject.setDataTable(json); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. To unset an option, pass + * in null for the value. Note that key may be a qualified name, such as 'vAxis.title'. + * + * @param key + * @param value + */ + public void setOption(String key, boolean value) { + chartWrapperObject.setOption(key, value); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public void setOption(String key, Date value) { + chartWrapperObject.setOption(key, value); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public void setOption(String key, double value) { + chartWrapperObject.setOption(key, value); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public void setOption(String key, JavaScriptObject value) { + chartWrapperObject.setOption(key, value); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public void setOption(String key, String value) { + chartWrapperObject.setOption(key, value); + } + + /** + * Unsets an option. + * + * @param key the option key + */ + public void setOptionNull(String key) { + chartWrapperObject.setOptionNull(key); + } + + /** + * Sets a complete options object for a chart. + * + * @param options a complete options object + */ + public void setOptions(T options) { + chartWrapperObject.setOptions(options); + } + + /** + * Sets a query string, if this chart queries a data source. You must also set the data source URL if specifying + * this value. + * + * @param query a data source query string + */ + public void setQuery(String query) { + chartWrapperObject.setQuery(query); + } + + /** + * Sets the refresh interval for this chart, if it queries a data source. You must also set a data source URL if + * specifying this value. Zero indicates no refresh. + * + * @param refreshInterval refresh interval for this chart in seconds + */ + public void setRefreshInterval(int refreshInterval) { + chartWrapperObject.setRefreshInterval(refreshInterval); + } + + /** + * Selects a data entry in the visualization—for example, a point in an area chart, or a bar in a bar chart. When + * this method is called, the visualization should visually indicate what the new selection is. The implementation + * of setSelection() should not fire a "select" event. Visualizations may ignore part of the selection. For example, + * a table that can show only selected rows may ignore cell or column elements in its setSelection() implementation, + * or it can select the entire row. + * + * Every time this method is called, all selected items are deselected, and the new selection list passed in should + * be applied. There is no explicit way to deselect individual items; to deselect individual items, call + * setSelection() with the items to remain selected; to deselect all elements, call setSelection(), + * setSelection(null), or setSelection([]). + * + * @param selection + */ + public void setSelection(JsArray selection) { + chartWrapperObject.setSelection(selection); + } + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data. The chart wrapper must have + * underlying data from a DataTable or a data source to apply this view to. The first DataView in the array is + * applied to the underlying data to create a + * new data table, and the second DataView is applied to the data table resulting from application of the first + * DataView, and so on. + * + * @param view an array of DataView initializer objects, like that returned by dataview.toJSON() + */ + public void setView(JsArrayString view) { + chartWrapperObject.setView(view); + } + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data. The chart wrapper must have + * underlying data from a DataTable or a data source to apply this view to. + * + * @param view a DataView initializer object, like that returned by dataview.toJSON() + */ + public void setView(String view) { + chartWrapperObject.setView(view); + } + + /** + * Returns a string version of the JSON representation of the chart. + * + * @return a JSON representation of the chart + */ + public String toJSON() { + return chartWrapperObject.toJSON(); + } + + /** + * Call this method to fire an event with an arbitrary name and set of values. + * + * @param eventName A string name to call the event. You can choose any string value that you want. + * @param properties A map of name/value pairs to pass to the receiving method. + */ + public void trigger(String eventName, Properties properties) { + chartWrapperObject.trigger(eventName, properties); + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperObject.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperObject.java new file mode 100644 index 0000000..651fb9f --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperObject.java @@ -0,0 +1,596 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsArrayString; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.event.ErrorEvent; +import com.googlecode.gwt.charts.client.event.ErrorHandler; +import com.googlecode.gwt.charts.client.event.EventHandler; +import com.googlecode.gwt.charts.client.event.HandlerRef; +import com.googlecode.gwt.charts.client.event.ReadyEvent; +import com.googlecode.gwt.charts.client.event.ReadyHandler; +import com.googlecode.gwt.charts.client.event.SelectEvent; +import com.googlecode.gwt.charts.client.event.SelectHandler; +import com.googlecode.gwt.charts.client.options.Options; +import com.googlecode.gwt.charts.client.util.ChartHelper; +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * A ChartWrapperObject class is used to wrap your chart and handle all loading, drawing, and Datasource querying for + * your + * chart. The class exposes convenience methods for setting values on the chart and drawing it. This class simplifies + * reading from a data source, because you do not have to create a query callback handler. You can also use it to save a + * chart easily for reuse. + * + * Another bonus of using ChartWrapperObject is that you can reduce the number of library loads by using dynamic + * loading. + * Additionally, you don't need to load the JSAPI library explicitly, and ChartWrapperObject will handle looking up the + * chart + * libraries for you, so you do not need to specify any chart libraries in your loading statement. See the examples + * below for details. + * + * However, ChartWrapperObject currently only propagates a subset of events thrown by charts: select, ready, and error. + * Other + * events are not transmitted through the ChartWrapperObject instance; to get other events, you must call getChart() and + * subscribe to events directly on the chart handle. + * + * @param the options this chart implements + */ +public class ChartWrapperObject extends HasListeners { + /** + * Creates a empty ChartWrapperObject instance. + * You must set all the appropriate properties using the set... methods exposed by this object. + * + * @param the chart options type + * + * @return a new ChartWrapperObject instance + */ + public static native ChartWrapperObject create() /*-{ + return new $wnd.google.visualization.ChartWrapper(); + }-*/; + + /** + * Creates a ChartWrapperObject instance with the provided properties. + * + * @param the chart options type + * + * @param chartWrapperSpec chart properties specification + * @return a new ChartWrapperObject instance + */ + public static native ChartWrapperObject create(ChartWrapperSpec chartWrapperSpec) /*-{ + return new $wnd.google.visualization.ChartWrapper(chartWrapperSpec); + }-*/; + + protected ChartWrapperObject() { + // Default constructor. + } + + /** + * Fired when an error occurs when attempting to render the chart. + * + * @param handler the error handler + * @return a reference for removing this handler + */ + public final HandlerRef addErrorHandler(ErrorHandler handler) { + return addListener(ErrorEvent.NAME, handler); + } + + /** + * Adds an event directly to the chart. + * + * @param handler the chart handler + * @return a reference for removing this handler + */ + public final HandlerRef addHandler(final EventHandler handler) { + return addListener(ReadyEvent.NAME, new ReadyHandler() { + + @Override + public void onReady(ReadyEvent event) { + addListener(getChart(), handler.getEventName(), handler); + } + }); + } + + /** + * The chart is ready for external method calls. If you want to interact with the chart, and call methods after you + * draw it, you should set up a listener for this event before you call the draw method, and call them only after + * the event was fired + * + * @param handler the ready handler + * @return a reference for removing this handler + */ + public final HandlerRef addReadyHandler(ReadyHandler handler) { + return addListener(ReadyEvent.NAME, handler); + } + + /** + * Fired when the user clicks a bar or legend. When a chart element is selected, the corresponding cell in the data + * table is selected; when a legend is selected, the corresponding column in the data table is selected. To learn + * what has been selected, call ChartWrapperObject.getChart().getSelection(). Note that this will only be thrown + * when the + * underlying chart type throws a selection event. + * + * @param handler the select handler + * @return a reference for removing this handler + */ + public final HandlerRef addSelectHandler(SelectHandler handler) { + return addListener(SelectEvent.NAME, handler); + } + + /** + * Returns a deep copy of the chart wrapper. + * + * @return a deep copy of the ChartWrapperObject + */ + public final native ChartWrapperObject cloneObject() /*-{ + this.clone(); + }-*/; + + /** + * Draws the chart. You must call this method after any changes that you make to the chart or data to show the + * changes. + */ + public final native void draw() /*-{ + this.draw(); + }-*/; + + /** + * Returns a reference to the chart created by this ChartWrapperObject, for example a google.visualization.BarChart + * or a + * google.visualization.ColumnChart. This will return null until after you have called draw() on the + * ChartWrapperObject + * object, and it throws a ready event. Methods called on the returned object will be reflected on the page. + * + * @return a reference to the chart object + */ + public final native ChartObject getChart() /*-{ + return this.getChart(); + }-*/; + + /** + * Returns the chart name assigned by {@link #setChartName(String)}. + * + * @return chart name + */ + public final native String getChartName() /*-{ + return this.getChartName(); + }-*/; + + /** + * The class name of the wrapped chart. If this is a Google chart, the name will not be qualified with + * google.visualization. So, for example, if this were a Treemap chart, it would return "Treemap" rather than + * "google.visualization.treemap". + * + * @return class name of the wrapped chart + */ + public final native String getChartType() /*-{ + return this.getChartType(); + }-*/; + + /** + * The ID of the chart's DOM container element. + * + * @return DOM container ID + */ + public final native String getContainerId() /*-{ + return this.getContainerId(); + }-*/; + + /** + * If this chart gets its data from a data source, returns the URL for this data source. Otherwise, returns null. + * + * @return URL for this data source + */ + public final native String getDataSourceUrl() /*-{ + return this.getDataSourceUrl(); + }-*/; + + /** + * If this chart gets its data from a locally-defined DataTable, will return a reference to the chart's DataTable. + * If this chart gets its data from a data source, it will return null. + * Any changes that you make to the returned object will be reflected by the chart the next time you call + * {@link #draw()}. + * + * @return a reference to the chart's DataTable + */ + + public final native DataTable getDataTable() /*-{ + return this.getDataTable(); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public final native boolean getOptionBoolean(String key) /*-{ + return this.getOption(key); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public final native boolean getOptionBoolean(String key, boolean defaultValue) /*-{ + return this.getOption(key, defaultValue); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public final Date getOptionDate(String key) { + JsDate jsDate = this.getOptionObject(key).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public final Date getOptionDate(String key, Date defaultValue) { + JsDate jsDate = this.getOptionObject(key, DateHelper.getJsDate(defaultValue)).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public final native double getOptionNumber(String key) /*-{ + return this.getOption(key); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public final native double getOptionNumber(String key, double defaultValue) /*-{ + return this.getOption(key, defaultValue); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public final native JavaScriptObject getOptionObject(String key) /*-{ + return this.getOption(key); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public final native JavaScriptObject getOptionObject(String key, JavaScriptObject defaultValue) /*-{ + return this.getOption(key, defaultValue); + }-*/; + + /** + * Returns the options object for this chart. + * + * @return the options object for this chart + */ + public final native T getOptions() /*-{ + return this.getOptions(); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @return the value specified by key + */ + public final native String getOptionString(String key) /*-{ + return this.getOption(key); + }-*/; + + /** + * Returns the specified chart option value. + * + * @param key The name of the option to retrieve. May be a qualified name, such as 'vAxis.title' + * @param defaultValue If the specified value is undefined or null, this value will be returned. + * @return the value specified by key + */ + public final native String getOptionString(String key, String defaultValue) /*-{ + return this.getOption(key, defaultValue); + }-*/; + + /** + * The query string for this chart, if it has one and queries, a data source. + * + * @return query string for this chart + */ + public final native String getQuery() /*-{ + return this.getQuery(); + }-*/; + + /** + * Any refresh interval for this chart, if it queries a data source. Zero indicates no refresh. + * + * @return refresh interval in seconds + */ + public final native int getRefreshInterval() /*-{ + return this.getRefreshInterval(); + }-*/; + + /** + * Returns an array of selected objects, each one describing a data element in the underlying table used to create + * the + * visualization (a DataView or a DataTable). Each object has properties row and/or column, with the index of the + * row and/or column of the selected item in the underlying DataTable. If the row property is null, then the + * selection is a column; if the column property is null, then the selection is a row; if both are non-null, then it + * is a specific data item. You can call the DataTable.getValue() method to get the value of the selected item. The + * retrieved array can be passed into setSelection(). + * + * @return an array of selected objects + */ + public final JsArray getSelection() { + return getChart().getSelection(); + } + + /** + * Returns the DataView initializer object. + * + * @return the DataView initializer object + */ + public final native DataView getView() /*-{ + return this.getView(); + }-*/; + + /** + * Returns an array of DataView initializer objects. + * + * @return an array of DataView initializer objects + */ + public final native JsArray getViewArray() /*-{ + return this.getViewArray(); + }-*/; + + /** + * Sets an arbitrary name for the chart. This is not shown anywhere on the chart, unless a custom chart is + * explicitly designed to use it. + * + * @param chartName an arbitrary name for the chart + */ + public final native void setChartName(String chartName) /*-{ + this.setChartName(chartName); + }-*/; + + /** + * Sets the chart type. + * + * @param chartType the chart type to display + */ + public final void setChartType(ChartType chartType) { + setChartType(chartType.getName()); + } + + /** + * Sets the ID of the containing DOM element for the chart. + * + * @param containerId the DOM element ID + */ + public final native void setContainerId(String containerId) /*-{ + this.setContainerId(containerId); + }-*/; + + /** + * Sets the URL of a data source to use for this chart. If you also set a data table for this object, the data + * source URL will be ignored. + * + * @param url the URL of a data source to use for this chart + */ + public final native void setDataSourceUrl(String url) /*-{ + this.setDataSourceUrl(url); + }-*/; + + /** + * Sets the DataTable for the chart. + * + * @param dataTable the DataTable object for the chart + */ + public final native void setDataTable(DataTable dataTable) /*-{ + this.setDataTable(dataTable); + }-*/; + + /** + * Sets the DataTable for the chart. + * + * @param dataTable an array following the syntax of {@link ChartHelper#arrayToDataTable(JsArrayMixed)} + */ + public final native void setDataTable(JsArrayMixed dataTable) /*-{ + this.setDataTable(dataTable); + }-*/; + + /** + * Sets the DataTable for the chart. + * + * @param json a JSON representation of a DataTable + */ + public final native void setDataTable(String json) /*-{ + this.setDataTable(json); + }-*/; + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public final native void setOption(String key, boolean value) /*-{ + this.setOption(key, value); + }-*/; + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public final void setOption(String key, Date value) { + this.setOption(key, DateHelper.getJsDate(value)); + } + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public final native void setOption(String key, double value) /*-{ + this.setOption(key, value); + }-*/; + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public final native void setOption(String key, JavaScriptObject value) /*-{ + this.setOption(key, value); + }-*/; + + /** + * Sets a single chart option value, where key is the option name and value is the value. + * To unset an option, call {@link #setOptionNull(String)}. + * + * @param key may be a qualified name, such as 'vAxis.title'. + * @param value the value to set + */ + public final native void setOption(String key, String value) /*-{ + this.setOption(key, value); + }-*/; + + /** + * Unsets an option. + * + * @param key the option key + */ + public final native void setOptionNull(String key) /*-{ + this.setOption(key); + }-*/; + + /** + * Sets a complete options object for a chart. + * + * @param options a complete options object + */ + public final native void setOptions(T options) /*-{ + this.setOptions(options); + }-*/; + + /** + * Sets a query string, if this chart queries a data source. You must also set the data source URL if specifying + * this value. + * + * @param query a data source query string + */ + public final native void setQuery(String query) /*-{ + this.setQuery(query); + }-*/; + + /** + * Sets the refresh interval for this chart, if it queries a data source. You must also set a data source URL if + * specifying this value. Zero indicates no refresh. + * + * @param refreshInterval refresh interval for this chart in seconds + */ + public final native void setRefreshInterval(int refreshInterval) /*-{ + this.setRefreshInterval(refreshInterval); + }-*/; + + /** + * Selects a data entry in the visualization—for example, a point in an area chart, or a bar in a bar chart. When + * this method is called, the visualization should visually indicate what the new selection is. The implementation + * of setSelection() should not fire a "select" event. Visualizations may ignore part of the selection. For example, + * a table that can show only selected rows may ignore cell or column elements in its setSelection() implementation, + * or it can select the entire row. + * + * Every time this method is called, all selected items are deselected, and the new selection list passed in should + * be applied. There is no explicit way to deselect individual items; to deselect individual items, call + * setSelection() with the items to remain selected; to deselect all elements, call setSelection(), + * setSelection(null), or setSelection([]). + * + * @param selection + */ + public final void setSelection(JsArray selection) { + getChart().setSelection(selection); + } + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data. The chart wrapper must have + * underlying data from a DataTable or a data source to apply this view to. The first DataView in the array is + * applied to the underlying data to create a + * new data table, and the second DataView is applied to the data table resulting from application of the first + * DataView, and so on. + * + * @param view an array of DataView initializer objects, like that returned by dataview.toJSON() + */ + public final native void setView(JsArrayString view) /*-{ + this.setView(view); + }-*/; + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data. The chart wrapper must have + * underlying data from a DataTable or a data source to apply this view to. + * + * @param view a DataView initializer object, like that returned by dataview.toJSON() + */ + public final native void setView(String view) /*-{ + this.setView(view); + }-*/; + + /** + * Returns a string version of the JSON representation of the chart. + * + * @return a JSON representation of the chart + */ + public final native String toJSON() /*-{ + this.toJSON(); + }-*/; + + private final native void setChartType(String chartType) /*-{ + this.setChartType(chartType); + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperSpec.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperSpec.java new file mode 100644 index 0000000..881d715 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ChartWrapperSpec.java @@ -0,0 +1,160 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArrayMixed; +import com.google.gwt.core.client.JsArrayString; + +import com.googlecode.gwt.charts.client.options.Options; + +/** + * A ChartWrapperObject initializer specification as described in google.visualization.drawChart(). + * + * @param the chart options type + */ +public class ChartWrapperSpec extends JavaScriptObject { + /** + * Creates a new instance. + * @param chartType the class name of the visualization + * @param containerId containerId ID of the DOM element + * @return the new instance + */ + public static ChartWrapperSpec create(ChartType chartType, String containerId) { + ChartWrapperSpec chartWrapperSpec = createObject().cast(); + chartWrapperSpec.setChartType(chartType); + chartWrapperSpec.setContainerId(containerId); + return chartWrapperSpec; + } + + protected ChartWrapperSpec() { + } + + /** + * Sets the class name of the visualization. The google.visualization package name can be omitted for Google charts. + * If the appropriate visualization library has not already been loaded, this method will load the library for you if + * this is a Google visualization; you must load third party visualizations explicitly + * + * @param chartType the class name of the visualization + */ + public final void setChartType(ChartType chartType) { + setChartType(chartType.getName()); + } + + /** + * Sets the ID of the DOM element on your page that will host the visualization. + * + * @param containerId ID of the DOM element + */ + public final native void setContainerId(String containerId) /*-{ + this.containerId = containerId; + }-*/; + + /** + * Sets a data source query to populate the chart data (for example, a Google Spreadsheet). You must specify either + * this + * property or the dataTable property. + * + * @param dataSourceUrl data source query to populate the chart data + */ + public final native void setDataSourceUrl(String dataSourceUrl) /*-{ + this.dataSourceUrl = dataSourceUrl; + }-*/; + + /** + * Sets the data table used to populate the visualization. + * You must specify either this property or the dataSourceUrl property. + * + * @param dataTable a DataLiteral object + */ + public final native void setDataTable(DataLiteral dataTable) /*-{ + this.dataTable = dataTable; + }-*/; + + /** + * Sets the data table used to populate the visualization. + * You must specify either this property or the dataSourceUrl property. + * + * @param dataTable a DataTable reference + */ + public final native void setDataTable(DataTable dataTable) /*-{ + this.dataTable = dataTable; + }-*/; + + /** + * Sets the data table used to populate the visualization. + * You must specify either this property or the dataSourceUrl property. + * + * @param dataTable a two-dimensional array like that accepted by {@link com.googlecode.gwt.charts.client.util.ChartHelper#arrayToDataTable(JsArrayMixed)} + */ + public final native void setDataTable(JsArrayMixed dataTable) /*-{ + this.dataTable = dataTable; + }-*/; + + /** + * Sets the options for the visualization. + * + * @param options + */ + public final native void setOptions(T options) /*-{ + this.options = options; + }-*/; + + /** + * If specifying dataSourceUrl, you can optionally specify a SQL-like query string using the Visualization query + * language to filter or manipulate the data. + * + * @param query a SQL-like query string + */ + public final native void setQuery(String query) /*-{ + this.query = query; + }-*/; + + /** + * Sets how often, in seconds, the visualization should refresh its query source. Use this only when specifying + * dataSourceUrl. + * + * @param refreshInterval the refresh interval in seconds + */ + public final native void setRefreshInterval(int refreshInterval) /*-{ + this.refreshInterval = refreshInterval; + }-*/; + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data, as defined by either the + * dataTable or dataSourceUrl parameter. You can pass in either a string or DataView initializer object, like that + * returned by dataview.toJSON(). + * + * @param view + */ + // TODO review this + public final native void setView(JsArrayString view) /*-{ + this.view = view; + }-*/; + + /** + * Sets a DataView initializer object, which acts as a filter over the underlying data, as defined by either the + * dataTable or dataSourceUrl parameter. + * + * @param view DataView initializer object, like that returned by {@link DataView#toJSON()} + */ + public final native void setView(String view) /*-{ + this.view = view; + }-*/; + + private final native void setChartType(String chartType) /*-{ + this.chartType = chartType; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnFunction.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnFunction.java new file mode 100644 index 0000000..e5f8759 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnFunction.java @@ -0,0 +1,29 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +/** + * An interface for providing a calculated function to a DataViewColumn. + */ +public interface ColumnFunction { + /** + * A function that will be called for each row in the column to calculate a value for that cell. The function + * signature is func(dataTable, row), where dataTable is the source DataTable, and row is the index of the + * source data row. The function should return a single value of the type specified by type. + * + * @param dataTable is the source DataTable + * @param row is the index of the source data row + * @return should return a single value of the type specified by the column type + */ + public Object calc(DataTable dataTable, int row); +} \ No newline at end of file diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnRange.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnRange.java new file mode 100644 index 0000000..bc55246 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnRange.java @@ -0,0 +1,158 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * Represents the minimal and maximal values of values in a specified column. + */ +public class ColumnRange extends JavaScriptObject { + + protected ColumnRange() { + // Default constructor. + } + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final native boolean getMaxBoolean() /*-{ + return this.max; + }-*/; + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final Date getMaxDate() { + JsDate jsDate = getMaxObject().cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final native double getMaxNumber() /*-{ + return this.max; + }-*/; + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final native JavaScriptObject getMaxObject() /*-{ + return this.max; + }-*/; + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final native String getMaxString() /*-{ + return this.max; + }-*/; + + /** + * Returns the maximum existing value. + * + * @return the maximum existing value + */ + public final native TimeOfDay getMaxTimeOfDay() /*-{ + return this.max; + }-*/; + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final native boolean getMinBoolean() /*-{ + return this.min; + }-*/; + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final Date getMinDate() { + JsDate jsDate = getMinObject().cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final native double getMinNumber() /*-{ + return this.min; + }-*/; + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final native JavaScriptObject getMinObject() /*-{ + return this.min; + }-*/; + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final native String getMinString() /*-{ + return this.min; + }-*/; + + /** + * Returns the minimum existing value. + * + * @return the minimum existing value + */ + public final native TimeOfDay getMinTimeOfDay() /*-{ + return this.min; + }-*/; + + /** + * Checks if max is null. + * + * @return true if null, false otherwise + */ + public final native boolean isMaxNull() /*-{ + return this.max == null; + }-*/; + + /** + * Checks if min is null. + * + * @return true if null, false otherwise + */ + public final native boolean isMinNull() /*-{ + return this.min == null; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnType.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnType.java new file mode 100644 index 0000000..e5c5d60 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/ColumnType.java @@ -0,0 +1,73 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +/** + * Data type of the values of a DataTable column. + */ +public enum ColumnType { + /** + * Text column. + */ + STRING("string"), + /** + * Integer or decimal column. + */ + NUMBER("number"), + /** + * Boolean column. + */ + BOOLEAN("boolean"), + /** + * Date column (without time). + */ + DATE("date"), + /** + * Date and time column. + */ + DATETIME("datetime"), + /** + * A time of day column. + */ + TIMEOFDAY("timeofday"); + + /** + * Get the corresponding ColumnType by name. + * + * @param name a string representing the ColumnType name. + * @return a ColumnType corresponding to the provided name. + */ + public static ColumnType findByName(String name) { + for (ColumnType columnType : ColumnType.values()) { + if (columnType.getName().equals(name)) { + return columnType; + } + } + return null; + } + + private final String name; + + private ColumnType(String name) { + this.name = name; + } + + /** + * Get the name of the ColumnType. + * + * @return the name of the ColumnType. + */ + public String getName() { + return name; + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataCell.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataCell.java new file mode 100644 index 0000000..cbdb8e4 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataCell.java @@ -0,0 +1,122 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * Represents a cell object for adding to a DataTable. + * + * @see Cell Objects + */ +public class DataCell extends JavaScriptObject { + + /** + * Default static constructor. + * + * @return a new object + */ + public static DataCell create() { + return createObject().cast(); + } + + protected DataCell() { + } + + /** + * A string version of the v value, formatted for display. The visualization will not use this value for + * calculation, only as a label for display. If omitted, a string version of v will be used. + * + * @param f a string version of the v value + */ + public final native void setF(String f) /*-{ + this.f = f; + }-*/; + + /** + * An object that is a map of custom values applied to the cell. These values can be of any JavaScript type. If your + * visualization supports any cell-level properties, it will describe them; otherwise, this property will be + * ignored. + * + * @param p a map of custom values applied to the cell. + */ + public final native void setP(Properties p) /*-{ + this.p = p; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final native void setVBoolean(boolean v) /*-{ + this.v = v; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final void setVDate(Date v) { + setVObject(DateHelper.getJsDate(v)); + } + + /** + * Clears the cell value. The whole object should be empty and have neither v nor f properties. + */ + public final native void setVNull() /*-{ + delete this.v; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final native void setVNumber(double v) /*-{ + this.v = v; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final native void setVObject(JavaScriptObject v) /*-{ + this.v = v; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final native void setVString(String v) /*-{ + this.v = v; + }-*/; + + /** + * Sets the cell value. The data type should match the column data type. + * + * @param v the cell value + */ + public final native void setVTimeOfDay(TimeOfDay v) /*-{ + this.v = v; + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataColumn.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataColumn.java new file mode 100644 index 0000000..adbeb11 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataColumn.java @@ -0,0 +1,162 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +/** + * Represents a column object for adding to a DataTable. + */ +public class DataColumn extends JavaScriptObject { + + /** + * Default static constructor. + * + * @param type data type of the data in the column. + * + * @return a new object + */ + public static DataColumn create(ColumnType type) { + DataColumn dataColumn = createObject().cast(); + dataColumn.setType(type); + return dataColumn; + } + + /** + * Default static constructor. + * + * @param type data type of the data in the column. + * @param role a role for the column + * + * @return a new object + */ + public static DataColumn create(ColumnType type, RoleType role) { + DataColumn dataColumn = createObject().cast(); + dataColumn.setType(type); + dataColumn.setRole(role); + return dataColumn; + } + + /** + * Default static constructor. + * + * @param type data type of the data in the column. + * @param role a role for the column + * @param id an id for the column + * + * @return a new object + */ + public static DataColumn create(ColumnType type, RoleType role, String id) { + DataColumn dataColumn = createObject().cast(); + dataColumn.setType(type); + dataColumn.setRole(role); + dataColumn.setId(id); + return dataColumn; + } + + protected DataColumn() { + } + + /** + * Sets an id for the column. + * + * @param id an id for the column + */ + public final native void setId(String id) /*-{ + this.id = id; + }-*/; + + /** + * Sets a label for the column. + * + * @param label a label for the column + */ + public final native void setLabel(String label) /*-{ + this.label = label; + }-*/; + + /** + * An object that is a map of custom values applied to the cell. These values can be of any JavaScript type. If your + * visualization supports any cell-level properties, it will describe them; otherwise, this property will be + * ignored.
+ * Has no effect when added to a DataTable. + * + * @param p a map of custom values applied to the cell. + */ + public final void setP(Properties p) { + // A workaround for a unexplainable difference between a DataTable and a literal column + // setP uses the setRole value if already set + if (!p.containsKey("role")) { + String role = getRole(); + if (role != null) { + p.set("role", role); + } + } + setProperties(p); + } + + /** + * Sets a pattern specifying how to display the column value. + * + * @param pattern number (or date) format string specifying how to display the column value + */ + public final native void setPattern(String pattern) /*-{ + this.pattern = pattern; + }-*/; + + /** + * Sets a role for the column. + * + * @param role a role for the column + */ + public final void setRole(RoleType role) { + setRole(role.getName()); + // A workaround for a unexplainable difference between a DataTable and a literal column + // This way setRole works for either cases + Properties properties = getP(); + if (properties == null) { + properties = Properties.create(); + } + properties.set("role", role.getName()); + } + + /** + * Sets a type for the column. + * + * @param type a type for the column + */ + public final void setType(ColumnType type) { + setType(type.getName()); + } + + private final native Properties getP() /*-{ + return this.p; + }-*/; + + private final native String getRole() /*-{ + return this.role; + }-*/; + + private final native void setProperties(Properties p) /*-{ + this.p = p; + }-*/; + + private final native void setRole(String role) /*-{ + this.role = role; + }-*/; + + private final native void setType(String type) /*-{ + this.type = type; + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataLiteral.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataLiteral.java new file mode 100644 index 0000000..612dac1 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataLiteral.java @@ -0,0 +1,67 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; + +/** + * You can initialize a DataTable by passing a JavaScript string literal object into the data parameter. We'll call this + * object the data object. You can code this object by hand, according to the description below, or you can use a helper + * Python library if you know how to use Python, and your site can use it. However, if you want to construct the object + * by hand, this section will describe the syntax. + * + * @see Format of the + * Constructor"s JavaScript Literal + */ +public class DataLiteral extends JavaScriptObject { + /** + * Default static constructor. + * + * @return a new object + */ + public static DataLiteral create() { + return createObject().cast(); + } + + protected DataLiteral() { + } + + /** + * Sets an array of objects describing the ID and type of each column. + * + * @param cols an array of objects describing the ID and type of each column. + */ + public final native void setCols(JsArray cols) /*-{ + return this.cols = cols; + }-*/; + + /** + * The table-level p property is a map of custom values applied to the whole DataTable. If your visualization + * supports any datatable-level properties, it will describe them; otherwise, this property will be ignored. + * + * @param p a map of custom values applied to the whole DataTable. + */ + public final native void setP(Properties p) /*-{ + return this.p = p; + }-*/; + + /** + * Sets holds an array of row objects. + * + * @param rows an array of row objects. + */ + public final native void setRows(JsArray rows) /*-{ + return this.rows = rows; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataRow.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataRow.java new file mode 100644 index 0000000..258bb71 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataRow.java @@ -0,0 +1,60 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; + +/** + * Represents a row object for adding to a DataTable. + * Each row object has one required property called c, which is an array of cells in that row. It also has an optional p + * property that defines a map of arbitrary custom values to assign to the whole row. If your visualization supports any + * row-level properties it will describe them; otherwise, this property will be ignored. + * + * @see Cell Objects + */ +public class DataRow extends JavaScriptObject { + + /** + * Default static constructor. + * + * @return a new object + */ + public static DataRow create() { + return createObject().cast(); + } + + protected DataRow() { + } + + /** + * Sets an array of cells in this row. + * + * @param c an array of cells in this row. + */ + public final native void setC(JsArray c) /*-{ + this.c = c; + }-*/; + + /** + * An object that is a map of custom values applied to the cell. These values can be of any JavaScript type. If your + * visualization supports any cell-level properties, it will describe them; otherwise, this property will be + * ignored. + * + * @param p a map of custom values applied to the cell. + */ + public final native void setP(Properties p) /*-{ + this.p = p; + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataSource.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataSource.java new file mode 100644 index 0000000..672b3dd --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataSource.java @@ -0,0 +1,592 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayBoolean; +import com.google.gwt.core.client.JsArrayNumber; +import com.google.gwt.core.client.JsArrayString; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * This class implements the common methods of DataTable and DataView. + * + * @see DataTable API + * Reference + */ +public class DataSource extends JavaScriptObject { + + protected DataSource() { + } + + /** + * Returns the identifier of a given column specified by the column index in the underlying table. For data tables + * that are retrieved by queries, the column identifier is set by the data source, and can be used to refer to + * columns when using the query language. + * + * @param columnIndex the column position + * @return the identifier of the given column index + */ + public final native String getColumnId(int columnIndex) /*-{ + return this.getColumnId(columnIndex); + }-*/; + + /** + * Returns the label of a given column specified by the column index in the underlying table. The column label is + * typically displayed as part of the visualization. For example the column label can be displayed as a column + * header in a table, or as the legend label in a pie chart. For data tables that are retrieved by queries, the + * column label is set by the data source, or by the label clause of the query language. + * + * @param columnIndex the column position + * @return the label of the given column index + */ + public final native String getColumnLabel(int columnIndex) /*-{ + return this.getColumnLabel(columnIndex); + }-*/; + + /** + * Returns the formatting pattern used to format the values of the specified column. columnIndex should be a number + * greater than or equal to zero, and less than the number of columns as returned by the getNumberOfColumns() + * method. For data tables that are retrieved by queries, The column pattern is set by the data source, or by the + * format clause of the query language. An example of a pattern is '#,##0.00'. For more on patterns see the query + * language reference. + * + * @param columnIndex the column position + * @return the pattern of the given column index + */ + public final native String getColumnPattern(int columnIndex) /*-{ + return this.getColumnPattern(columnIndex); + }-*/; + + /** + * Returns a map of all properties for the specified column. Note that the properties object is returned by + * reference, so changing values in the retrieved object changes them in the DataTable. columnIndex is the numeric + * index of the column to retrieve properties for. + * + * @param columnIndex the column position + * @return the properties of the given column index + */ + public final native Properties getColumnProperties(int columnIndex) /*-{ + return this.getColumnProperties(columnIndex); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified column. The return + * type varies, depending on the property. columnIndex should be a number greater than or equal to zero, and less + * than the number of columns as returned by the getNumberOfColumns() method. name is the property name, as a + * string. + * + * @param columnIndex the column position + * @param propertyName a property name + * @return the property value of the given column and property name + */ + public final native boolean getColumnPropertyBoolean(int columnIndex, String propertyName) /*-{ + return this.getColumnProperty(columnIndex, propertyName); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified column. The return + * type varies, depending on the property. columnIndex should be a number greater than or equal to zero, and less + * than the number of columns as returned by the getNumberOfColumns() method. name is the property name, as a + * string. + * + * @param columnIndex the column position + * @param propertyName a property name + * @return the property value of the given column and property name + */ + public final native JsDate getColumnPropertyDate(int columnIndex, String propertyName) /*-{ + return this.getColumnProperty(columnIndex, propertyName); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified column. The return + * type varies, depending on the property. columnIndex should be a number greater than or equal to zero, and less + * than the number of columns as returned by the getNumberOfColumns() method. name is the property name, as a + * string. + * + * @param columnIndex the column position + * @param propertyName a property name + * @return the property value of the given column and property name + */ + public final native double getColumnPropertyNumber(int columnIndex, String propertyName) /*-{ + return this.getColumnProperty(columnIndex, propertyName); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified column. The return + * type varies, depending on the property. columnIndex should be a number greater than or equal to zero, and less + * than the number of columns as returned by the getNumberOfColumns() method. name is the property name, as a + * string. + * + * @param columnIndex the column position + * @param propertyName a property name + * @return the property value of the given column and property name + */ + public final native JavaScriptObject getColumnPropertyObject(int columnIndex, String propertyName) /*-{ + return this.getColumnProperty(columnIndex, propertyName); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified column. The return + * type varies, depending on the property. columnIndex should be a number greater than or equal to zero, and less + * than the number of columns as returned by the getNumberOfColumns() method. name is the property name, as a + * string. + * + * @param columnIndex the column position + * @param propertyName a property name + * @return the property value of the given column and property name + */ + public final native String getColumnPropertyString(int columnIndex, String propertyName) /*-{ + return this.getColumnProperty(columnIndex, propertyName); + }-*/; + + /** + * Returns the minimal and maximal values of values in a specified column. The returned object has properties min + * and max. If the range has no values, min and max will contain null. columnIndex should be a number greater than + * or equal to zero, and less than the number of columns as returned by the getNumberOfColumns() method. + * + * @param columnIndex the column position + * @return an object with minimal and maximal values of values in the specified column + */ + public final native ColumnRange getColumnRange(int columnIndex) /*-{ + return this.getColumnRange(columnIndex); + }-*/; + + /** + * Returns the role of the specified column. + * + * @param columnIndex the column position + * @return the role of the specified column + */ + public final RoleType getColumnRole(int columnIndex) { + return RoleType.findByName(getColumnRoleString(columnIndex)); + } + + /** + * Returns the type of a given column specified by the column index. columnIndex should be a number greater than or + * equal to zero, and less than the number of columns as returned by the getNumberOfColumns() method. + * + * @param columnIndex the column position + * @return the type of the specified column + */ + public final ColumnType getColumnType(int columnIndex) { + return ColumnType.findByName(getColumnTypeString(columnIndex)); + } + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArrayBoolean getDistinctValuesBoolean(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArray getDistinctValuesDate(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArrayNumber getDistinctValuesNumber(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArray getDistinctValuesObject(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArrayString getDistinctValuesString(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the unique values in a certain column, in ascending order. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @return the unique values in a certain column, in ascending order. + */ + public final native JsArray getDistinctValuesTimeOfDay(int columnIndex) /*-{ + return this.getDistinctValues(columnIndex); + }-*/; + + /** + * Returns the row indexes for rows that match all of the given filters. The indexes are returned in ascending + * order. The output of this method can be used as input to DataView.setRows() to change the displayed set of rows + * in a visualization. + * + * @param filters An array of objects that describe an acceptable cell value. + * @return the row indexes for rows that match all of the given filters. + */ + public final native JsArrayNumber getFilteredRows(JsArray filters) /*-{ + return this.getFilteredRows(filters); + }-*/; + + /** + * Returns the formatted value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return the formatted value + */ + public final native String getFormattedValue(int rowIndex, int columnIndex) /*-{ + return this.getFormattedValue(rowIndex, columnIndex); + }-*/; + + /** + * Returns the number of columns in the table. + * + * @return number of columns in the table + */ + public final native int getNumberOfColumns() /*-{ + return this.getNumberOfColumns(); + }-*/; + + /** + * Returns the number of rows in the table. + * + * @return number of rows in the table + */ + public final native int getNumberOfRows() /*-{ + return this.getNumberOfRows(); + }-*/; + + /** + * Returns a map of all the properties for the specified cell. Note that the properties object is returned by + * reference, so changing values in the retrieved object changes them in the DataSource. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @return a map of all the properties for the specified cell + */ + public final native Properties getProperties(int rowIndex, int columnIndex) /*-{ + return this.getProperties(rowIndex, columnIndex); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified cell. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native boolean getPropertyBoolean(int rowIndex, int columnIndex, String name) /*-{ + return this.getProperty(rowIndex, columnIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified cell. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final Date getPropertyDate(int rowIndex, int columnIndex, String name) { + JsDate jsDate = getPropertyObject(rowIndex, columnIndex, name).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the value of a named property, or null if no such property is set for the specified cell. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native double getPropertyNumber(int rowIndex, int columnIndex, String name) /*-{ + return this.getProperty(rowIndex, columnIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified cell. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native JavaScriptObject getPropertyObject(int rowIndex, int columnIndex, String name) /*-{ + return this.getProperty(rowIndex, columnIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified cell. + * + * @param rowIndex is the cell's row index. + * @param columnIndex is the cell's column index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native String getPropertyString(int rowIndex, int columnIndex, String name) /*-{ + return this.getProperty(rowIndex, columnIndex, name); + }-*/; + + /** + * Returns a map of all properties for the specified row. Note that the properties object is returned by reference, + * so changing values in the retrieved object changes them in the DataTable. + * + * @param rowIndex is the index of the row to retrieve properties for. + * @return a map of all properties for the specified row + */ + public final native Properties getRowProperties(int rowIndex) /*-{ + return this.getRowProperties(rowIndex); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified row. + * + * @param rowIndex is the cell's row index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native boolean getRowPropertyBoolean(int rowIndex, String name) /*-{ + return this.getRowProperty(rowIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified row. + * + * @param rowIndex is the cell's row index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final Date getRowPropertyDate(int rowIndex, String name) { + JsDate jsDate = getRowPropertyObject(rowIndex, name).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the value of a named property, or null if no such property is set for the specified row. + * + * @param rowIndex is the cell's row index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native double getRowPropertyNumber(int rowIndex, String name) /*-{ + return this.getRowProperty(rowIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified row. + * + * @param rowIndex is the cell's row index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native JavaScriptObject getRowPropertyObject(int rowIndex, String name) /*-{ + return this.getRowProperty(rowIndex, name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the specified row. + * + * @param rowIndex is the cell's row index. + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native String getRowPropertyString(int rowIndex, String name) /*-{ + return this.getRowProperty(rowIndex, name); + }-*/; + + /** + * Returns a map of all properties for the table. + * + * @return a map of all properties + */ + public final native Properties getTableProperties() /*-{ + return this.getTableProperties(); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the table. + * + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native boolean getTablePropertyBoolean(String name) /*-{ + return this.getTableProperty(name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the table. + * + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final Date getTablePropertyDate(String name) { + JsDate jsDate = getTablePropertyObject(name).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the value of a named property, or null if no such property is set for the table. + * + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native double getTablePropertyNumber(String name) /*-{ + return this.getTableProperty(name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the table. + * + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native JavaScriptObject getTablePropertyObject(String name) /*-{ + return this.getTableProperty(name); + }-*/; + + /** + * Returns the value of a named property, or null if no such property is set for the table. + * + * @param name is a string with the property name. + * @return the value of a named property or null + */ + public final native String getTablePropertyString(String name) /*-{ + return this.getTableProperty(name); + }-*/; + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final native boolean getValueBoolean(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex); + }-*/; + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final Date getValueDate(int rowIndex, int columnIndex) { + JsDate jsDate = getValueObject(rowIndex, columnIndex).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final native double getValueNumber(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex); + }-*/; + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final native JavaScriptObject getValueObject(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex); + }-*/; + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final native String getValueString(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex); + }-*/; + + /** + * Returns the value of the cell at the given row and column indexes. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return value of the specified cell + */ + public final native TimeOfDay getValueTimeOfDay(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex); + }-*/; + + /** + * Checks if the value of the cell at the given row and column indexes is null. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @return true if null, false otherwise + */ + public final native boolean isValueNull(int rowIndex, int columnIndex) /*-{ + return this.getValue(rowIndex, columnIndex) == null; + }-*/; + + /** + * Returns a JSON representation of the DataTable that can be passed into the DataTable constructor. + * + * @return a JSON representation of the DataTable + */ + public final native String toJSON() /*-{ + return this.toJSON(); + }-*/; + + private final native String getColumnRoleString(int columnIndex) /*-{ + return this.getColumnRole(columnIndex); + }-*/; + + private final native String getColumnTypeString(int columnIndex) /*-{ + return this.getColumnType(columnIndex); + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataTable.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataTable.java new file mode 100644 index 0000000..b922faf --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataTable.java @@ -0,0 +1,1099 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayInteger; +import com.google.gwt.core.client.JsArrayMixed; + +import com.googlecode.gwt.charts.client.util.ArrayHelper; +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * Represents a two-dimensional, mutable table of values. To make a read-only copy of a DataTable (optionally filtered + * to show specific values, rows, or columns), create a DataView. Each column is assigned a data type, plus several + * optional properties including an ID, label, and pattern string. In addition, you can assign custom properties + * (name/value pairs) to any cell, row, column, or the entire table. Some visualizations support specific custom + * properties; for example the Table visualization supports a cell property called 'style', which lets you assign an + * inline CSS style string to the rendered table cell. A visualization should describe in its documentation any custom + * properties that it supports. + * + * @see DataTable API + * Reference + */ +public class DataTable extends DataSource { + + /** + * Creates a DataTable object used to hold the data passed into a visualization. + * + * @return an object used to hold the data passed into a visualization. + */ + public static native DataTable create() /*-{ + return new $wnd.google.visualization.DataTable(); + }-*/; + + /** + * Creates a DataTable object used to hold the data passed into a visualization. + * + * @param dataLiteral a JavaScript object containing data used to initialize the table. + * @return an object used to hold the data passed into a visualization. + */ + public static native DataTable create(DataLiteral dataLiteral) /*-{ + return new $wnd.google.visualization.DataTable(dataLiteral); + }-*/; + + /** + * Creates a DataTable object used to hold the data passed into a visualization. + * + * @param dataLiteral a JavaScript object containing data used to initialize the table. + * @param version A numeric value specifying the version of the wire protocol used. This is only used by Chart Tools + * Datasource implementors. The current version is 0.6. + * @return an object used to hold the data passed into a visualization. + */ + public static native DataTable create(DataLiteral dataLiteral, double version) /*-{ + return new $wnd.google.visualization.DataTable(dataLiteral, version); + }-*/; + + /** + * Creates a DataTable object used to hold the data passed into a visualization. + * + * @param jsonString Data used to initialize the table. This can be the JSON returned by calling DataTable.toJSON() + * on a populated table + * @return an object used to hold the data passed into a visualization. + */ + public static native DataTable create(String jsonString) /*-{ + return new $wnd.google.visualization.DataTable(jsonString); + }-*/; + + /** + * Creates a DataTable object used to hold the data passed into a visualization. + * + * @param jsonString Data used to initialize the table. This can be the JSON returned by calling DataTable.toJSON() + * on a populated table + * @param version A numeric value specifying the version of the wire protocol used. This is only used by Chart Tools + * Datasource implementors. The current version is 0.6. + * @return an object used to hold the data passed into a visualization. + */ + public static native DataTable create(String jsonString, double version) /*-{ + return new $wnd.google.visualization.DataTable(jsonString, version); + }-*/; + + protected DataTable() { + } + + /** + * Adds a new column to the data table. All the cells of the new column are assigned a null value + * + * @param type the data type of the values of the column + * @return the index of the new column + */ + public final int addColumn(ColumnType type) { + return addColumn(type.getName()); + } + + /** + * Adds a new column to the data table. All the cells of the new column are assigned a null value + * + * @param type the data type of the values of the column + * @param label + * @return the index of the new column + */ + public final int addColumn(ColumnType type, String label) { + return this.addColumn(type.getName(), label); + } + + /** + * Adds a new column to the data table. All the cells of the new column are assigned a null value + * + * @param type the data type of the values of the column + * @param label A string with the label of the column. The column label is typically displayed as part of the + * visualization, for example as a column header in a table, or as a legend label in a pie chart. If not + * value is specified, an empty string is assigned. + * @param id A string with a unique identifier for the column. If not value is specified, an empty string is + * assigned. + * @return the index of the new column + */ + public final int addColumn(ColumnType type, String label, String id) { + return addColumn(type.getName(), label, id); + } + + /** + * @param dataColumn + * @return the index of the new column + */ + public final native int addColumn(DataColumn dataColumn) /*-{ + return this.addColumn(dataColumn); + }-*/; + + /** + * Adds a new, empty row to the end of the table. + * + * @return the index of the new row + */ + public final native int addRow() /*-{ + return this.addRow(); + }-*/; + + /** + * Adds a new row to the data table. + * + * @param an array of column values + * @param cellArray A row object, specifying the data for the new row. This parameter is an array of cell values: if + * you only want to specify a value for a cell, just give the cell value (e.g., 55, 'hello'); + * @return the index of the new row + * @see DataCell + */ + public final native int addRow(E cellArray) /*-{ + return this.addRow(cellArray); + }-*/; + + /** + * Adds a new row to the data table. + * + * @param cellArray A row object, specifying the data for the new row. This parameter is an array of cell values: if + * you only want to specify a value for a cell, just give the cell value (e.g., 55, 'hello'); + * @return the index of the new row + * @see DataCell + */ + public final int addRow(Object... cellArray) { + return this.addRow(ArrayHelper.createArray(cellArray)); + } + + /** + * Adds emptys row to the end of the table. + * + * @param number the number of rows to add + * @return the index of the last added row + */ + public final native int addRows(int number) /*-{ + return this.addRows(number); + }-*/; + + /** + * Adds new rows to the data table. + * + * @param an array of column values + * @param rowArray An array of row objects used to populate a set of new rows. + * @return the index of the last added row + * @see DataCell + */ + public final native int addRows(JsArray rowArray) /*-{ + return this.addRows(rowArray); + }-*/; + + /** + * Returns a clone of the data table. The result is a deep copy of the data table except for the cell properties, + * row properties, table properties and column properties, which are shallow copies; this means that non-primitive + * properties are copied by reference, but primitive properties are copied by value. + * + * @return a clone of this object + */ + public final native DataTable cloneObject() /*-{ + return this.clone(); + }-*/; + + /** + * Returns a sorted version of the table without modifying the order of the underlying data. To permanently sort the + * underlying data, call sort(). + * + * @param columnIndex specifies the index of the column to sort by. Sorting will be in ascending order + * @return The returned value is an array of numbers, each number is an index of a DataTable row. Iterating on the + * DataTable rows by the order of the returned array will result in rows ordered by the specified + * sortColumns. The output can be used as input to DataView.setRows() to quickly change the displayed set of + * rows in a visualization. + */ + public final native JsArrayInteger getSortedRows(int columnIndex) /*-{ + return this.getSortedRows(columnIndex); + }-*/; + + /** + * Returns a sorted version of the table without modifying the order of the underlying data. To permanently sort the + * underlying data, call sort(). + * + * @param sortColumns An array of objects, each one with the number of the column index to sort by, and an optional + * boolean property desc. + * @return The returned value is an array of numbers, each number is an index of a DataTable row. Iterating on the + * DataTable rows by the order of the returned array will result in rows ordered by the specified + * sortColumns. The output can be used as input to DataView.setRows() to quickly change the displayed set of + * rows in a visualization. + */ + public final native JsArrayInteger getSortedRows(JsArray sortColumns) /*-{ + return this.getSortedRows(sortColumns); + }-*/; + + /** + * Returns a sorted version of the table without modifying the order of the underlying data. To permanently sort the + * underlying data, call sort(). + * + * @param columnIndexes An array of numbers of the column indexes by which to sort. The first number is the primary + * column by which to sort, the second one is the secondary, and so on. This means that when two values in + * the first column are equal, the values in the next column are compared, and so on. + * @return The returned value is an array of numbers, each number is an index of a DataTable row. Iterating on the + * DataTable rows by the order of the returned array will result in rows ordered by the specified + * sortColumns. The output can be used as input to DataView.setRows() to quickly change the displayed set of + * rows in a visualization. + */ + public final native JsArrayInteger getSortedRows(JsArrayInteger columnIndexes) /*-{ + return this.getSortedRows(columnIndexes); + }-*/; + + /** + * Returns a sorted version of the table without modifying the order of the underlying data. To permanently sort the + * underlying data, call sort(). + * + * @param sortColumn A single object that contains the number of the column index to sort by, and an optional + * boolean property desc. + * @return The returned value is an array of numbers, each number is an index of a DataTable row. Iterating on the + * DataTable rows by the order of the returned array will result in rows ordered by the specified + * sortColumns. The output can be used as input to DataView.setRows() to quickly change the displayed set of + * rows in a visualization. + */ + public final native JsArrayInteger getSortedRows(SortColumn sortColumn) /*-{ + return this.getSortedRows(sortColumn); + }-*/; + + /** + * Inserts a new column to the data table, at the specifid index. All existing columns at or after the specified + * index are shifted to a higher index. + * + * @param columnIndex a number with the required index of the new column. + * @param type the data type of the values of the column + */ + public final void insertColumn(int columnIndex, ColumnType type) { + insertColumn(columnIndex, type.getName()); + } + + /** + * Inserts a new column to the data table, at the specifid index. All existing columns at or after the specified + * index are shifted to a higher index. + * + * @param columnIndex a number with the required index of the new column. + * @param type the data type of the values of the column + * @param label should be a string with the label of the column. The column label is typically displayed as part of + * the visualization, for example as a column header in a table, or as a legend label in a pie chart. If no + * value is specified, an empty string is assigned. + */ + public final void insertColumn(int columnIndex, ColumnType type, String label) { + insertColumn(columnIndex, type.getName(), label); + } + + /** + * Inserts a new column to the data table, at the specifid index. All existing columns at or after the specified + * index are shifted to a higher index. + * + * @param columnIndex a number with the required index of the new column. + * @param type the data type of the values of the column + * @param label should be a string with the label of the column. The column label is typically displayed as part of + * the visualization, for example as a column header in a table, or as a legend label in a pie chart. If no + * value is specified, an empty string is assigned. + * @param id should be a string with a unique identifier for the column. If no value is specified, an empty string + * is assigned. + */ + public final void insertColumn(int columnIndex, ColumnType type, String label, String id) { + this.insertColumn(columnIndex, type.getName(), label, id); + } + + /** + * Insert the specified number of empty rows at the specified row index. + * + * @param rowIndex is the index number where to insert the new row(s). Rows will be added, starting at the index + * number specified. + * @param rowCount number of empty rows to add + */ + public final native void insertRows(int rowIndex, int rowCount) /*-{ + this.insertRows(rowIndex, rowCount); + }-*/; + + /** + * Insert the specified number of empty rows at the specified row index. + * + * @param + * + * @param rowIndex is the index number where to insert the new row(s). Rows will be added, starting at the index + * number specified. + * @param rowArray an array of row objects used to populate a set of new rows. + * @see #addRows(JsArray) + */ + public final native void insertRows(int rowIndex, JsArray rowArray) /*-{ + this.insertRows(rowIndex, rowArray); + }-*/; + + /** + * Removes the column at the specified index. + * + * @param columnIndex should be a number with a valid column index. + */ + public final native void removeColumn(int columnIndex) /*-{ + this.removeColumn(columnIndex); + }-*/; + + /** + * Removes the specified number of columns starting from the column at the specified index. + * + * @param columnIndex should be a number with a valid column index. + * @param numberOfColumns is the number of columns to remove. + */ + public final native void removeColumns(int columnIndex, int numberOfColumns) /*-{ + this.removeColumns(columnIndex, numberOfColumns); + }-*/; + + /** + * Removes the row at the specified index. + * + * @param rowIndex should be a number with a valid row index. + */ + public final native void removeRow(int rowIndex) /*-{ + this.removeRow(rowIndex); + }-*/; + + /** + * Removes the specified number of rows starting from the row at the specified index. + * + * @param rowIndex should be a number with a valid row index. + * @param numberOfRows is the number of rows to remove. + */ + public final native void removeRows(int rowIndex, int numberOfRows) /*-{ + this.removeRows(rowIndex, numberOfRows); + }-*/; + + /** + * Sets the value, formatted value, and/or properties, of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + */ + public final native void setCell(int rowIndex, int columnIndex) /*-{ + this.setCell(rowIndex, columnIndex); + }-*/; + + /** + * Sets the value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + */ + public final native void setCell(int rowIndex, int columnIndex, boolean value) /*-{ + this.setCell(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value and formatted value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue + */ + public final native void setCell(int rowIndex, int columnIndex, boolean value, String formattedValue) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue); + }-*/; + + /** + * Sets the value, formatted value and properties of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + * @param properties is an Object (a name/value map) with additional properties for this cell + */ + public final native void setCell(int rowIndex, int columnIndex, boolean value, String formattedValue, + Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue, properties); + }-*/; + + /** + * Sets the value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + */ + public final void setCell(int rowIndex, int columnIndex, Date value) { + this.setCell(rowIndex, columnIndex, DateHelper.getJsDate(value)); + } + + /** + * Sets the value and formatted value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue + */ + public final void setCell(int rowIndex, int columnIndex, Date value, String formattedValue) { + this.setCell(rowIndex, columnIndex, DateHelper.getJsDate(value), formattedValue); + } + + /** + * Sets the value, formatted value and properties of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + * @param properties is an Object (a name/value map) with additional properties for this cell + */ + public final void setCell(int rowIndex, int columnIndex, Date value, String formattedValue, Properties properties) { + this.setCell(rowIndex, columnIndex, DateHelper.getJsDate(value), formattedValue, properties); + } + + /** + * Sets the value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + */ + public final native void setCell(int rowIndex, int columnIndex, double value) /*-{ + this.setCell(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value and formatted value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + */ + public final native void setCell(int rowIndex, int columnIndex, double value, String formattedValue) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue); + }-*/; + + /** + * Sets the value, formatted value and properties of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + * @param properties is an Object (a name/value map) with additional properties for this cell + */ + public final native void setCell(int rowIndex, int columnIndex, double value, String formattedValue, + Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue, properties); + }-*/; + + /** + * Sets the value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + */ + public final native void setCell(int rowIndex, int columnIndex, String value) /*-{ + this.setCell(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value and formatted value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + */ + public final native void setCell(int rowIndex, int columnIndex, String value, String formattedValue) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue); + }-*/; + + /** + * Sets the value, formatted value and properties of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + * @param properties is an Object (a name/value map) with additional properties for this cell + */ + public final native void setCell(int rowIndex, int columnIndex, String value, String formattedValue, + Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue, properties); + }-*/; + + /** + * Sets the value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + */ + public final native void setCell(int rowIndex, int columnIndex, TimeOfDay value) /*-{ + this.setCell(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value and formatted value of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + */ + public final native void setCell(int rowIndex, int columnIndex, TimeOfDay value, String formattedValue) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue); + }-*/; + + /** + * Sets the value, formatted value and properties of a cell. + * + * @param rowIndex should be a number with a valid row index. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param value the value assigned to the specified cell + * @param formattedValue is a string with the value formatted as a string + * @param properties is an Object (a name/value map) with additional properties for this cell + */ + public final native void setCell(int rowIndex, int columnIndex, TimeOfDay value, String formattedValue, + Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue, properties); + }-*/; + + /** + * Set the value of a cell to null. + * + * @param rowIndex The index of the row. + * @param columnIndex The index of the column. + * @param formattedValue The desired String representation of null, such as "", "null", "nil", "N/A", "none", etc. + * @param properties + */ + public final native void setCellNull(int rowIndex, int columnIndex, String formattedValue, Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, null, formattedValue, properties); + }-*/; + + /** + * Sets the label of a column. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @param label is a string with the label to assign to the column. The column label is typically displayed as part + * of the visualization. For example the column label can be displayed as a column header in a table, or as + * the legend label in a pie chart. + * @see #getColumnLabel(int) + */ + public final native void setColumnLabel(int columnIndex, String label) /*-{ + this.setColumnLabel(columnIndex, label); + }-*/; + + /** + * Sets multiple cell properties. Some visualizations support row, column, or cell properties to modify their + * display or behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param properties is an Object (name/value map) with additional properties for this cell. If null is specified, + * all additional properties of the cell will be removed. + */ + public final native void setColumnProperties(int columnIndex, Properties properties) /*-{ + this.setColumnProperties(columnIndex, properties); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setColumnProperty(int columnIndex, String name, boolean value) /*-{ + this.setColumnProperty(columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final void setColumnProperty(int columnIndex, String name, Date value) { + this.setColumnProperty(columnIndex, name, DateHelper.getJsDate(value)); + } + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setColumnProperty(int columnIndex, String name, double value) /*-{ + this.setColumnProperty(columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setColumnProperty(int columnIndex, String name, JavaScriptObject value) /*-{ + this.setColumnProperty(columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setColumnProperty(int columnIndex, String name, String value) /*-{ + this.setColumnProperty(columnIndex, name, value); + }-*/; + + /** + * Sets the formatted value of a cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. + * @param formattedValue is a string with the value formatted for display. To clear this value and have the API + * apply default formatting to the cell value as needed, set it formattedValue null; to explicitly set an + * empty formatted value, set it to an empty string. + * @see #getFormattedValue(int, int) + */ + public final native void setFormattedValue(int rowIndex, int columnIndex, String formattedValue) /*-{ + this.setFormattedValue(rowIndex, columnIndex, formattedValue); + }-*/; + + /** + * Sets multiple cell properties. Some visualizations support row, column, or cell properties to modify their + * display or behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param properties is an Object (name/value map) with additional properties for this cell. If null is specified, + * all additional properties of the cell will be removed. + */ + public final native void setProperties(int rowIndex, int columnIndex, Properties properties) /*-{ + this.setProperties(rowIndex, columnIndex, properties); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setProperty(int rowIndex, int columnIndex, String name, boolean value) /*-{ + this.setProperty(rowIndex, columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final void setProperty(int rowIndex, int columnIndex, String name, Date value) { + this.setProperty(rowIndex, columnIndex, name, DateHelper.getJsDate(value)); + } + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setProperty(int rowIndex, int columnIndex, String name, double value) /*-{ + this.setProperty(rowIndex, columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setProperty(int rowIndex, int columnIndex, String name, JavaScriptObject value) /*-{ + this.setProperty(rowIndex, columnIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setProperty(int rowIndex, int columnIndex, String name, String value) /*-{ + this.setProperty(rowIndex, columnIndex, name, value); + }-*/; + + /** + * Sets multiple cell properties. Some visualizations support row, column, or cell properties to modify their + * display or behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param properties is an Object (name/value map) with additional properties for this cell. If null is specified, + * all additional properties of the cell will be removed. + */ + public final native void setRowProperties(int rowIndex, Properties properties) /*-{ + this.setRowProperties(rowIndex, properties); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setRowProperty(int rowIndex, String name, boolean value) /*-{ + this.setRowProperty(rowIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final void setRowProperty(int rowIndex, String name, Date value) { + this.setRowProperty(rowIndex, name, DateHelper.getJsDate(value)); + } + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setRowProperty(int rowIndex, String name, double value) /*-{ + this.setRowProperty(rowIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setRowProperty(int rowIndex, String name, JavaScriptObject value) /*-{ + this.setRowProperty(rowIndex, name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified cell + */ + public final native void setRowProperty(int rowIndex, String name, String value) /*-{ + this.setRowProperty(rowIndex, name, value); + }-*/; + + /** + * Sets multiple table properties. Some visualizations support table, row, column, or cell properties to modify + * their display or behavior; see the visualization documentation to see what properties are supported. + * + * @param properties is an Object (name/value map) with additional properties for this table. If null is specified, + * all additional properties of the table will be removed. + */ + public final native void setTableProperties(Properties properties) /*-{ + this.setTableProperties(properties); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified table + */ + public final native void setTableProperty(String name, boolean value) /*-{ + this.setTableProperty(name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified table + */ + public final void setTableProperty(String name, Date value) { + this.setTableProperty(name, DateHelper.getJsDate(value)); + } + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified table + */ + public final native void setTableProperty(String name, double value) /*-{ + this.setTableProperty(name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified table + */ + public final native void setTableProperty(String name, JavaScriptObject value) /*-{ + this.setTableProperty(name, value); + }-*/; + + /** + * Sets a cell property. Some visualizations support row, column, or cell properties to modify their display or + * behavior; see the visualization documentation to see what properties are supported. + * + * @param name is a string with the property name + * @param value is a value to assign to the specified named property of the specified table + */ + public final native void setTableProperty(String name, String value) /*-{ + this.setTableProperty(name, value); + }-*/; + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @param value is the value assigned to the specified cell. The type of the returned value depends on the column + * type + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, boolean) + * @see #setProperties(int, int, Properties) + */ + public final native void setValue(int rowIndex, int columnIndex, boolean value) /*-{ + this.setValue(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @param value is the value assigned to the specified cell. The type of the returned value depends on the column + * type + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, String) + * @see #setProperties(int, int, Properties) + */ + public final void setValue(int rowIndex, int columnIndex, Date value) { + this.setValue(rowIndex, columnIndex, DateHelper.getJsDate(value)); + } + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @param value is the value assigned to the specified cell. The type of the returned value depends on the column + * type + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, String) + * @see #setProperties(int, int, Properties) + */ + public final native void setValue(int rowIndex, int columnIndex, double value) /*-{ + this.setValue(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @param value is the value assigned to the specified cell. The type of the returned value depends on the column + * type + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, String) + * @see #setProperties(int, int, Properties) + */ + public final native void setValue(int rowIndex, int columnIndex, String value) /*-{ + this.setValue(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @param value is the value assigned to the specified cell. The type of the returned value depends on the column + * type + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, String) + * @see #setProperties(int, int, Properties) + */ + public final native void setValue(int rowIndex, int columnIndex, TimeOfDay value) /*-{ + this.setValue(rowIndex, columnIndex, value); + }-*/; + + /** + * Sets the value of a cell. In addition to overwriting any existing cell value, this method will also clear out any + * formatted value and properties for the cell. + * + * @param rowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * @param columnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned by the getNumberOfColumns() method. This method does not let you set a formatted value for this + * cell; to do that, call setFormattedValue(). + * @see #setCell(int, int) + * @see #setFormattedValue(int, int, String) + * @see #setProperty(int, int, String, String) + * @see #setProperties(int, int, Properties) + */ + public final native void setValueNull(int rowIndex, int columnIndex) /*-{ + this.setValue(rowIndex, columnIndex, null); + }-*/; + + /** + * Sorts the rows, according to the specified sort columns. The DataTable is modified by this method. + * + * @param columnIndex specifies the index of the column to sort by. Sorting will be in ascending order + * @see #getSortedRows(int) + */ + public final native void sort(int columnIndex) /*-{ + this.sort(columnIndex); + }-*/; + + /** + * Sorts the rows, according to the specified sort columns. The DataTable is modified by this method. + * + * @param sortColumns An array of objects, each one with the number of the column index to sort by, and an optional + * boolean property desc. + * @see #getSortedRows(SortColumn) + */ + public final native void sort(JsArray sortColumns) /*-{ + this.sort(sortColumns); + }-*/; + + /** + * Sorts the rows, according to the specified sort columns. The DataTable is modified by this method. + * + * @param columnIndexes An array of numbers of the column indexes by which to sort. The first number is the primary + * column by which to sort, the second one is the secondary, and so on. This means that when two values in + * the first column are equal, the values in the next column are compared, and so on. + * @see #getSortedRows(JsArrayInteger) + */ + public final native void sort(JsArrayInteger columnIndexes) /*-{ + this.sort(columnIndexes); + }-*/; + + /** + * Sorts the rows, according to the specified sort columns. The DataTable is modified by this method. + * + * @param sortColumn A single object that contains the number of the column index to sort by, and an optional + * boolean property desc. + * @see #getSortedRows(JsArray) + */ + public final native void sort(SortColumn sortColumn) /*-{ + this.sort(sortColumn); + }-*/; + + private final native int addColumn(String type) /*-{ + return this.addColumn(type); + }-*/; + + private final native int addColumn(String type, String label) /*-{ + return this.addColumn(type, label); + }-*/; + + private final native int addColumn(String type, String label, String id) /*-{ + return this.addColumn(type, label, id); + }-*/; + + private final native void insertColumn(int columnIndex, String type) /*-{ + this.insertColumn(columnIndex, type); + }-*/; + + private final native void insertColumn(int columnIndex, String type, String label) /*-{ + this.insertColumn(columnIndex, type, label); + }-*/; + + private final native void insertColumn(int columnIndex, String type, String label, String id) /*-{ + this.insertColumn(columnIndex, type, label, id); + }-*/; + + private final native void setCell(int rowIndex, int columnIndex, JavaScriptObject value) /*-{ + this.setCell(rowIndex, columnIndex, value); + }-*/; + + private final native void setCell(int rowIndex, int columnIndex, JavaScriptObject value, String formattedValue) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue); + }-*/; + + private final native void setCell(int rowIndex, int columnIndex, JavaScriptObject value, String formattedValue, + Properties properties) /*-{ + this.setCell(rowIndex, columnIndex, value, formattedValue, properties); + }-*/; + + private final native void setValue(int rowIndex, int columnIndex, JavaScriptObject value) /*-{ + this.setValue(rowIndex, columnIndex, value); + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataView.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataView.java new file mode 100644 index 0000000..4132554 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataView.java @@ -0,0 +1,259 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JsArray; +import com.google.gwt.core.client.JsArrayInteger; +import com.google.gwt.core.client.JsArrayMixed; + +/** + * A read-only view of an underlying DataTable. A DataView allows selection of only a subset of the columns and/or rows. + * It also allows reordering columns/rows, and duplicating columns/rows.
+ * + * A view is a live window on the underlying DataTable, not a static snapshot of data. However, you still should must be + * careful when changing the structure of the table itself, as described here:
+ * + *
    + *
  • Adding or removing columns from the underlying table will not be reflected by the view, and might cause + * unexpected behavior in the view; you will have to create a new DataView from the DataTable to pick up these changes.
  • + *
  • Adding or removing rows from the underlying table is safe and changes will be propagated to the view immediately + * (but you must call draw() on any visualizations after this change to have the new row set rendered). Note that if + * your view has filtered out rows by calling one of the setRows() or hideRows() methods, and you add or remove rows + * from the underlying table, the behavior is unexpected; you must create a new DataView to reflect the new table.
  • + *
  • Changing cell values in existing cells is safe, and changes are immediately propagated to the DataView (but you + * must call draw() on any visualizations after this change to have the new cell values rendered).
  • + *
+ * + * It is also possible to create a DataView from another DataView. Note that whenever an underlying table or view is + * mentioned, it refers to the level immediately below this level. In other words, it refers to the data object used to + * construct this DataView.
+ * + * DataView also supports calculated columns; these are columns whose value is calculated on the fly using a function + * that you supply. So, for example, you can include a column that is a sum of two preceding columns, or a column that + * calculates and shows the calendar quarter of a date from another column. See setColumns() for more details.
+ * + * When you modify a DataView by hiding or showing rows or columns, the visualization will not be affected until you + * call draw() on the visualization again.
+ * + * @see DataView API Reference + */ +public class DataView extends DataSource { + + /** + * Creates a new DataView for the given DataSource. + * + * @param dataSource A DataTable or DataView used to initialize the view. By default, the view contains all the + * columns and rows in the underlying data table or view, in the original order. + * @return a new DataView + */ + public static native DataView create(DataSource dataSource) /*-{ + return new $wnd.google.visualization.DataView(dataSource); + }-*/; + + /** + * This constructor creates a new DataView by assigning a serialized DataView to a DataTable. It helps you recreate + * the DataView that you serialized using DataView.toJSON() + * + * @param dataSource The DataTable object that you used to create the DataView, on which you called + * DataView.toJSON(). If this table is any different from the original table, you will get unpredictable + * results. + * @param json The JSON string returned by DataView.toJSON(). This is a description of which rows to show or hide + * from the data DataTable. + * @return a new DataView + */ + public static native DataView createFromJson(DataSource dataSource, String json) /*-{ + return $wnd.google.visualization.DataView.fromJSON(dataSource, json); + }-*/; + + protected DataView() { + } + + /** + * Returns the index in the underlying table (or view) of a given column specified by its index in this view. + * + * @param viewColumnIndex should be a number greater than or equal to zero, and less than the number of columns as + * returned + * @return the index in the underlying table (or view). Returns -1 if this is a generated column. + */ + public final native int getTableColumnIndex(int viewColumnIndex) /*-{ + return this.getTableColumnIndex(viewColumnIndex); + }-*/; + + /** + * Returns the index in the underlying table (or view) of a given row specified by its index in this view. + * viewRowIndex should be a number greater than or equal to zero, and less than the number of rows as returned by + * the getNumberOfRows() method. + * + * @param viewRowIndex + * @return the index of a given row specified by its index in this view + */ + public final native int getTableRowIndex(int viewRowIndex) /*-{ + return this.getTableRowIndex(viewRowIndex); + }-*/; + + /** + * Returns the index in this view that maps to a given column specified by its index in the underlying table (or + * view). If more than one such index exists, returns the first (smallest) one. If no such index exists (the + * specified column is not in the view), returns -1. tableColumnIndex should be a number greater than or equal to + * zero, and less than the number of columns as returned by the getNumberOfColumns() method of the underlying + * table/view. + * + * @param tableColumnIndex + * @return the index in this view that maps to a given column + */ + public final native int getViewColumnIndex(int tableColumnIndex) /*-{ + return this.getViewColumnIndex(tableColumnIndex); + }-*/; + + /** + * Returns the columns in this view, in order. That is, if you call setColumns with some array, and then call + * getViewColumns() you should get an identical array. + * + * @return the columns in this view, in order + */ + public final native JsArrayInteger getViewColumns() /*-{ + return this.getViewColumns(); + }-*/; + + /** + * Returns the index in this view that maps to a given row specified by its index in the underlying table (or view). + * If more than one such index exists, returns the first (smallest) one. If no such index exists (the specified row + * is not in the view), returns -1. tableRowIndex should be a number greater than or equal to zero, and less than + * the number of rows as returned by the getNumberOfRows() method of the underlying table/view. + * + * @param tableRowIndex + * @return the index in this view that maps to a given row + */ + public final native int getViewRowIndex(int tableRowIndex) /*-{ + return this.getViewRowIndex(tableRowIndex); + }-*/; + + /** + * Returns the rows in this view, in order. That is, if you call setRows with some array, and then call + * getViewRows() you should get an identical array. + * + * @return the rows in this view, in order + */ + public final native JsArrayInteger getViewRows() /*-{ + return this.getViewRows(); + }-*/; + + /** + * Hides the specified columns from the current view. columnIndexes is an array of numbers representing the indexes + * of the columns to hide. These indexes are the index numbers in the underlying table/view. The numbers in + * columnIndexes do not have to be in order (that is, [3,4,1] is fine). The remaining columns retain their index + * order when you iterate through them. Entering an index number for a column already hidden is not an error, but + * entering an index that does not exist in the underlying table/view will throw an error. To unhide columns, call + * setColumns(). + * + * @param columnIndexes + */ + public final native void hideColumns(JsArrayInteger columnIndexes) /*-{ + this.hideColumns(columnIndexes); + }-*/; + + /** + * Hides all rows with indexes that lie between min and max (inclusive) from the current view. This is a convenience + * syntax for hideRows(rowIndexes) above. + * + * @param fromIndex + * @param toIndex + */ + public final native void hideRows(int fromIndex, int toIndex) /*-{ + this.hideRows(fromIndex, toIndex); + }-*/; + + /** + * Hides the specified rows from the current view. rowIndexes is an array of numbers representing the indexes of the + * rows to hide. These indexes are the index numbers in the underlying table/view. The numbers in rowIndexes do not + * have to be in order (that is, [3,4,1] is fine). The remaining rows retain their index order. Entering an index + * number for a row already hidden is not an error, but entering an index that does not exist in the underlying + * table/view will throw an error. To unhide rows, call setRows(). + * + * @param rowIndexes + */ + public final native void hideRows(JsArrayInteger rowIndexes) /*-{ + this.hideRows(rowIndexes); + }-*/; + + /** + * Specifies which columns are visible in this view. Any columns not specified will be hidden. This is an array of + * calculated columns in the underlying table/view. If you don't call this method, the default is + * to show all columns. The array can also contain duplicates, to show the same column multiple times. Columns will + * be shown in the order specified. + * + * @param columnIndexes an array of calculated columns + */ + public final native void setColumns(JsArray columnIndexes) /*-{ + this.setColumns(columnIndexes); + }-*/; + + /** + * Specifies which columns are visible in this view. Any columns not specified will be hidden. This is an array of + * column indexes in the underlying table/view. If you don't call this method, the default is + * to show all columns. The array can also contain duplicates, to show the same column multiple times. Columns will + * be shown in the order specified. + * + * @param columnIndexes an array of column indexes in the underlying table/view + */ + public final native void setColumns(JsArrayInteger columnIndexes) /*-{ + this.setColumns(columnIndexes); + }-*/; + + /** + * Specifies which columns are visible in this view. Any columns not specified will be hidden. This is an array of + * column indexes in the underlying table/view, or calculated columns. If you don't call this method, the default is + * to show all columns. The array can also contain duplicates, to show the same column multiple times. Columns will + * be shown in the order specified. + * + * @param columnIndexes an array of column indexes in the underlying table/view, or calculated columns like {@link DataViewColumn} + */ + public final native void setColumns(JsArrayMixed columnIndexes) /*-{ + this.setColumns(columnIndexes); + }-*/; + + /** + * Sets the rows in this view to be all indexes (in the underlying table/view) that lie between min and max + * (inclusive). This is a convenience syntax for setRows(rowIndexes) above + * + * @param fromIndex + * @param toIndex + */ + public final native void setRows(int fromIndex, int toIndex) /*-{ + this.setRows(fromIndex, toIndex); + }-*/; + + /** + * Sets the visible rows in this view, based on index numbers from the underlying table/view. rowIndexes should be + * an array of index numbers specifying which rows to show in the view. The array specifies the order in which to + * show the rows, and rows can be duplicated. Note that only the rows specified in rowIndexes will be shown; this + * method clears all other rows from the view. The array can also contain duplicates, effectively duplicating the + * specified row in this view (for example, setRows([3, 4, 3, 2]) will cause row 3 to appear twice in this view). + * The array thus provides a mapping of the rows from the underlying table/view to this view. You can use + * getFilteredRows() or getSortedRows() to generate input for this method. + * + * @param rowIndexes + */ + public final native void setRows(JsArrayInteger rowIndexes) /*-{ + this.setRows(rowIndexes); + }-*/; + + /** + * Returns a DataTable object populated with the visible rows and columns of the DataView. + * + * @return a DataTable representation of this view + */ + public final native DataTable toDataTable() /*-{ + return this.toDataTable(); + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataViewColumn.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataViewColumn.java new file mode 100644 index 0000000..1883b2c --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DataViewColumn.java @@ -0,0 +1,140 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +/** + * Represents a calculated column. A calculated column creates a value on the fly for each row and adds it to the view. + */ +public class DataViewColumn extends JavaScriptObject { + + /** + * Default constructor. + * + * @param columnFunction a function for calculating each row value + * @param type data type of the data in the column. + * + * @return the new column + */ + public static DataViewColumn create(ColumnFunction columnFunction, ColumnType type) { + DataViewColumn dataColumn = createObject().cast(); + dataColumn.setCalc(columnFunction); + dataColumn.setType(type); + return dataColumn; + } + + /** + * Creates a new column + * This is similar to passing in a number instead of an object, but enables you to specify a role and properties for + * the new column. + * + * @param sourceColumn + * @return the new column + */ + public static DataViewColumn create(int sourceColumn) { + DataViewColumn dataColumn = createObject().cast(); + dataColumn.setSourceColumn(sourceColumn); + return dataColumn; + } + + protected DataViewColumn() { + } + + /** + * Sets a function that will be called for each row in the column to calculate a value for that cell. + * + * @param columnFunction a function for calculating each row value + */ + public final native void setCalc(ColumnFunction columnFunction) /*-{ + this.calc = function(dataTable, row) { + columnFunction.@com.googlecode.gwt.charts.client.ColumnFunction::calc(Lcom/googlecode/gwt/charts/client/DataTable;I) (dataTable, row); + }; + }-*/; + + /** + * Sets an id for the column. + * + * @param id an id for the column + */ + public final native void setId(String id) /*-{ + this.id = id; + }-*/; + + /** + * Sets a label for the column. + * + * @param label a label for the column + */ + public final native void setLabel(String label) /*-{ + this.label = label; + }-*/; + + /** + * Sets a pattern specifying how to display the column value. + * + * @param pattern number (or date) format string specifying how to display the column value + */ + public final native void setPattern(String pattern) /*-{ + this.pattern = pattern; + }-*/; + + /** + * Sets an object containing any arbitrary properties to assign to this column. If not specified, the view column + * will have no properties. + * + * @param properties a map of custom values applied to the cell. + */ + public final native void setProperties(Properties properties) /*-{ + this.properties = properties; + }-*/; + + /** + * Sets a role for the column. + * If not specified, the existing role will not be imported. + * + * @param role a role for the column + */ + public final void setRole(RoleType role) { + setRole(role.getName()); + } + + /** + * Sets the source column to use as a value; if specified, do not specify the calc or the type property. This is + * similar to passing in a number instead of an object, but enables you to specify a role and properties for the new + * column. + * + * @param sourceColumn a source column to use as a value + */ + public final native void setSourceColumn(int sourceColumn) /*-{ + this.sourceColumn = sourceColumn; + }-*/; + + /** + * Sets a type for the column. + * Used as type of the value that the calc function returns + * + * @param type a type for the column + */ + public final void setType(ColumnType type) { + setType(type.getName()); + } + + private final native void setRole(String role) /*-{ + this.role = role; + }-*/; + + private final native void setType(String type) /*-{ + this.type = type; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DateRange.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DateRange.java new file mode 100644 index 0000000..aab9a20 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/DateRange.java @@ -0,0 +1,57 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * Represents a date range. + */ +public class DateRange extends JavaScriptObject { + + protected DateRange() { + // Default constructor. + } + + /** + * Returns the range end date. + * + * @return the end date + */ + public final Date getEndDate() { + return DateHelper.getDate(getJsEndDate()); + } + + /** + * Returns the range start date. + * + * @return the start date + */ + public final Date getStartDate() { + return DateHelper.getDate(getJsStartDate()); + } + + private final native JsDate getJsEndDate() /*-{ + return this.endDate; + }-*/; + + private final native JsDate getJsStartDate() /*-{ + return this.startDate; + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/HasListeners.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/HasListeners.java new file mode 100644 index 0000000..a43d970 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/HasListeners.java @@ -0,0 +1,94 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +import com.googlecode.gwt.charts.client.event.EventHandler; +import com.googlecode.gwt.charts.client.event.HandlerRef; + +/** + * This class provides event support like described in Chart Events.
+ * Most visualizations fire events to indicate something has occured. As a user of the chart, you would often want to + * listen to these events. If you code your own visualization, you might also want to trigger such events on your own. + */ +public class HasListeners extends JavaScriptObject { + + protected HasListeners() { + // Default constructor. + } + + /** + * Call this method to register to receive events fired by a visualization hosted on your page. Note that this will + * not work for visualizations embedded in a gadget. You should document what event arguments, if any, will be + * passed to the handling function. + * + * @param eventName The string name of the event to listen for. + * @param handler The event handler to call when this visualization fires the eventName event + * @return A listener handler for the new listener. Can be used for removing by calling + * {@link #removeListener(HandlerRef)}. + */ + public final native HandlerRef addListener(String eventName, EventHandler handler) /*-{ + var callback = function(properties) { + handler.@com.googlecode.gwt.charts.client.event.EventHandler::dispatch(Lcom/googlecode/gwt/charts/client/Properties;)(properties); + }; + return $wnd.google.visualization.events.addListener(this, eventName, callback); + }-*/; + + /** + * Call this method to unregister all event listeners of a specific visualization instance. + */ + public final native void removeAllListeners() /*-{ + $wnd.google.visualization.events.removeAllListeners(this); + }-*/; + + /** + * Call this method to unregister an existing event listener. + * + * @param handlerRef The listener handler to remove, as returned by {@link #addListener(String, EventHandler)}. + */ + public final native void removeListener(HandlerRef handlerRef) /*-{ + $wnd.google.visualization.events.removeListener(handlerRef); + }-*/; + + /** + * Called by visualization implementers. Call this method from your visualization to fire an event with an arbitrary + * name and set of values. + * + * @param eventName A string name to call the event. You can choose any string value that you want. + * @param properties A map of name/value pairs to pass to the receiving method. + */ + public final native void trigger(String eventName, Properties properties) /*-{ + $wnd.google.visualization.events.trigger(this, eventName, properties); + }-*/; + + /** + * Call this method to register to receive events fired by a visualization hosted on your page. Note that this will + * not work for visualizations embedded in a gadget. You should document what event arguments, if any, will be + * passed to the handling function. + * + * @param chartObject + * @param eventName The string name of the event to listen for. + * @param handler The event handler to call when this visualization fires the eventName event + * @return A listener handler for the new listener. Can be used for removing by calling + * {@link #removeListener(HandlerRef)}. + */ + protected final native HandlerRef addListener(ChartObject chartObject, String eventName, EventHandler handler) /*-{ + var callback = function(properties) { + handler.@com.googlecode.gwt.charts.client.event.EventHandler::dispatch(Lcom/googlecode/gwt/charts/client/Properties;)(properties); + }; + return $wnd.google.visualization.events.addListener(chartObject, eventName, callback); + }-*/; + +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/Properties.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/Properties.java new file mode 100644 index 0000000..82ef277 --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/Properties.java @@ -0,0 +1,158 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.core.client.JsDate; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * A common name/value map, tipically applied to tables, rows, columns or cells. + */ +public class Properties extends JavaScriptObject { + /** + * Default constructor. + * + * @return a new object + */ + public static Properties create() { + return JavaScriptObject.createObject().cast(); + } + + protected Properties() { + // Default constructor. + } + + /** + * Checks if a property exists. + * + * @param key the property's key + * @return true if exists, false otherwise + */ + public final native boolean containsKey(String key) /*-{ + return this[key] != null; + }-*/; + + /** + * Get a boolean value mapped to the specified key. + * + * @param key the name of the property. + * @return the property value + */ + public final native boolean getBoolean(String key) /*-{ + return this[key]; + }-*/; + + /** + * Get a Date value mapped to the specified key. + * + * @param key the name of the property. + * @return the property value + */ + public final Date getDate(String key) { + JsDate jsDate = getObject(key).cast(); + return DateHelper.getDate(jsDate); + } + + /** + * Get a double value mapped to the specified key. + * + * @param key the name of the property. + * @return the property value + */ + public final native double getNumber(String key) /*-{ + return this[key]; + }-*/; + + /** + * Get a JavaScriptObject value mapped to the specified key. + * + * @param key the name of the property. + * @return the property value + */ + public final native JavaScriptObject getObject(String key) /*-{ + return this[key]; + }-*/; + + /** + * Get a String value mapped to the specified key. + * + * @param key the name of the property. + * @return the property value + */ + public final native String getString(String key) /*-{ + return this[key]; + }-*/; + + /** + * Remove a property from this name/value map. + * + * @param key the property key + */ + public final native void remove(String key) /*-{ + delete this[key]; + }-*/; + + /** + * Set a property. + * + * @param key the name of the property + * @param value the value of the property + */ + public final native void set(String key, boolean value) /*-{ + this[key] = value; + }-*/; + + /** + * Set a property. + * + * @param key the name of the property + * @param value the value of the property + */ + public final void set(String key, Date value) { + set(key, DateHelper.getJsDate(value)); + } + + /** + * Set a property. + * + * @param key the name of the property + * @param value the value of the property + */ + public final native void set(String key, double value) /*-{ + this[key] = value; + }-*/; + + /** + * Set a property. + * + * @param key the name of the property + * @param value the value of the property + */ + public final native void set(String key, JavaScriptObject value) /*-{ + this[key] = value; + }-*/; + + /** + * Set a property. + * + * @param key the name of the property + * @param value the value of the property + */ + public final native void set(String key, String value) /*-{ + this[key] = value; + }-*/; +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RoleType.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RoleType.java new file mode 100644 index 0000000..c1b713a --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RoleType.java @@ -0,0 +1,116 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +/** + * A column role describes the purpose of the data in that column: for example, a column might hold data describing + * tooltip text, data point annotations, or uncertainty indicators. + * @see DataTable Roles + */ +public enum RoleType { + /** + * You should not need to assign this role explicitly unless designing a multi-domain chart (shown here); the basic + * format of the data table enables the charting engine to infer which columns are domain columns. However, you + * should be aware of which columns are domain columns so that you know which other columns can modify it. Domain + * columns specify labels along the major axis of the chart. Multiple domain columns can sometimes be used to + * support multiple scales within the same chart. Data type: Usually string, but occasionally number or date + */ + DOMAIN("domain"), + /** + * + You should not need to assign this role explicitly; the basic format of the data table enables the charting + * engine to infer which columns are domain columns. However, you sould be aware of which columns are data columns + * so that you know which other columns can modify it. Data role columns specify series data to render in the chart. + * For most charts, one column = one series, but this can vary by chart type (for example, scatter charts require + * two data columns for the first series, and an additional one for each additional series; candlestick charts + * require four data columns for each series). Data type: number + */ + DATA("data"), + /** + * Text to display on the chart near the associated data point. The text displays without any user interaction. + * Annotations and annotation text can be assigned to both data points and categories (axis labels). There are two + * styles of annotations: letter (default), which draws the annotation text near the specified point, and line, + * which draws the annotation text on a line that bisects the chart area. Line annotations only apply to domain + * values, not data values. You can specify the line style by setting this chart option: annotation: {'column_id': + * {style: 'line'}} Data type: string Default: Empty string + */ + ANNOTATION("annotation"), + /** + * Extended text to display when the user hovers over the associated annotation. Annotations and annotation text can + * be assigned to both data points and categories (axis labels). If you have an annotationText column, you must also + * have an annotation column. Tooltip text, in contrast, is displayed when the user hovers over the associated data + * point on the chart. Data type: string Default: Empty string + */ + ANNOTATIONTEXT("annotationText"), + /** + * Indicates potential data range for a specific point. Intervals are usually displayed as I-bar style range + * indicators. Interval columns are numeric columns; add interval columns in pairs, marking the low and high value + * of the bar. Interval values should be added in increasing value, from left to right. Data type: number Default: + * No interval + */ + INTERVAL("interval"), + /** + * Text to display when the user hovers over the data point associated with this row. Data type: string Default: + * Data point value + */ + TOOLTIP("tooltip"), + /** + * + Indicates whether a data point is certain or not. How this is displayed depends on the chart type—for example, it + * might be indicated by dashed lines or a striped fill. For line and area charts, the segment between two data + * points is certain if and only if both data points are certain. Data type: boolean, where true is certain, false + * is uncertain. Default: true + */ + CERTAINTY("certainty"), + /** + * Emphasizes specified chart data points. Displayed as a thick line and/or large point. For line and area charts, + * the segment between two data points is emphasized if and only if both data points are emphasized. Data type: + * boolean Default: false + */ + EMPHASIS("emphasis"), + /** + * Indicates whether a point is in or out of scope. If a point is out of scope, it is visually de-emphasized. For + * line and area charts, the segment between two data points is in scope if either endpoint is in scope. Data type: + * boolean, where true means in scope. Default: true + */ + SCOPE("scope"); + + /** + * Get a RoleType by providing its name. + * + * @param name the RoleType name. + * @return a RoleType corresponding to the provided name. + */ + public static RoleType findByName(String name) { + for (RoleType roleType : RoleType.values()) { + if (roleType.getName().equals(name)) { + return roleType; + } + } + return null; + } + + private final String name; + + private RoleType(String name) { + this.name = name; + } + + /** + * Get the name of the RoleType. + * @return the name of the RoleType. + */ + public String getName() { + return name; + } +} diff --git a/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RowFilter.java b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RowFilter.java new file mode 100644 index 0000000..88a840b --- /dev/null +++ b/gwt-charts/src/main/java/com/googlecode/gwt/charts/client/RowFilter.java @@ -0,0 +1,209 @@ +/* + * Copyright 2012 Rui Afonso + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ +package com.googlecode.gwt.charts.client; + +import com.google.gwt.core.client.JavaScriptObject; + +import com.googlecode.gwt.charts.client.util.DateHelper; + +import java.util.Date; + +/** + * Each filter is an object with a numeric column property that + * specifies the index of the column in the row to assess, plus one of the following:
+ *