bill.apps.wordsearch
Class PlayTab

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--bill.apps.wordsearch.PlayTab
All Implemented Interfaces:
Accessible, ActionListener, EventListener, ImageObserver, MenuContainer, MouseListener, Serializable

public class PlayTab
extends JPanel
implements ActionListener, MouseListener

This class represents the tab that allows the user to play a game of word search.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent
 
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
PlayTab(WordSearchGUI parent)
           
 
Method Summary
 void actionPerformed(ActionEvent actionEvent)
          This is the "callback" method for menu actions.
 void displayHighlighting(boolean display)
          Turns required field highlighting on or off for this frame.
 void displayToolTips(boolean display)
          Turns tool tips on or off for this frame.
 WordSearchGUI getParentGUI()
          Retrieves the Word Search GUI that this tab sits on.
 WordSearchDNDLabel getSource()
          Retrieve the label that is the current drag and drop source.
 WordSearchDNDLabel getTarget()
          Retrieve the label that is the current drag and drop target.
 Vector getWords()
          Retrieves the Vector of Vector of words the user is making.
 void mouseClicked(MouseEvent event)
          Called when the user releases a mouse button on a registered component.
 void mouseEntered(MouseEvent event)
          Called when the user's mouse cursor enters the area of a registered component.
 void mouseExited(MouseEvent event)
          Called when the user's mouse cursor exits the area of a registered component.
 void mousePressed(MouseEvent event)
          Called when the user presses down a mouse button on a registered component.
 void mouseReleased(MouseEvent event)
          Called when the user releases a mouse button on a registered component.
 void setSource(WordSearchDNDLabel source)
          Set the label that is the current drag and drop source.
 void setTarget(WordSearchDNDLabel target)
          Set the label that is the current drag and drop target.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlayTab

public PlayTab(WordSearchGUI parent)
Method Detail

getTarget

public WordSearchDNDLabel getTarget()
Retrieve the label that is the current drag and drop target.
Returns:
The DnD target label.

setTarget

public void setTarget(WordSearchDNDLabel target)
Set the label that is the current drag and drop target.

getSource

public WordSearchDNDLabel getSource()
Retrieve the label that is the current drag and drop source.
Returns:
The DnD source label.

setSource

public void setSource(WordSearchDNDLabel source)
Set the label that is the current drag and drop source.

getWords

public Vector getWords()
Retrieves the Vector of Vector of words the user is making.
Returns:
The words the user is making.

getParentGUI

public WordSearchGUI getParentGUI()
Retrieves the Word Search GUI that this tab sits on.
Returns:
The Word Search GUI.

displayToolTips

public void displayToolTips(boolean display)
Turns tool tips on or off for this frame.
Parameters:
display - Indicates if tool tips should be displayed, true indicates to display them, false indicates to not display them.

displayHighlighting

public void displayHighlighting(boolean display)
Turns required field highlighting on or off for this frame.
Parameters:
display - Indicates if highlighting should be performed, true indicates to perform it, false indicates to not perform it.

actionPerformed

public void actionPerformed(ActionEvent actionEvent)
This is the "callback" method for menu actions. When the user selects a menu option, this method is invoked to process the menu item.
Specified by:
actionPerformed in interface ActionListener
Parameters:
actionEvent - The event the user performed.

mouseClicked

public void mouseClicked(MouseEvent event)
Called when the user releases a mouse button on a registered component. We have registered the letter labels for this purpose. We do not care about release events so the method is empty.
Specified by:
mouseClicked in interface MouseListener
Parameters:
event - The mouse event that caused this method to be called.

mouseEntered

public void mouseEntered(MouseEvent event)
Called when the user's mouse cursor enters the area of a registered component. We have registered the letter labels for this purpose. We do not care about entry events so the method is empty.
Specified by:
mouseEntered in interface MouseListener
Parameters:
event - The mouse event that caused this method to be called.

mouseExited

public void mouseExited(MouseEvent event)
Called when the user's mouse cursor exits the area of a registered component. We have registered the letter labels for this purpose. We do not care about entry events so the method is empty.
Specified by:
mouseExited in interface MouseListener
Parameters:
event - The mouse event that caused this method to be called.

mousePressed

public void mousePressed(MouseEvent event)
Called when the user presses down a mouse button on a registered component. We have registered the letter labels for this purpose. If the label has a letter on it (verses a 'blank'), than we move it to the first blank in the other row of letters. For example, if I right click on a letter in the 'words' section, it will be moved down to the first 'blank' spot in the available letters list. Conversely, if I right click on a letter in the available letters list, it will be moved to the first 'blank' spot in the words list. Right clicking on a 'blank' letter has no effect. Right clicking on an available letter when all the 'word' letters are non blank has no effect either.
Specified by:
mousePressed in interface MouseListener
Parameters:
event - The mouse event that caused this method to be called.

mouseReleased

public void mouseReleased(MouseEvent event)
Called when the user releases a mouse button on a registered component. We have registered the letter labels for this purpose. We do not care about release events so the method is empty.
Specified by:
mouseReleased in interface MouseListener
Parameters:
event - The mouse event that caused this method to be called.