Class WindowSizeDialog

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
net.sourceforge.jiu.gui.awt.dialogs.WindowSizeDialog
All Implemented Interfaces:
ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class WindowSizeDialog extends Dialog implements ActionListener, KeyListener
A dialog to enter values for the width and height of a window (typically for a spatial filter like median or mean.
Author:
Marco Schmidt
See Also:
  • Field Details

    • ok

      private Button ok
    • cancel

      private Button cancel
    • width

      private TextField width
    • height

      private TextField height
    • pressedOk

      private boolean pressedOk
  • Constructor Details

    • WindowSizeDialog

      public WindowSizeDialog(Frame owner, Strings strings, int titleIndex, int initialWidth, int initialHeight)
      Parameters:
      owner - the Frame this dialog will belong to
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Hides (closes) this dialog if the OK button was source of the action event (e.g. if the button was pressed).
      Specified by:
      actionPerformed in interface ActionListener
    • getHeightValue

      public int getHeightValue()
    • getWidthValue

      public int getWidthValue()
    • getValue

      private int getValue(TextComponent textField)
      Attempts to convert the content of the argument text component to an int; if successful, returns that int, otherwise -1000 is returned.
      Parameters:
      textField - the text component that is supposed to hold an int value
      Returns:
      int representation of the text component's data
    • hasPressedOk

      public boolean hasPressedOk()
    • updateOkButton

      private void updateOkButton()
    • keyPressed

      public void keyPressed(KeyEvent e)
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
    • keyTyped

      public void keyTyped(KeyEvent e)
      Specified by:
      keyTyped in interface KeyListener