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
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 |
PlayTab
public PlayTab(WordSearchGUI parent)
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.