|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Canvas ch.aplu.jgamegrid.GameGrid ch.aplu.jcardgame.CardGame
public class CardGame
A specialized GameGrid class used for card games.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ch.aplu.jgamegrid.GameGrid |
---|
GameGrid.ClosingMode |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class ch.aplu.jgamegrid.GameGrid |
---|
AskOnClose, bgColor, bgImagePath, bgImagePosX, bgImagePosY, BLACK, BLUE, cellSize, CYAN, DARKGRAY, DisposeOnClose, GRAY, GREEN, gridColor, LIGHTGRAY, MAGENTA, monitor, nbHorzCells, nbRotSprites, nbVertCells, NothingOnClose, PINK, RED, simulationPeriod, TerminateOnClose, TRANSPARENT, WHITE, YELLOW |
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 | |
---|---|
CardGame()
Constructs the game playground with 10 by 10 cells (60 pixels wide). |
|
CardGame(int width,
int height)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod) with bgColor = RGB(20, 80, 0) (dark green), simulationPeriod = 30 and statusHeight = 0 (no status bar). |
|
CardGame(int width,
int height,
java.awt.Color bgColor)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod) with simulationPeriod = 30 and statusHeight = 0 (no status bar). |
|
CardGame(int width,
int height,
java.awt.Color bgColor,
int statusHeight,
int simulationPeriod)
Constructs and shows a game grid window with the given horizontal and vertical pixel size (cell size = 1, no navigation bar). |
|
CardGame(int width,
int height,
int statusHeight)
Same as CardGame(width, height, bgColor, statusHeight, simulationPeriod) with bgColor = RGB(20, 80, 0) (dark green), simulationPeriod = 30. |
Method Summary |
---|
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CardGame()
CardGame cg = new CardGame();
cg.setCellSize(1);
cg.setNbHorzCells(600);
cg.setNbVertCells(600);
cg.setSimulationPeriod(30);
cg.setBgColor(new Color(20, 80, 0));
cg.doRun();
public CardGame(int width, int height)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowpublic CardGame(int width, int height, int statusHeight)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowstatusHeight
- the height of the status bar in pixels; if less or
equal zero, no status bar is displayedpublic CardGame(int width, int height, java.awt.Color bgColor)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowbgColor
- the background color of the game grid windowpublic CardGame(int width, int height, java.awt.Color bgColor, int statusHeight, int simulationPeriod)
width
- the horizontal pixel size of the game grid windowheight
- the vertical pixel size of the game grid windowbgColor
- the background color of the game grid windowstatusHeight
- the height of the status bar in pixels; if less or
equal zero, no status bar is displayedsimulationPeriod
- the simulation period used for the simulation cycling
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |