All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class benno.asg.Scene

java.lang.Object
   |
   +----java.awt.Component
           |
           +----benno.asg.Scene

public class Scene
extends Component
This class represents a scene in my autostereogram generator. A Scene contains a number of Surfaces, representing the physical objects in the scene space. It has a ColourScheme to provide the particular colour pattern. A Scene is a component and renders itself when painted. To use: create a new Scene; add Surfaces to it; optionally set a ColourScheme; add to a container; cause to be painted.

Version:
$Revision: 1.3 $
Author:
Ben Clifford
See Also:
Surface, ColourScheme

Constructor Index

 o Scene(int, int)
This creates a new scene, with no surfaces.

Method Index

 o add(Surface)
an accessor method for Vector surfaces
 o getMaximumSize()
overrides Component.
 o getMinimumSize()
overrides Component.
 o getPreferredSize()
overrides Component.
 o paint(Graphics)
Paints the object onto the supplied Graphics context.
 o setColourScheme(ColourScheme)
accessor method

Constructors

 o Scene
 public Scene(int w,
              int h)
This creates a new scene, with no surfaces. By default it has a ColourScheme of benno.asg.colourschemes.Dotty. Eyes are placed 3cm to the left and right of the origin, half a metre back from the screen.

Parameters:
w - The width of the component
h - The height of the component
See Also:
Dotty

Methods

 o getMinimumSize
 public Dimension getMinimumSize()
overrides Component.

Returns:
the Dimension object D
Overrides:
getMinimumSize in class Component
 o getMaximumSize
 public Dimension getMaximumSize()
overrides Component.

Returns:
the Dimension object D
Overrides:
getMaximumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
overrides Component.

Returns:
the Dimension object D
Overrides:
getPreferredSize in class Component
 o add
 public void add(Surface s)
an accessor method for Vector surfaces

Parameters:
s - The surface to be added into the scene.
 o setColourScheme
 public void setColourScheme(ColourScheme c)
accessor method

Parameters:
c - The new ColourScheme
 o paint
 public void paint(Graphics g)
Paints the object onto the supplied Graphics context. This method handles the rendering of the scene.

Overrides:
paint in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index