Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
|
Public Member Functions | |
ShapeSubject () | |
void | addObserver (ShapeObserver observer) |
void | notifyShapeAdded (Shape shape) |
void | notifyShapeModified (Shape shape) |
void | notifyShapeRemoved (Shape shape) |
void | removeObserver (ShapeObserver observer) |
Private Attributes | |
final List< ShapeObserver > | observers |
Subject class for the Observer pattern. This maintains a list of observers and notifies them of changes.
Definition at line 11 of file ShapeSubject.java.
|
inline |
Constructor initializes the observer list
Definition at line 17 of file ShapeSubject.java.
References observers.
|
inline |
Add an observer to be notified of changes
observer | the observer to add |
Definition at line 25 of file ShapeSubject.java.
References observers.
|
inline |
Notify all observers that a shape was added
shape | the shape that was added |
Definition at line 43 of file ShapeSubject.java.
References observers.
|
inline |
Notify all observers that a shape was modified
shape | the shape that was modified |
Definition at line 63 of file ShapeSubject.java.
References observers.
|
inline |
Notify all observers that a shape was removed
shape | the shape that was removed |
Definition at line 53 of file ShapeSubject.java.
References observers.
|
inline |
Remove an observer from the notification list
observer | the observer to remove |
Definition at line 35 of file ShapeSubject.java.
References observers.
|
private |
Definition at line 12 of file ShapeSubject.java.
Referenced by ShapeSubject(), addObserver(), notifyShapeAdded(), notifyShapeModified(), notifyShapeRemoved(), and removeObserver().