org.peace_tools.core.job
Class HeuristicsWizardPage

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.HeuristicsWizardPage
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 HeuristicsWizardPage
extends GenericWizardPage
implements java.awt.event.ActionListener

This class serves as an interactive page in a JobWizard. This page permits the user to provide the information about the frame/word analyzer to be used to computing distance/similarity metric between two given ESTs. The distance/similarity metric is used to decide if two ESTs must be clustered together.

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  AnalyzerWizardPage awp
          A reference to the analyzer wizard page from where the the frame size set for the analyzer is obtained and used to seed the frame size for the t/v heuristic.
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.JCheckBox enableTV
          Check box to indicate if the t/v heuristic is to be used for this job.
private  javax.swing.JCheckBox enableUV
          Check box to indicate if the u/v sample heuristic is to be used for this job.
private  javax.swing.JPanel heuristicPanel
          This panel actually contains all the controls for setting up the necessary heuristics and their parameters required by certain analyzers.
private static java.lang.String INFO_MSG
          A generic informational message that is displayed at the top of this wizard page to provide some additional information to the user.
private static long serialVersionUID
          A serialization UID to keep the compiler happy.
private  javax.swing.JSpinner[] tvParams
          The array of two configuration parameter values for the t/v heuristic.
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 static java.lang.String UV_INFO_MSG
          A generic informational message that is displayed to the user to provide information about the u/v heuristic.
private  javax.swing.JSpinner[] uvParams
          The array of three configuration values for the u/v heuristic.
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
HeuristicsWizardPage(JobWizard wizard, AnalyzerWizardPage awp)
          The constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Method to handle clicking of check boxes.
private  javax.swing.JPanel adjustCheckBox(javax.swing.JCheckBox cb, java.lang.String cmd)
          Helper method to correctly format, enhance, and layout a given check box.
private  javax.swing.JPanel createTvPanels()
          This is a helper method that is used to create the necessary information regarding the t/v heuristic.
private  javax.swing.JPanel createUvPanels()
          This is a helper method that is used to create the necessary information regarding the u/v heuristic.
protected  java.util.ArrayList<Heuristic> getHeuristics()
          This method is a convenience method that can be used to obtain a HeuristicList object containing information from this page.
protected  java.lang.String getHeuristicsSummary()
          This method is a convenience method that can be used to obtain a String summarizing the heuristic setup for this job.
 void pageChanged(WizardDialog dialog, int currPage, int prevPage)
          This method is called just before this page is to be displayed.
 
Methods inherited from class org.peace_tools.generic.GenericWizardPage
getPage, getSubTitle, getTitle, pageChanging, 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

heuristicPanel

private final javax.swing.JPanel heuristicPanel
This panel actually contains all the controls for setting up the necessary heuristics and their parameters required by certain analyzers. Some of the analyzers currently do not permit setting or modifications of heuristics. In this case this panel is not displayed to the user. Instead a simple message indicating that there are no heuristics to be configured is displayed to the user.


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.


awp

private final AnalyzerWizardPage awp
A reference to the analyzer wizard page from where the the frame size set for the analyzer is obtained and used to seed the frame size for the t/v heuristic.


enableUV

private javax.swing.JCheckBox enableUV
Check box to indicate if the u/v sample heuristic is to be used for this job.


enableTV

private javax.swing.JCheckBox enableTV
Check box to indicate if the t/v heuristic is to be used for this job. Note that t/v heuristic needs u/v heuristic to be enabled.


uvParams

private javax.swing.JSpinner[] uvParams
The array of three configuration values for the u/v heuristic. The first entry is v (the length of common words to search for), the second entry is u (number of v-word matches) and word shift (number of words to shift by)


tvParams

private javax.swing.JSpinner[] tvParams
The array of two configuration parameter values for the t/v heuristic. The first entry is frame size (it is fixed based on frame size of analyzer), the second entry is t (number of v-word matches).


INFO_MSG

private static final java.lang.String INFO_MSG
A generic informational message that is displayed at the top of this wizard page to provide some additional information to the user.

See Also:
Constant Field Values

UV_INFO_MSG

private static final java.lang.String UV_INFO_MSG
A generic informational message that is displayed to the user to provide information about the u/v heuristic.

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

HeuristicsWizardPage

public HeuristicsWizardPage(JobWizard wizard,
                            AnalyzerWizardPage awp)
The constructor. The constructor sets up the various components on this wizard page. The components include: combo box to select the frame/word analyzer to be used, spinners for window and word size, the type of cache and size of cache to be used.

Parameters:
wizard - The wizard that logically owns this page.
awp - The analyzer wizard page from where the frame size for t/v heuristic is obtained.
Method Detail

adjustCheckBox

private javax.swing.JPanel adjustCheckBox(javax.swing.JCheckBox cb,
                                          java.lang.String cmd)
Helper method to correctly format, enhance, and layout a given check box.

Parameters:
cb - The check box to be formatted.
cmd - The action command to be set.
Returns:
A JPanel containing the check box with additional decorations.

createUvPanels

private javax.swing.JPanel createUvPanels()
This is a helper method that is used to create the necessary information regarding the u/v heuristic.


createTvPanels

private javax.swing.JPanel createTvPanels()
This is a helper method that is used to create the necessary information regarding the t/v heuristic.

Returns:
A panel to which the text controls have been added.

actionPerformed

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

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

pageChanged

public void pageChanged(WizardDialog dialog,
                        int currPage,
                        int prevPage)
This method is called just before this page is to be displayed. This page essentially updates the frame size for the t/v heuristic from the data provided by the analyzer wizard page. In addition, the heuristic sub-panel is hidden (or displayed) if the heuristic is TwoPassD2 or CLU indicating that these analyzers configure their own heuristics.

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.

getHeuristics

protected java.util.ArrayList<Heuristic> getHeuristics()
This method is a convenience method that can be used to obtain a HeuristicList object containing information from this page. This method is used by the JobWizard to compose a complete set of entries once the wizard has successfully completed.

Returns:
A HeuristicList object containing the necessary information about the heuristics configured by the user.

getHeuristicsSummary

protected java.lang.String getHeuristicsSummary()
This method is a convenience method that can be used to obtain a String summarizing the heuristic setup for this job. This method is used by the JobWizard to compose a complete set of summary information just before the job is submitted.

Returns:
A String containing a summary information of the various heuristics configured for this run by the user.