|
||||||||
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 Animation2D
public class Animation2D
Animation2D uses classes developed in last week's Transform2DTest project to confirm the applicability of Matrix-defined transformations to simple animations. Note: Add Path to Transform2DTest folder in Classes Tab of your JDK Profile. The Space Invaders Tutorial at http://www.planetalia.com/cursos/Java-Invaders/JAVA-INVADERS-11.tutorial was useful.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Canvas |
---|
java.awt.Canvas.AccessibleAWTCanvas |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static double |
domain
assists in converting cartesian coordinates to screen coordinates |
static int |
HEIGHT
The height of the Canvas |
static double |
maxX
Cartesian parameters: domain, range, minX, maxX, minY, maxY |
static double |
maxY
|
static double |
minX
|
static double |
minY
|
static double |
range
assists in converting Cartesian coordinates to Screen coordinates |
static int |
SPEED
SPEED controls the delay of the utility Thread |
static Sprite |
sprite
an instance of the Sprite class to be animated |
java.awt.image.BufferStrategy |
strategy
Specialized class to support double buffering |
static int |
WIDTH
The width of the Canvas |
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, PROPERTIES, SOMEBITS |
Constructor Summary | |
---|---|
Animation2D()
Single constructor (supplied) |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
Instantiates an animation object,a sprite with some meaningful set of points and then calls the run method. |
void |
paintPanel()
Creates a BufferedImage object, obtains its Graphics2D drawing context, and goes to work drawing to the image. |
void |
run()
Sequencer to organize calls and prove an animation speed. |
int |
scrX(double x)
Converts Cartesian x-coordinate to relative Screen x-coordinate |
int |
scrY(double y)
Converts Cartesian y-coordinate to relative Screen y-coordinate |
void |
updateScene()
updateScene prepares and applies the matrix transform(s) to the Sprite object |
Methods inherited from class java.awt.Canvas |
---|
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint, 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, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, 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, hide, 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, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, 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, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int WIDTH
public static final int HEIGHT
public static final int SPEED
public java.awt.image.BufferStrategy strategy
public static double maxX
public static double minX
public static double maxY
public static double minY
public static double domain
public static double range
public static Sprite sprite
Constructor Detail |
---|
public Animation2D()
Method Detail |
---|
public void updateScene()
public int scrX(double x)
public int scrY(double y)
public void paintPanel()
public void run()
public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |