undo/redo problems
i finally figured out how im going to go about this undo redo function for my paint program however i have come across a problem.
when i press undo, this code is run:
publicvoid undo()
{
Object o = lines.lastElement();
stack.add(o);
int index = lines.lastIndexOf(o);
lines.remove(index);
repaint();
}
"lines" is a vector containing "AngledLines"(my own class which can create lines, squares and circles etc..
the only way i can store the angledline is as an object.
the redo method:
publicvoid redo()
{
Object o = stack.pop();
lines.add(o);
repaint();
}
now this wont compile because i cant add an object to a vector of "angledlines", is there any way to change that object back into an "AngledLine"?
please help, thanks

