01: /* XYModel.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 14 10:27:21 2006, Created by henrichen
10: }}IS_NOTE
11:
12: Copyright (C) 2006 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zul;
20:
21: import java.util.Collection;
22:
23: /**
24: * A XY chart data model.
25: *
26: * @author henrichen
27: * @see Chart
28: * @see SimpleXYModel
29: */
30: public interface XYModel extends ChartModel {
31:
32: /**
33: * Get a series of the specified index;
34: */
35: public Comparable getSeries(int index);
36:
37: /**
38: * Get all series as a collection.
39: */
40: public Collection getSeries();
41:
42: /**
43: * Get data count of a specified series.
44: * @param series the specified series.
45: */
46: public int getDataCount(Comparable series);
47:
48: /**
49: * Get X value of a specified series and data index.
50: * @param series the series.
51: * @param index the data index.
52: */
53: public Number getX(Comparable series, int index);
54:
55: /**
56: * Get Y value of a specified series and data index.
57: * @param series the series.
58: * @param index the data index.
59: */
60: public Number getY(Comparable series, int index);
61:
62: /**
63: * Add an (x,y) into a series.
64: * @param series the series.
65: * @param x the x value.
66: * @param y the y value.
67: */
68: public void addValue(Comparable series, Number x, Number y);
69:
70: /**
71: * Set model to autosort on x value for each series.
72: */
73: public void setAutoSort(boolean auto);
74:
75: /**
76: * check whether to autosort on x value for each series; default is true.
77: */
78: public boolean isAutoSort();
79:
80: /**
81: /**
82: * Remove data of a specified series.
83: * @param series the series
84: */
85: public void removeSeries(Comparable series);
86:
87: /**
88: * Remove (x,Y) value of a specified series and data index.
89: * @param series the series.
90: * @param index the data index.
91: */
92: public void removeValue(Comparable series, int index);
93:
94: /**
95: * clear this model.
96: */
97: public void clear();
98: }
|