public interface Drawing extends SelectionHandler, FigureChangeListener, DrawingChangeListenerHandler
Modifier and Type | Method and Description |
---|---|
Figure |
add(Figure figure)
Adds a figure and sets its container to refer to this drawing.
|
Figure |
findFigure(int x,
int y)
Find and return the figure covering position (x,y).
|
java.util.Iterator<Figure> |
iterator()
Return an iterator over drawing's contents.
|
void |
lock()
Acquires a lock on the list of figures in this drawing.
|
Figure |
remove(Figure figure)
Removes a figure.
|
void |
requestUpdate()
Request update: force a "repaint" event to all associated listeners on this
drawing
|
void |
unlock()
Releases the drawing lock.
|
addToSelection, clearSelection, removeFromSelection, selection, toggleSelection
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate
addDrawingChangeListener, removeDrawingChangeListener
Figure add(Figure figure)
figure
- the figure to addFigure remove(Figure figure)
figure
- the figure to removejava.util.Iterator<Figure> iterator()
Figure findFigure(int x, int y)
x
- X coordinatey
- Y coordinatevoid requestUpdate()
void lock()
void unlock()
From the book: Flexible, Reliable Software, © CRC Press 2010. Author: Henrik B. Christensen, Aarhus University, Denmark