01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.common;
05:
06: import java.awt.event.ActionEvent;
07: import java.awt.event.ActionListener;
08: import java.awt.event.ComponentAdapter;
09: import java.awt.event.ComponentEvent;
10:
11: import javax.swing.Timer;
12:
13: import org.dijon.Frame;
14:
15: public class XFrame extends Frame {
16: private Timer storeTimer;
17:
18: public XFrame() {
19: super ();
20:
21: storeTimer = new Timer(1000, new ActionListener() {
22: public void actionPerformed(ActionEvent e) {
23: storeBounds();
24: }
25: });
26: storeTimer.setRepeats(false);
27:
28: addComponentListener(new ComponentListener());
29: }
30:
31: public void storeBounds() {/**/
32: }
33:
34: class ComponentListener extends ComponentAdapter {
35: public void componentResized(ComponentEvent e) {
36: if (storeTimer.isRunning()) {
37: storeTimer.stop();
38: }
39: storeTimer.start();
40: }
41:
42: public void componentMoved(ComponentEvent e) {
43: if (storeTimer.isRunning()) {
44: storeTimer.stop();
45: }
46: storeTimer.start();
47: }
48: }
49: }
|