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


CONSTRUCTOR INDEX

 O Surface(int, int)
Creates a Surface.

METHOD INDEX

 O draw()
Draws a surface to its destination AWT Component window.
 O finalize()
Called immediately before garbage collection of this object.
 O getColor()
Returns the current default color for a surface.
 O getDestinationWindow()
Returns the destination AWT Component window for a surface.
 O getFPS()
Get current frame rate, in frames per second
 O setBackground(Image)
Assigns a default background image to a surface.
 O setColor(Color)
Assigns a default color to a surface.
 O setColor(Image)
Assigns a default background image to a surface.
 O setDestinationWindow(Component)
Maps a surface to a destination AWT Component window.
 O size()
Returns the size of the surface (width and height)

CONSTRUCTORS

 O 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

METHODS

 O size
  public Dimension size()
Returns the size of the surface (width and height)
Returns:
s Surface dimensions
 O 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
 O 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
 O 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
 O 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
 O 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
 O 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
 O 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
 O 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
 O 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
Free Web Hosting