Class PhaseHandler

java.lang.Object
  extended by PhaseHandler
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class PhaseHandler
extends java.lang.Object
implements java.awt.event.ActionListener

Creates a popup dialog box to allow selection of phases that are allowed to form in the system.

Version:
1.0 (August 2007)
Author:
Mark S. Ghiorso, OFM-Research Inc.

Constructor Summary
PhaseHandler(rock.dRock rockRef)
          Creates the GUI and initializes the class.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Displays the popup dialog box.
static void addComponent(java.awt.Container container, java.awt.Component component, int gx, int gy, int gw, int gh, int fill)
          Method to layout a component in a container using GridBagConstraints.
 void disablePhase(short i)
          Removes a phase from the system.
 void enablePhase(short i)
          Includes a phase in the system.
 boolean getPhaseState(short i)
          Retrieves the inclusion state of a phase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhaseHandler

public PhaseHandler(rock.dRock rockRef)
Creates the GUI and initializes the class.

Parameters:
rockRef - Instance of server-side rock object.
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Displays the popup dialog box.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Action event that triggered the display request.

enablePhase

public void enablePhase(short i)
Includes a phase in the system. By default all phases are included when the Melts class is instantiated. This method is provided for setting the inclusion of a phase as specified in an input file. The method emulates a user selection in the dialog box GUI.

Parameters:
i - Index number of phase to be included.

disablePhase

public void disablePhase(short i)
Removes a phase from the system. By default all phases are included when the Melts class is instantiated. This method is provided for setting the exclusion of a phase as specified in an input file. The method emulates a user selection in the dialog box GUI.

Parameters:
i - Index number of phase to be excluded.

getPhaseState

public boolean getPhaseState(short i)
Retrieves the inclusion state of a phase.

Parameters:
i - Index number of phase to be queried.
Returns:
True if phase is included in the system; false if phase is excluded.

addComponent

public static void addComponent(java.awt.Container container,
                                java.awt.Component component,
                                int gx,
                                int gy,
                                int gw,
                                int gh,
                                int fill)
Method to layout a component in a container using GridBagConstraints.

Parameters:
container - Instance of a container class.
component - Instance of a component class to position in the container.
gx - X-axis grid position.
gy - Y-axis grid position.
gw - Width of component in grid units.
gh - Height of component in grid units.
fill - Fill behavior for component.
See Also:
GridBagConstraints