Class ShapeSlider
ShapeSlider
- public class ShapeSlider
Constructor Summary |
ShapeSlider(java.util.Map pMap)
Create a new ShapeSlider, given a property Map that defines various
aspects of the shape and the sliding. |
Method Summary |
void |
addTo(GWindow w)
Add the shape to the window |
void |
doAction(Stage stage)
Every time the clock ticks, this method is called to perform an action. |
void |
removeFromWindow()
Remove the shape from its window |
ShapeSlider
public ShapeSlider(java.util.Map pMap)
- Create a new ShapeSlider, given a property Map that defines various
aspects of the shape and the sliding. A shape is one of the standard
shapes from the UWCSE graphics library (e.g., a Rectangle, Oval,
Triangle, or Line.)
The following key words and values are implemented for use in the
property file that defines each ShapeSlider.
- class = ShapeSlider. Required.
- shape = oval or rectangle or triangle or line. The shape of the shape.
- cornerX = int. X value of upper left corner of the shape.
- cornerY = int. Y value of upper left corner of the shape.
- width = int. Width of the shape.
- height = int. Height of the shape.
- deltaX = int. Number of X pixels that the shape moves every tick of the clock.
- deltaY = int. Number of Y pixels that the shape moves every tick of the clock.
- color = red or blue or green. Color of the shape.
- Parameters:
pMap
- the property Map that defines the specific characteristics
of this ShapeSlider.
addTo
public void addTo(GWindow w)
- Add the shape to the window
- Parameters:
w
- the window that we are using for this animation
doAction
public void doAction(Stage stage)
- Every time the clock ticks, this method is called to perform an action.
In our case the action is to slide around the screen.
- Parameters:
stage
- the stage on which we are performing.
removeFromWindow
public void removeFromWindow()
- Remove the shape from its window
Generated by BlueJ