01: /* ZkGauge.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: May 29, 2007 3:23:13 PM, Created by henrichen
10: }}IS_NOTE
11:
12: Copyright (C) 2007 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.zkmob.ui;
20:
21: import javax.microedition.lcdui.Form;
22: import javax.microedition.lcdui.Gauge;
23:
24: import org.zkoss.zkmob.Itemable;
25: import org.zkoss.zkmob.ZkComponent;
26:
27: /**
28: * @author henrichen
29: *
30: */
31: public class ZkGauge extends Gauge implements ZkComponent, Itemable {
32: private String _id;
33: private ZkDesktop _zk;
34: private ZkForm _form;
35:
36: public ZkGauge(ZkDesktop zk, String id, String label,
37: boolean interactive, int maxValue, int initialValue) {
38: super (label, interactive, maxValue, initialValue);
39: _id = id;
40: _zk = zk;
41: }
42:
43: //--ZkComponent--//
44: public String getId() {
45: return _id;
46: }
47:
48: public ZkComponent getParent() {
49: return (ZkComponent) getForm();
50: }
51:
52: public void setParent(ZkComponent parent) {
53: if (_form != parent) { //yes, !=, not !equals
54: _form = (ZkForm) parent;
55: _form.appendChild(this );
56: }
57: }
58:
59: public ZkDesktop getZkDesktop() {
60: return _zk;
61: }
62:
63: public void setAttr(String attr, String val) {
64: //TODO:
65: }
66:
67: //--Itemable--//
68: public Form getForm() {
69: return _form;
70: }
71: }
|