org.peace_tools.core.job
Class ClusterWizardPage

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.peace_tools.generic.GenericWizardPage
                      extended by org.peace_tools.core.job.ClusterWizardPage
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, WizardPage

public class ClusterWizardPage
extends GenericWizardPage
implements java.awt.event.ActionListener

This class serves as an interactive page in a JobWizard. This page permits the user to provide clustering information. This information includes the local cluster file where the clustering data is to be stored. The user is permitted to enter some generic description for their reference. In addition, an optional threshold value for clustering can be specified by the user. Note that this wizard page checks to ensure that the cluster file does not exist, yet.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  javax.swing.JButton browse
          The browse button to be enabled the user to choose the directory where the file is to be stored.
private static java.lang.String CLU_INFO
          A simple text message that is displayed to the user when the user selects the CLU analyzer.
private  javax.swing.JTextField clusterFile
          Field to read/display the install path where the MST file will be saved after it is generated on the server.
private  javax.swing.JTextArea description
          A brief description about the cluster file.
private  javax.swing.JLabel[] infoLabels
          This array contains three informational labels containing the information in THRESHOLD_INFO, TWO_PASS_INFO, and CLU_INFO respectively in that order.
private static java.lang.String INVALID_CLR_MSG
          A generic informational message that is displayed to the user if the selected MST file is invalid.
private static long serialVersionUID
          A serialization UID to keep the compiler happy.
private  javax.swing.JSpinner threshold
          The spinner for setting the threshold.
private static java.lang.String THRESHOLD_INFO
          A generic informational message that provides additional information on the significance of the threshold value.
private static java.lang.String TWO_PASS_INFO
          A simple text message that is displayed to the user when the user selects the two-passed D2 configuration.
private  JobWizard wizard
          A reference to the wizard dialog that logically owns this page.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ClusterWizardPage(JobWizard wizard)
          The constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Method to handle clicking of "Browse" button.
private  javax.swing.JComponent createClusterFileBox()
          Helper method to create the cluster file entry dialog box along with a "Browse" button.
private  javax.swing.JPanel createNotesPanel()
          Helper method to create a panel with multiple informational notes in them.
private  javax.swing.JPanel createOthers()
          Helper method to create the description and threshold controls.
protected  MSTClusterData getClusterEntry(java.lang.String id, java.lang.String mstID, JobSummary summary)
          Helper method to create a MSTCluster data.
 void pageChanged(WizardDialog dialog, int currPage, int prevPage)
          This method is called just before this page is to be displayed.
 boolean pageChanging(WizardDialog dialog, int currPage, int nextPage)
          This method validates the cluster file set for in this page.
 
Methods inherited from class org.peace_tools.generic.GenericWizardPage
getPage, getSubTitle, getTitle, setTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

wizard

private final JobWizard wizard
A reference to the wizard dialog that logically owns this page. This reference is used to enable and disable buttons on this wizard appropriately.


clusterFile

private javax.swing.JTextField clusterFile
Field to read/display the install path where the MST file will be saved after it is generated on the server.


browse

private javax.swing.JButton browse
The browse button to be enabled the user to choose the directory where the file is to be stored.


threshold

private javax.swing.JSpinner threshold
The spinner for setting the threshold.


description

private javax.swing.JTextArea description
A brief description about the cluster file. This information is meaningful only to the user.


INVALID_CLR_MSG

private static final java.lang.String INVALID_CLR_MSG
A generic informational message that is displayed to the user if the selected MST file is invalid.

See Also:
Constant Field Values

infoLabels

private javax.swing.JLabel[] infoLabels
This array contains three informational labels containing the information in THRESHOLD_INFO, TWO_PASS_INFO, and CLU_INFO respectively in that order. The labels are created in createNotesPanel() method and are suitably displayed by the pageChanged(WizardDialog, int, int) method.


THRESHOLD_INFO

private static final java.lang.String THRESHOLD_INFO
A generic informational message that provides additional information on the significance of the threshold value.

See Also:
Constant Field Values

TWO_PASS_INFO

private static final java.lang.String TWO_PASS_INFO
A simple text message that is displayed to the user when the user selects the two-passed D2 configuration. The text is present to ensure that the user is clear about the operations being performed. The text is used in the pageChanged(WizardDialog, int, int) method.

See Also:
Constant Field Values

CLU_INFO

private static final java.lang.String CLU_INFO
A simple text message that is displayed to the user when the user selects the CLU analyzer. The text is present to ensure that the user is clear about the operations being performed. The text is used in the pageChanged(WizardDialog, int, int) method.

See Also:
Constant Field Values

serialVersionUID

private static final long serialVersionUID
A serialization UID to keep the compiler happy.

See Also:
Constant Field Values
Constructor Detail

ClusterWizardPage

public ClusterWizardPage(JobWizard wizard)
The constructor. The constructor sets up the various components on this wizard page. The components include: a text box and button to specify the cluster file (this file must not yet exist as we are going to generate it from the job), a text area for job description, and a JSpinner for the threshold value.

Parameters:
wizard - The wizard that logically owns this page.
Method Detail

createClusterFileBox

private javax.swing.JComponent createClusterFileBox()
Helper method to create the cluster file entry dialog box along with a "Browse" button. This method is invoked only once from the constructor. This method was introduced just to streamline the code in the constructor

Returns:
A component containing the cluster file entry text box along with informational labels.

createOthers

private javax.swing.JPanel createOthers()
Helper method to create the description and threshold controls. This method is invoked only once from the constructor. This method was introduced just to streamline the code in the constructor

Returns:
The sub-panel to which the controls are added.

createNotesPanel

private javax.swing.JPanel createNotesPanel()
Helper method to create a panel with multiple informational notes in them. This method is invoked from the createOthers() method to create a single panel with multiple, mutually exclusive informational notes (or JLabels) in them. Only one note is visible at any given time. The choice of the visible note is made based on the analyzer being currently used. The appropriate note is made visible when this wizard page is displayed by the pageChanged(WizardDialog, int, int) method.

Returns:
A JPanel containing the various optional notes to be displayed to the user.

pageChanged

public void pageChanged(WizardDialog dialog,
                        int currPage,
                        int prevPage)
This method is called just before this page is to be displayed. This method provides the user with a default cluster file name based on the MST file name specified by the user.

Specified by:
pageChanged in interface WizardPage
Overrides:
pageChanged in class GenericWizardPage
Parameters:
dialog - The wizard dialog that is invoking this method.
currPage - The logical (zero-based) index of the current page in the sequence of pages in the wizard that is going to be displayed.
prevPage - The logical (zero-based) index of the previous page that was displayed. For the first page this value is -1.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Method to handle clicking of "Browse" button. This method essentially enables and disables the various inputs depending on the check box.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

pageChanging

public boolean pageChanging(WizardDialog dialog,
                            int currPage,
                            int nextPage)
This method validates the cluster file set for in this page. This method is invoked just before the user navigates to the adjacent page. This method checks to ensure that the cluster file is valid before user navigates to the next page.

Specified by:
pageChanging in interface WizardPage
Overrides:
pageChanging in class GenericWizardPage
Parameters:
dialog - The wizard dialog that is invoking this method.
currPage - The logical (zero-based) index of the current page in the sequence of pages in the wizard.
nextPage - The logical (zero-based) index of the next page that is going to be displayed.
Returns:
This method always returns true to indicate that the user can navigate off from this page.

getClusterEntry

protected MSTClusterData getClusterEntry(java.lang.String id,
                                         java.lang.String mstID,
                                         JobSummary summary)
Helper method to create a MSTCluster data. This method is used by the JobWizard to create a complete MSTCluster data entry.

Parameters:
id - The workspace-wide unique ID to be set for this cluster file entry.
mstID - The ID associated with the MST data file that was used to generate this cluster.
summary - The summary of the job that is going to be used to create this cluster file.
Returns:
The cluster file entry to be added to the workspace.