Class Ball


public class Ball
extends ABall
implements Observer
A concrete ABall that uses a shared flyweight to determine its behavior.


Variable Index

 o flyweight

Constructor Index

 o Ball (BallFlyweight, Point, Point)

Method Index

 o getColor ()
 o getRadius ()
 o paint (Graphics)
 o setColor (Color)
 o setRadius (int)
 o update (Observable, Object)

Variables

 o flyweight
private BallFlyweight flyweight

Constructors

 o Ball
public  Ball(BallFlyweight fly, Point p, Point v)

Methods

 o getRadius
public int getRadius()
 o setRadius
public void setRadius(int r)
 o getColor
public Color getColor()
 o setColor
public void setColor(Color c)
 o update
public void update(Observable o, Object g)
 o paint
protected void paint(Graphics g)