|
1
|
|
package abbot.editor.recorder;
|
|
2
|
|
|
|
3
|
|
import java.awt.AWTEvent;
|
|
4
|
|
import java.awt.event.*;
|
|
5
|
|
|
|
6
|
|
import javax.swing.JInternalFrame;
|
|
7
|
|
import javax.swing.event.*;
|
|
8
|
|
|
|
9
|
|
public abstract class AbstractInternalFrameWatcher
|
|
10
|
|
extends InternalFrameAdapter implements ComponentListener {
|
|
11
|
5
|
public AbstractInternalFrameWatcher(JInternalFrame f) {
|
|
12
|
5
|
f.addInternalFrameListener(this);
|
|
13
|
5
|
f.addComponentListener(this);
|
|
14
|
|
}
|
|
15
|
|
protected abstract void dispatch(AWTEvent e);
|
|
16
|
1
|
public void componentHidden(ComponentEvent e) {
|
|
17
|
|
|
|
18
|
|
|
|
19
|
1
|
e.getComponent().removeComponentListener(this);
|
|
20
|
1
|
((JInternalFrame)e.getComponent()).removeInternalFrameListener(this);
|
|
21
|
|
}
|
|
22
|
1
|
public void internalFrameClosing(InternalFrameEvent e) {
|
|
23
|
1
|
dispatch(e);
|
|
24
|
1
|
e.getInternalFrame().removeInternalFrameListener(this);
|
|
25
|
1
|
e.getInternalFrame().removeComponentListener(this);
|
|
26
|
|
}
|
|
27
|
1
|
public void internalFrameIconified(InternalFrameEvent e) {
|
|
28
|
1
|
dispatch(e);
|
|
29
|
|
}
|
|
30
|
1
|
public void internalFrameDeiconified(InternalFrameEvent e) {
|
|
31
|
1
|
dispatch(e);
|
|
32
|
|
}
|
|
33
|
|
|
|
34
|
5
|
public void componentShown(ComponentEvent e) { }
|
|
35
|
1
|
public void componentResized(ComponentEvent e) { }
|
|
36
|
1
|
public void componentMoved(ComponentEvent e) { }
|
|
37
|
|
}
|
|
38
|
|
|