Class anim.Surface
All Packages Class Hierarchy This Package Previous Next Index
Class anim.Surface
java.lang.Object
|
+----anim.Surface
- public class Surface
- extends Object
A surface that keeps track of Sprites. A surface may also be
associated with a destination Component which allows its
Sprites to be drawn on the screen.
Copyright (c) 1996-1997 Intel Corporation
-
Surface(int, int)
- Creates a Surface.
-
draw()
- Draws a surface to its destination AWT Component window.
-
finalize()
- Called immediately before garbage collection of this object.
-
getColor()
- Returns the current default color for a surface.
-
getDestinationWindow()
- Returns the destination AWT Component window for a surface.
-
getFPS()
- Get current frame rate, in frames per second
-
setBackground(Image)
- Assigns a default background image to a surface.
-
setColor(Color)
- Assigns a default color to a surface.
-
setColor(Image)
- Assigns a default background image to a surface.
-
setDestinationWindow(Component)
- Maps a surface to a destination AWT Component window.
-
size()
- Returns the size of the surface (width and height)
Surface
public Surface(int width,
int height)
- Creates a Surface.
- Parameters:
- width - -- width of the surface. If this is negative, it is set to 0
- height - -- height of the surface. If this is negative, it is set to 0
size
public Dimension size()
- Returns the size of the surface (width and height)
- Returns:
- s Surface dimensions
finalize
protected void finalize() throws Throwable
- Called immediately before garbage collection of this object.
- Throws: Throwable
- Never thrown. See Object.finalize for further information.
- Overrides:
- finalize in class Object
setDestinationWindow
public void setDestinationWindow(Component c)
- Maps a surface to a destination AWT Component window.
To display the surface in the Component, call draw.
- Parameters:
- c - The Component on which to draw the Surface.
- See Also:
- getDestinationWindow, draw
getDestinationWindow
public Component getDestinationWindow()
- Returns the destination AWT Component window for a surface.
- Returns:
- s The Component the surface is mapped to. Null if surface is not mapped to component.
- See Also:
- setDestinationWindow
setBackground
public synchronized void setBackground(Image bgIm)
- Assigns a default background image to a surface.
This overrides the background color.
- Parameters:
- bgIm - is the Image
setColor
public synchronized void setColor(Image bgIm)
- Assigns a default background image to a surface.
This overrides the background color.
- Parameters:
- bgIm - is the Image
setColor
public synchronized void setColor(Color c)
- Assigns a default color to a surface.
The default color is displayed in a pixel location that is not occupied by displayable data.
- Parameters:
- c - either null (to clear any existing default color) or the new default color (must be between 0 and 255 when using RGB_CLUT8 style color).
- See Also:
- getColor
getColor
public Color getColor()
- Returns the current default color for a surface.
The default color is displayed in a pixel location that is not occupied by displayable data.
- Returns:
- s The default color, null if default color has not been set.
- See Also:
- setColor
draw
public synchronized boolean draw()
- Draws a surface to its destination AWT Component window.
- Returns:
- false if draw failed, true otherwise.
RA need to document failure conditions
getFPS
public double getFPS()
- Get current frame rate, in frames per second
- Returns:
- current frame rate, in frames per second
All Packages Class Hierarchy This Package Previous Next Index