CSE115.Dialogs
Class ColorDialog

java.lang.Object
  |
  +--CSE115.Dialogs.ColorDialog

public class ColorDialog
extends Object

A dialog for choosing a color.

Author:
Phil Ventura

Constructor Summary
ColorDialog(Container container)
          The constructor where no default directory is specified.
ColorDialog(Container container, Color initialColor)
          The constructor where no default directory is specified.
 
Method Summary
 void appear()
          Call this method to make the file dialog box appear.
 void approvePressed(Color color)
          Called when the user chooses a color.
 void cancelPressed()
          Called when the Cancel button is pressed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorDialog

public ColorDialog(Container container)
The constructor where no default directory is specified.

Parameters:
container - the container that this should show above; this will remain hidden until asked to appear Note: This container cannot be an NGP.Contaiers.Frame

ColorDialog

public ColorDialog(Container container,
                   Color initialColor)
The constructor where no default directory is specified.

Parameters:
container - the container that this should show above; this will remain hidden until asked to appear Note: This container cannot be an NGP.Contaiers.Frame
initialColor - the initial color selected in the dialog.
Method Detail

appear

public void appear()
Call this method to make the file dialog box appear. Once the user chooses a file, either approvePressed or cancelPressed will be automatically called.


approvePressed

public void approvePressed(Color color)
Called when the user chooses a color. Must be overridden to do something useful.

Parameters:
color - this will be the color that the user selected

cancelPressed

public void cancelPressed()
Called when the Cancel button is pressed. Override if you want something special to happen if the user chooses cancel. If you want to just continue you don't need to do anything.