c0f737a18b45718f14d31cc914ea812d0ba89fe8
[public/netxms.git] / src / java / netxms-eclipse / Charts / src / org / netxms / ui / eclipse / charts / api / ChartFactory.java
1 /**
2 *
3 */
4 package org.netxms.ui.eclipse.charts.api;
5
6 import org.eclipse.swt.widgets.Composite;
7 import org.netxms.ui.eclipse.charts.widgets.CurrentValueWidget;
8 import org.netxms.ui.eclipse.charts.widgets.DataComparisonBirtChart;
9 import org.netxms.ui.eclipse.charts.widgets.DialChartWidget;
10 import org.netxms.ui.eclipse.charts.widgets.LineChart;
11
12 /**
13 * Chart factory
14 */
15 public class ChartFactory
16 {
17 /**
18 * Create line chart
19 *
20 * @param parent parent composite
21 * @param style widget style
22 * @return line chart widget
23 */
24 public static HistoricalDataChart createLineChart(Composite parent, int style)
25 {
26 return new LineChart(parent, style);
27 }
28
29 /**
30 * Create bar chart
31 *
32 * @param parent parent composite
33 * @param style widget style
34 * @return bar chart widget
35 */
36 public static DataComparisonChart createBarChart(Composite parent, int style)
37 {
38 return new DataComparisonBirtChart(parent, style, DataComparisonChart.BAR_CHART);
39 }
40
41 /**
42 * Create tube chart
43 *
44 * @param parent parent composite
45 * @param style widget style
46 * @return tube chart widget
47 */
48 public static DataComparisonChart createTubeChart(Composite parent, int style)
49 {
50 return new DataComparisonBirtChart(parent, style, DataComparisonChart.TUBE_CHART);
51 }
52
53 /**
54 * Create pie chart
55 *
56 * @param parent parent composite
57 * @param style widget style
58 * @return pie chart widget
59 */
60 public static DataComparisonChart createPieChart(Composite parent, int style)
61 {
62 return new DataComparisonBirtChart(parent, style, DataComparisonChart.PIE_CHART);
63 }
64
65 /**
66 * Create dial chart
67 *
68 * @param parent parent composite
69 * @param style widget style
70 * @return dial chart widget
71 */
72 public static Gauge createDialChart(Composite parent, int style)
73 {
74 return new DialChartWidget(parent, style);
75 }
76
77 /**
78 * Create "current values" pseudo-chart
79 *
80 * @param parent parent composite
81 * @param style widget style
82 * @return dial chart widget
83 */
84 public static Gauge createCurrentValueChart(Composite parent, int style)
85 {
86 return new CurrentValueWidget(parent, style);
87 }
88 }