01: /* ChartDataEvent.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Wed Aug 03 11:59:03 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.event;
20:
21: import org.zkoss.zul.ChartModel;
22:
23: /**
24: * Defines an event that encapsulates changes to a chart's data model.
25: *
26: * @author henrichen
27: */
28: public class ChartDataEvent {
29: /** Identifies one or more changes in the lists contents. */
30: public static final int CHANGED = 0;
31: /** Identifies the addition of one or more contiguous items to the list. */
32: public static final int ADDED = 1;
33: /** Identifies the removal of one or more contiguous items from the list. */
34: public static final int REMOVED = 2;
35:
36: /** Identifies one or more changes in the charts contents. */
37: private final ChartModel _model;
38: private final int _type;
39: private final Comparable _series;
40: private final Object _data;
41:
42: public ChartDataEvent(ChartModel model, int type,
43: Comparable series, Object data) {
44: if (model == null)
45: throw new NullPointerException();
46: _model = model;
47: _type = type;
48: _series = series;
49: _data = data;
50: }
51:
52: /** Returns the chart model that fires this event.
53: */
54: public ChartModel getModel() {
55: return _model;
56: }
57:
58: /** Returns the event type: CHANGED, ADDED, REMOVED.
59: */
60: public int getType() {
61: return _type;
62: }
63:
64: /** Returns the series index of the chart data model.
65: */
66: public Comparable getSeries() {
67: return _series;
68: }
69:
70: /** Returns customed data. Depends on the implementation.
71: */
72: public Object getData() {
73: return _data;
74: }
75: }
|