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 |
---|---|
protected int |
cellMargin
Distance between cells in pixels.
|
protected int |
cellWidth
Length of height and width of cell in pixels.
|
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.
|
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.
|
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.
|
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()
Default constructor.
|
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
protected Concentration.secondPanel debugPanel
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.
protected int tilesWidth
protected int tilesHeight
protected int cellWidth
protected int cellMargin
protected int numberRemaining
protected String imageListUrl
protected String imageListString
protected int numberShowing
protected int firstShowing
protected int secondShowing
public Concentration(int width, int height)
width
- number of tiles per rowheight
- number of rowspublic 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
- Message to be included in error windowdebugLevel
,
debugFrame
protected void sleeper(int length)
length
- Time to wait in millisecondspublic String[][] getParameterInfo()
getParameterInfo
in class Applet
protected BufferedImage buildTestImage(int value)
value
- number to go in cellpublic void stop()
Copyright © 2017. All rights reserved.