Some outside agent might change the Color object that color
refers to,
and the Circle
object would now have a different color.
This might not be wanted.
Here is an applet that tests the new features. It draws ten circles in red and ten circles in blue. The red circles are moved slightly to the left, and the blue circles are moved slightly to the right.
// assume that the drawing area is 200 by 200 public class TestCircleRedBlue extends Applet { Circle circ = new Circle(); public void paint ( Graphics gr ) { int count = 1; while ( count <= 10 ) { circ.setRadius( (100/10)*count ); circ.setColor( Color.red ); circ.setPosition( 100-count/2, 100 ); circ.draw( gr ); circ.setColor( Color.blue ); circ.setPosition( 100+count/2, 100 ); circ.draw( gr ); count = count + 1; } } }
Here is what the applet draws.