Revision 495
org.gvsig.tools/library/trunk/org.gvsig.tools/org.gvsig.tools.swing/org.gvsig.tools.swing.impl/src/main/java/org/gvsig/tools/swing/impl/windowmanager/DefaultWindowManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.tools.swing.impl.windowmanager; |
2 | 2 |
|
3 |
import java.awt.Component; |
|
4 |
import java.awt.event.ComponentEvent; |
|
5 |
import java.awt.event.ComponentListener; |
|
6 |
|
|
3 | 7 |
import javax.swing.JComponent; |
4 | 8 |
import javax.swing.JFrame; |
5 | 9 |
|
... | ... | |
12 | 16 |
case TOOL: |
13 | 17 |
case WINDOW: |
14 | 18 |
case DIALOG: |
15 |
JFrame frame = new JFrame(tittle);
|
|
19 |
MyFrame frame = new MyFrame(tittle);
|
|
16 | 20 |
//frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
17 | 21 |
|
18 | 22 |
frame.setContentPane(component); |
19 |
|
|
23 |
component.addComponentListener(frame); |
|
24 |
|
|
20 | 25 |
frame.pack(); |
21 | 26 |
frame.setVisible(true); |
22 | 27 |
break; |
... | ... | |
24 | 29 |
} |
25 | 30 |
|
26 | 31 |
} |
32 |
|
|
33 |
public class MyFrame extends JFrame implements ComponentListener{ |
|
27 | 34 |
|
35 |
public MyFrame(String title){ |
|
36 |
super(title); |
|
37 |
} |
|
38 |
|
|
39 |
public void componentHidden(ComponentEvent arg0) { |
|
40 |
this.setVisible(false); |
|
41 |
this.dispose(); |
|
42 |
} |
|
43 |
|
|
44 |
public void setComponentPane(Component component){ |
|
45 |
|
|
46 |
} |
|
47 |
|
|
48 |
public void componentMoved(ComponentEvent arg0) { |
|
49 |
// TODO Auto-generated method stub |
|
50 |
|
|
51 |
} |
|
52 |
|
|
53 |
public void componentResized(ComponentEvent arg0) { |
|
54 |
// TODO Auto-generated method stub |
|
55 |
|
|
56 |
} |
|
57 |
|
|
58 |
public void componentShown(ComponentEvent arg0) { |
|
59 |
// TODO Auto-generated method stub |
|
60 |
|
|
61 |
} |
|
62 |
|
|
63 |
|
|
64 |
} |
|
65 |
|
|
28 | 66 |
} |
Also available in: Unified diff