1 /* Copyright (C) 1999, 2000 Free Software Foundation
3 This file is part of libjava.
5 This software is copyrighted work licensed under the terms of the
6 Libjava License. Please consult the file "LIBJAVA_LICENSE" for
10 import java
.awt
.event
.*;
11 //import java.awt.peer.ComponentPeer;
13 /* A very incomplete placeholder. */
15 public abstract class Component
implements MenuContainer
18 java
.awt
.peer
.ComponentPeer peer
;
19 int x
, y
, width
, height
;
21 public Container
getParent () { return parent
; }
24 public java
.awt
.peer
.ComponentPeer
getPeer () { return peer
; }
26 public void setVisible (boolean b
)
29 public void setSize (Dimension d
)
30 { setSize(d
.width
, d
.height
); }
32 public void setSize (int width
, int height
)
34 this.width
= width
; this.height
= height
;
36 peer
.setBounds(x
, y
, width
, height
);
39 public void setLocation (int x
, int y
)
41 this.x
= x
; this.y
= y
;
43 peer
.setBounds(x
, y
, width
, height
);
46 public void setLocation (Point pt
)
47 { setLocation(pt
.x
, pt
.y
); }
49 public void setBounds (int x
, int y
, int w
, int h
)
51 this.x
= x
; this.y
= y
;
52 this.width
= w
; this.height
= h
;
54 peer
.setBounds(x
, y
, w
, h
);
57 public void setBounds (Rectangle rect
)
58 { setBounds(rect
.x
, rect
.y
, rect
.width
, rect
.height
); }
60 public Rectangle
getBounds ()
62 return new Rectangle(x
, y
, width
, height
);
65 public Point
getLocation ()
67 return new Point(x
, y
);
80 public Dimension
getSize ()
82 return new Dimension(width
, height
);
85 public Dimension
getMinimumSize ()
88 return new Dimension(width
, height
);
90 return peer
.getMinimumSize();
93 public Dimension
getPreferredSize ()
96 return new Dimension(width
, height
);
98 return peer
.getPreferredSize();
101 public synchronized void addKeyListener (KeyListener listener
)
104 public boolean isFocusTraversable ()
105 { /* FIXME */ return false; }
107 public void addNotify () { }