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
-
Scene(int, int)
- This creates a new scene, with no surfaces.
-
add(Surface)
- an accessor method for Vector surfaces
-
getMaximumSize()
- overrides Component.
-
getMinimumSize()
- overrides Component.
-
getPreferredSize()
- overrides Component.
-
paint(Graphics)
- Paints the object onto the supplied Graphics context.
-
setColourScheme(ColourScheme)
- accessor method
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
getMinimumSize
public Dimension getMinimumSize()
- overrides Component.
- Returns:
- the Dimension object D
- Overrides:
- getMinimumSize in class Component
getMaximumSize
public Dimension getMaximumSize()
- overrides Component.
- Returns:
- the Dimension object D
- Overrides:
- getMaximumSize in class Component
getPreferredSize
public Dimension getPreferredSize()
- overrides Component.
- Returns:
- the Dimension object D
- Overrides:
- getPreferredSize in class Component
add
public void add(Surface s)
- an accessor method for Vector surfaces
- Parameters:
- s - The surface to be added into the scene.
setColourScheme
public void setColourScheme(ColourScheme c)
- accessor method
- Parameters:
- c - The new ColourScheme
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