| | |
| | | |
| | | /** |
| | | * The generic frame of the Control Panel. It contains a StatusGenericPanel. |
| | | * |
| | | */ |
| | | public class GenericFrame extends JFrame |
| | | { |
| | |
| | | ColorAndFontConstants.greyBackground; |
| | | private JButton okButton; |
| | | |
| | | /** |
| | | * The close button. |
| | | */ |
| | | /** The close button. */ |
| | | protected JButton closeButton; |
| | | private JButton cancelButton; |
| | | //private JPanel contentPanel; |
| | | /** |
| | | * The panel contained in the frame. |
| | | */ |
| | | /** The panel contained in the frame. */ |
| | | protected StatusGenericPanel panel; |
| | | //private ProgressPanel progressPanel; |
| | | //private boolean displayInputInNextVisible; |
| | | private Component lastComponentWithFocus; |
| | | |
| | | /** |
| | |
| | | KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); |
| | | ActionListener actionListener = new ActionListener() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | setVisible(false); |
| | |
| | | |
| | | FocusListener focusListener = new FocusAdapter() |
| | | { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void focusGained(FocusEvent ev) |
| | | { |
| | | lastComponentWithFocus = ev.getComponent(); |
| | |
| | | addFocusListener(focusListener, panel); |
| | | |
| | | addWindowListener(new WindowAdapter() { |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void windowClosing(WindowEvent e) { |
| | | GenericFrame.this.panel.closeClicked(); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public void setVisible(boolean visible) |
| | | { |
| | | if (visible && lastComponentWithFocus == null) |