|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Panel
|
+--java.applet.Applet
|
+--javax.swing.JApplet
|
+--com.amoebacode.blackjack.Blackjack
Blackjack is the main blackjack program that can be run as an applet or as an application.
| Inner classes inherited from class javax.swing.JApplet |
javax.swing.JApplet.AccessibleJApplet |
| Inner classes inherited from class java.applet.Applet |
java.applet.Applet.AccessibleApplet |
| Inner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
| Field Summary | |
private static java.lang.String |
APPLICATION_TITLE_BAR
The title bar text used when the program is run as an application |
private static java.lang.String |
BACKGROUND_IMAGE
The path to the primary background image |
private static java.lang.String |
BLANK_CARD_PATH
The path to the blank card image (used for the backs of cards) |
private static java.lang.String |
CARD_IMAGE_FILE_PREFIX
The prefix for the relative path to the card image files |
private static java.lang.String |
CARD_IMAGE_FILE_SUFFIX
The suffix for the relative path to the card image file |
private boolean |
isApplication
Indicates whether the program is run as an application |
private static java.lang.String |
JAR
The name of the parameter that indicates whether the applet is being run in a jar file |
| Fields inherited from class javax.swing.JApplet |
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.applet.Applet |
serialVersionUID, stub |
| Fields inherited from class java.awt.Panel |
base, nameCounter |
| Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
| Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Blackjack()
Default public empty constructor. |
|
| Method Summary | |
private DisplayManager |
buildDisplayManager(java.awt.Container container)
Builds and returns the UI manager that is used to display the game. |
private void |
buildGame(java.awt.Container container)
Builds the UI and starts the game. |
private java.util.Map |
buildImages()
Builds and returns a map of image icons used by the game. |
private java.util.Map |
buildSounds()
Builds and returns a map of audio clips used by the game. |
private java.applet.AudioClip |
getAudioClip(java.lang.String audioPath)
Retrieves the audio clip from the specified path. |
private javax.swing.ImageIcon |
getImage(java.lang.String imagePath)
Retrieves the image from the specified path. |
private java.lang.String |
getImagePath(java.lang.String cardName)
Returns the relative path of the image that corresponds to the specified card. |
void |
init()
Initializes the applet. |
private boolean |
isNotJar()
Indicates whether this applet is being run with a jar="false" parameter. |
static void |
main(java.lang.String[] args)
Command line runnable method for running program is an application. |
private void |
setIsApplication(boolean value)
Sets whether the program is being run as an application. |
private void |
startGame(DisplayManager displayManager)
Starts the game using the specified display manager. |
| Methods inherited from class javax.swing.JApplet |
addImpl, createRootPane, createRootPaneException, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.applet.Applet |
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
| Methods inherited from class java.awt.Panel |
|
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paint, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, print, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, readObject, remove, removeAll, removeContainerListener, removeNotify, setFocusOwner, setFont, transferFocus, validate, validateTree, writeObject |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
| Field Detail |
private static final java.lang.String JAR
private static final java.lang.String APPLICATION_TITLE_BAR
private boolean isApplication
private static final java.lang.String CARD_IMAGE_FILE_PREFIX
private static final java.lang.String CARD_IMAGE_FILE_SUFFIX
private static final java.lang.String BLANK_CARD_PATH
private static final java.lang.String BACKGROUND_IMAGE
| Constructor Detail |
public Blackjack()
| Method Detail |
public void init()
init in class java.applet.Appletprivate void buildGame(java.awt.Container container)
container - the content pane for this applet/applicationprivate DisplayManager buildDisplayManager(java.awt.Container container)
container - the content pane for this applet/applicationprivate void startGame(DisplayManager displayManager)
displayManager - the UI manager for the gameprivate javax.swing.ImageIcon getImage(java.lang.String imagePath)
imagePath - the relative path to the imageprivate java.util.Map buildSounds()
private java.util.Map buildImages()
private java.lang.String getImagePath(java.lang.String cardName)
private java.applet.AudioClip getAudioClip(java.lang.String audioPath)
audioPath - the relative path to the audio clipprivate boolean isNotJar()
private void setIsApplication(boolean value)
value - the new isApplication indicatorpublic static void main(java.lang.String[] args)
args - the String array of command line arguments
|
Blackjack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||