I have two questions about java.awt.Shape
. Suppose I have two Shape
s, shape1
and shape2
.
How can I serialize them in some way so I can save the information to a file and later recreate it on another computer? (
Shape
is notSerializable
but it does have thegetPathIterator()
method which seems like you could get the information out but it would be kind of a drag + I'm not sure how to reconstruct aShape
object afterwards.)How can I combine them into a new Shape so that they form a joint boundary? (e.g. if shape1 is a large square and shape2 is a small circle inside the square, I want the combined shape to be a large square with a small circular hole)