7 |
import java.awt.event.WindowAdapter; |
import java.awt.event.WindowAdapter; |
8 |
import java.awt.event.WindowEvent; |
import java.awt.event.WindowEvent; |
9 |
|
|
10 |
|
import javax.swing.AbstractAction; |
11 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
12 |
import javax.swing.JDialog; |
import javax.swing.JDialog; |
13 |
import javax.swing.JRootPane; |
import javax.swing.JRootPane; |
23 |
*/ |
*/ |
24 |
public class AtlasDialog extends JDialog { |
public class AtlasDialog extends JDialog { |
25 |
|
|
26 |
|
protected OkButton okButton; |
27 |
|
protected CancelButton cancelButton; |
28 |
|
|
29 |
public AtlasDialog(final Component owner, String title) { |
public AtlasDialog(final Component owner, String title) { |
30 |
super(SwingUtil.getParentWindow(owner), title); |
super(SwingUtil.getParentWindow(owner), title); |
31 |
initDialog(); |
initDialog(); |
32 |
} |
} |
33 |
|
|
34 |
public AtlasDialog(final Component owner) { |
public AtlasDialog(final Component owner) { |
35 |
super(SwingUtil.getParentWindow(owner)); |
super(SwingUtil.getParentWindow(owner)); |
36 |
initDialog(); |
initDialog(); |
93 |
super.dispose(); |
super.dispose(); |
94 |
isDisposed = true; |
isDisposed = true; |
95 |
} |
} |
96 |
|
|
97 |
|
/** |
98 |
|
* @return a default OkButton that will call {@link #okClose()} |
99 |
|
*/ |
100 |
|
protected OkButton getOkButton() { |
101 |
|
if (okButton == null) { |
102 |
|
okButton = new OkButton(new AbstractAction() { |
103 |
|
|
104 |
|
@Override |
105 |
|
public void actionPerformed(ActionEvent e) { |
106 |
|
close(); |
107 |
|
} |
108 |
|
}); |
109 |
|
} |
110 |
|
return okButton; |
111 |
|
} |
112 |
|
|
113 |
|
/** |
114 |
|
* @return a default CancelButton that will call {@link #cancelClose()} |
115 |
|
*/ |
116 |
|
protected CancelButton getCancelButton() { |
117 |
|
if (cancelButton == null) { |
118 |
|
cancelButton = new CancelButton(new AbstractAction() { |
119 |
|
|
120 |
|
@Override |
121 |
|
public void actionPerformed(ActionEvent e) { |
122 |
|
dispose(); |
123 |
|
} |
124 |
|
}); |
125 |
|
} |
126 |
|
return cancelButton; |
127 |
|
} |
128 |
} |
} |