|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--nl.bluering.ppracing.Paperview
This class provides the visuals for the racing-board It renders the circuit to a Graphics object, and adds the cars and their movement to it.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
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 | |
Paperview(Circuit c,
Ppracing p)
Creates a new Canvas for viewing the board |
Method Summary | |
void |
cursor(boolean b)
Sets wether or not the cursor should be drawn |
void |
drawcar()
Draws the cars of all players to the graphics object provided to paint(Graphics g) |
void |
drawcircle(int x,
int y,
java.awt.Color c)
Draws a circle on the given location with the given color |
void |
drawcursor()
Draws the cursor of the current player onto the Graphics object |
void |
drawline(int x1,
int y1,
int x2,
int y2,
java.awt.Color c)
Draws a line on the given coordinates with the given color |
void |
fillcircle(int x,
int y,
java.awt.Color c)
Draws a filled circle on the given location with the given color |
void |
paint(java.awt.Graphics g)
Paints the circuit and the cars to the given Graphics object |
void |
rebuffer()
Buffers the current image, for faster painting. |
void |
update(java.awt.Graphics g)
Overrules the default update function, thus reducing flickering |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Paperview(Circuit c, Ppracing p)
c
- The circuit to be usedp
- The parental appletMethod Detail |
public void rebuffer()
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public final void update(java.awt.Graphics g)
update
in class java.awt.Component
public void cursor(boolean b)
public void drawcar()
public void drawcursor()
public void drawcircle(int x, int y, java.awt.Color c)
x
- Horizontal locationy
- Vertical locationc
- Color of the circlepublic void fillcircle(int x, int y, java.awt.Color c)
x
- Horizontal locationy
- Vertical locationc
- Color of the circlepublic void drawline(int x1, int y1, int x2, int y2, java.awt.Color c)
x1
- Horizontal start locationy1
- Vertical start locationx2
- Horizontal end locationy2
- Vertical end locationc
- Color of the line
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |