Package Painting
Class ShapeStack
java.lang.Object
Painting.ShapeStack
public class ShapeStack
extends java.lang.Object
implement a stack of shapes using ArrayList
- Author:
- Itay Finci
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ShapeStack()make empty stack -
Method Summary
-
Field Details
-
Constructor Details
-
ShapeStack
public ShapeStack()make empty stack
-
-
Method Details
-
insert
inset shape to the end of the list- Parameters:
shape- the shape to be inserted
-
pop
remove the last shape (the most recently added)- Returns:
- the shape that was removed
-
clear
public void clear()remove all of the shapes from the stack -
drawStack
public void drawStack(java.awt.Graphics g)draw the shapes from the stack- Parameters:
g- the graphics manager
-