1:
37:
38:
39: package ;
40:
41: import ;
42: import ;
43: import ;
44: import ;
45: import ;
46: import ;
47: import ;
48: import ;
49: import ;
50: import ;
51: import ;
52: import ;
53: import ;
54: import ;
55: import ;
56: import ;
57: import ;
58: import ;
59: import ;
60: import ;
61: import ;
62: import ;
63: import ;
64:
65:
72:
73:
82: public class GLightweightPeer
83: implements LightweightPeer, ContainerPeer
84: {
85: private Component comp;
86:
87: private Insets containerInsets;
88:
89: public GLightweightPeer(Component comp)
90: {
91: this.comp = comp;
92: }
93:
94:
95:
96: public Insets insets()
97: {
98: return getInsets ();
99: }
100:
101: public Insets getInsets()
102: {
103: if (containerInsets == null)
104: containerInsets = new Insets (0,0,0,0);
105: return containerInsets;
106: }
107:
108: public void beginValidate()
109: {
110: }
111:
112: public void endValidate()
113: {
114: }
115:
116: public void beginLayout()
117: {
118: }
119:
120: public void endLayout()
121: {
122: }
123:
124: public boolean isPaintPending()
125: {
126: return false;
127: }
128:
129:
130:
131: public int checkImage(Image img, int width, int height, ImageObserver o)
132: {
133: return comp.getToolkit().checkImage(img, width, height, o);
134: }
135:
136: public Image createImage(ImageProducer prod)
137: {
138: return comp.getToolkit().createImage(prod);
139: }
140:
141:
142: public Image createImage(int width, int height)
143: {
144: return null;
145: }
146:
147: public void disable() {}
148:
149: public void dispose() {}
150:
151: public void enable() {}
152:
153: public GraphicsConfiguration getGraphicsConfiguration()
154: {
155: return null;
156: }
157:
158: public FontMetrics getFontMetrics(Font f)
159: {
160: return comp.getToolkit().getFontMetrics(f);
161: }
162:
163:
165: public Graphics getGraphics()
166: {
167: return null;
168: }
169:
170: public Point getLocationOnScreen()
171: {
172: Point parentLocation = comp.getParent().getLocationOnScreen();
173: return new Point (parentLocation.x + comp.getX(),
174: parentLocation.y + comp.getY());
175: }
176:
177: public Dimension getMinimumSize()
178: {
179: return new Dimension(comp.getWidth(), comp.getHeight());
180: }
181:
182:
184: public Dimension getPreferredSize()
185: {
186: return new Dimension(comp.getWidth(), comp.getHeight());
187: }
188:
189:
191: public Toolkit getToolkit()
192: {
193: return null;
194: }
195:
196: public void handleEvent(AWTEvent e) {}
197:
198: public void hide() {}
199:
200: public boolean isFocusable()
201: {
202: return false;
203: }
204:
205: public boolean isFocusTraversable()
206: {
207: return false;
208: }
209:
210: public Dimension minimumSize()
211: {
212: return getMinimumSize();
213: }
214:
215: public Dimension preferredSize()
216: {
217: return getPreferredSize();
218: }
219:
220: public void paint(Graphics graphics) {}
221:
222: public boolean prepareImage(Image img, int width, int height,
223: ImageObserver o)
224: {
225: return comp.getToolkit().prepareImage(img, width, height, o);
226: }
227:
228: public void print(Graphics graphics) {}
229:
230: public void repaint(long tm, int x, int y, int width, int height)
231: {
232: Component p = comp.getParent ();
233: if(p != null)
234: p.repaint(tm,x+comp.getX(),y+comp.getY(),width,height);
235: }
236:
237: public void requestFocus() {}
238:
239: public boolean requestFocus(Component source, boolean bool1, boolean bool2, long x)
240: {
241: return false;
242: }
243:
244: public void reshape(int x, int y, int width, int height) {}
245:
246: public void setBackground(Color color) {}
247:
248: public void setBounds(int x, int y, int width, int height) {}
249:
250: public void setCursor(Cursor cursor) {}
251:
252: public void setEnabled(boolean enabled) {}
253:
254: public void setEventMask(long eventMask) {}
255:
256: public void setFont(Font font) {}
257:
258: public void setForeground(Color color) {}
259:
260: public void setVisible(boolean visible) {}
261:
262: public void show() {}
263:
264: public ColorModel getColorModel ()
265: {
266: return comp.getColorModel ();
267: }
268:
269: public boolean isObscured()
270: {
271: return false;
272: }
273:
274: public boolean canDetermineObscurity()
275: {
276: return false;
277: }
278:
279: public void coalescePaintEvent(PaintEvent e) { }
280:
281: public void updateCursorImmediately() { }
282:
283: public VolatileImage createVolatileImage(int width, int height)
284: {
285: return null;
286: }
287:
288: public boolean handlesWheelScrolling()
289: {
290: return false;
291: }
292:
293: public void createBuffers(int x, BufferCapabilities capabilities)
294: throws AWTException { }
295:
296: public Image getBackBuffer()
297: {
298: return null;
299: }
300:
301: public void flip(BufferCapabilities.FlipContents contents) { }
302:
303: public void destroyBuffers() { }
304:
305: public boolean isRestackSupported()
306: {
307: return false;
308: }
309:
310: public void cancelPendingPaint(int x, int y, int width, int height)
311: {
312:
313: }
314:
315: public void restack()
316: {
317:
318: }
319:
320: public Rectangle getBounds()
321: {
322: return null;
323: }
324:
325: public void reparent(ContainerPeer parent)
326: {
327:
328: }
329:
330: public void setBounds(int x, int y, int z, int width, int height)
331: {
332:
333: }
334:
335: public boolean isReparentSupported()
336: {
337: return false;
338: }
339:
340: public void layout()
341: {
342:
343: }
344: }