Class ScaleDialog

All Implemented Interfaces:
ActionListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class ScaleDialog extends Dialog implements ActionListener, KeyListener
A dialog to enter the parameters for an image scaling operation.
Author:
Marco Schmidt
See Also:
  • Field Details

    • ok

      private Button ok
    • cancel

      private Button cancel
    • heightTextField

      private TextComponent heightTextField
    • widthTextField

      private TextComponent widthTextField
    • maintainAspectRatio

      private Checkbox maintainAspectRatio
    • types

      private Choice types
    • pressedOk

      private boolean pressedOk
    • oldWidthString

      private String oldWidthString
    • oldHeightString

      private String oldHeightString
    • oldWidth

      private int oldWidth
    • oldHeight

      private int oldHeight
    • type

      private int type
  • Constructor Details

    • ScaleDialog

      public ScaleDialog(Frame owner, Strings strings, int width, int height, boolean pickType, String[] typeNames, int initialType)
      Creates an InfoDialog, a modal dialog to display a text message, centered on the desktop.
      Parameters:
      owner - the Frame this dialog will belong to
      strings - the Strings resource used for text messages
      width - the current width of the image
      height - the current height of the image
      pickType - determines whether the will be a Choice box for picking the type of scaling algorithm
      typeNames - names of the image scaling algorithms
      initialType - algorithm type to be initially selected
  • 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
    • center

      public void center()
      Centers the dialog on screen.
    • getHeightValue

      public int getHeightValue()
    • getFilterType

      public int getFilterType()
    • getValue

      private int getValue(TextComponent textField)
    • getWidthValue

      public int getWidthValue()
    • hasPressedOk

      public boolean hasPressedOk()
    • handleKeys

      public void handleKeys(KeyEvent e)
    • 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