?? compositecomponent.java
字號:
package prototype;
import java.util.Vector;
import javax.microedition.lcdui.Graphics;
public class CompositeComponent extends Component {
Vector childs = new Vector();
Component focus;
int rectX;
int rectY;
int rectW;
int rectH;
public CompositeComponent(int x, int y, int width, int height) {
super(x, y, width, height);
// TODO
}
public void add(Component c, int index) {
childs.insertElementAt(c, index);
c.setParent(this);
}
final public void add(Component c) {
this.add(c, childs.size());
}
/**
* Gets the number of components currently added
*
* @return the number of components currently added
*/
public int getComponentCount() {
return childs.size();
}
/**
* get UIComponet at the specified index
*
* @param index
* @return
*/
public Focusable getComponent(int index) {
return (Focusable) childs.elementAt(index);
}
public int getComponentIndex(Focusable c) {
return childs.indexOf(c);
}
public void remove(int index) {
((Component) childs.elementAt(index)).setParent(null);
childs.removeElementAt(index);
}
final public void setFocusNext() {
if (focus != null)
moveFocus(focus, true);
}
public Focusable getFocus() {
return focus;
}
void moveFocus(Focusable c, boolean forward) {
}
protected void paint(Graphics g, CompositeComponent w) {
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -