public class Concentration extends JApplet
JPanel
,
JFrame
,
Container
,
Serialized FormModifier and Type | Class and Description |
---|---|
protected class |
Concentration.GamePanel
Playing area for the Concentration game.
|
protected class |
Concentration.ImageInstance
Instance of a BufferedImage for use with the game.
|
protected class |
Concentration.secondPanel
Panel for displaying diagnostic listings when debugLevel greater than 0.
|
protected class |
Concentration.Tile
These are the individual squares for the game.
|
JApplet.AccessibleJApplet
Applet.AccessibleApplet
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
appletMode
True if class is called as a JApplet.
|
protected int |
cellMargin
Distance between cells in pixels.
|
protected int |
cellWidth
Length of height and width of cell in pixels.
|
(package private) Container |
contentPane
Main panel for the game.
|
(package private) JFrame |
debugFrame
Optional frame for displaying diagnostic information.
|
protected int |
debugLevel
Controls amount of diagnostic output.
|
protected Concentration.secondPanel |
debugPanel
Panel containing text area with debugging information.
|
protected int |
firstShowing
Index in tileList of first tile displaying picture.
|
protected Concentration |
game
Object containing the game panel.
|
(package private) Concentration.GamePanel |
gamePanel
Panel containing the actual game.
|
(package private) BufferedImage |
image1 |
(package private) BufferedImage |
image2 |
(package private) Vector<Concentration.ImageInstance> |
imageList
Vector object containing the images to be placed on the tiles.
|
protected String |
imageListString
String containing the list of images.
|
protected String |
imageListUrl
URL name to be used to obtain the list of image URL's.
|
protected URL |
imageRoot
Root of directory or URL containing images.
|
private static int |
latestCounter
This is the latest id number to be used with one of the tiles.
|
(package private) GridLayout |
layout |
protected Container |
mainPanel
Not sure if this is still used.
|
protected int |
numberRemaining
Number of tiles remaining that have yet to be matched
|
protected int |
numberShowing
Number of tiles currently displaying picture.
|
protected int |
secondShowing
Index in tileList of second tile displaying picture.
|
private static long |
serialVersionUID
Provided for compliance with Serializable interface.
|
(package private) Concentration.Tile[] |
tileList
Array of the tiles on the game panel.
|
protected int |
tilesHeight
Number of tiles vertically.
|
protected int |
tilesWidth
Number of tiles horizontally.
|
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Concentration() |
Concentration(int width,
int height)
Constructor .
|
Modifier and Type | Method and Description |
---|---|
protected BufferedImage |
buildTestImage(int value)
Construct a dummy image.
|
int |
getDebugLevel()
Getter for debugLevel.
|
String[][] |
getParameterInfo() |
void |
init()
Executed when being called as applet.
|
protected void |
logMessage(String message)
Displays messages if debugLevel is greater
than 0.
|
void |
setAppletMode(boolean value)
Setter for applietMode.
|
void |
setDebugLevel(int value)
Setter for debugLevel.
|
protected void |
sleeper(int length)
Causes thread for a number of milliseconds
|
void |
stop()
Remove the debugging window if debugLevel was greater than 0.
|
protected void |
tempRead1(String item)
Processes an image.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Concentration.GamePanel gamePanel
It is divided into tiles.
Container contentPane
The value is set by the init()
method to
the content panel of the main widow for the applet.
The {link #gamePanel} panel is part of the content
pane.
JFrame debugFrame
This frame only appears if the Debug parameter for the applet is set to a value greater than zero.
boolean appletMode
If the class is called as a standalone application, the value is set to false.
setAppletMode(boolean)
private static final long serialVersionUID
protected Concentration.secondPanel debugPanel
private static int latestCounter
protected int debugLevel
If the value is greater than zero, the
debugFrame
is created as a second
window on the display to show the
diagnostic messages.
setDebugLevel(int)
,
getDebugLevel()
protected Concentration game
This panel contains all of the individual tiles.
Vector<Concentration.ImageInstance> imageList
Concentration.Tile[] tileList
protected int tilesWidth
protected int tilesHeight
protected int cellWidth
protected int cellMargin
protected int numberRemaining
protected String imageListUrl
protected String imageListString
GridLayout layout
protected int numberShowing
protected int firstShowing
protected int secondShowing
BufferedImage image1
BufferedImage image2
public Concentration(int width, int height)
public Concentration()
public void setAppletMode(boolean value)
value
- Value to be used for appletModepublic void setDebugLevel(int value)
value
- Value to be used for debugLeveldebugLevel
public int getDebugLevel()
debugLevel
protected void logMessage(String message)
message
- debugLevel
,
debugFrame
protected void sleeper(int length)
length
- Time to wait in millisecondspublic String[][] getParameterInfo()
getParameterInfo
in class Applet
protected BufferedImage buildTestImage(int value)
value
- public void stop()