|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GraphicsContainer<G extends Graphic>
Holds a collection of graphics to be drawn in a canvas.
The GraphicsContainer implementation typically depends on the canvas implementation. For example an AWT
canvas may be associated to a GraphicsContainer using a Graphics2D handler for drawing,
while a SWT canvas may be associated to an other GraphicsContainer implementation using a different
drawing toolkit.
Graphics can be added or removed with
method invocations on the collection returned by graphics(), which is a "live" collection.
Note that a GraphicsContainer instance may restrict the acceptable graphic implementations.
| Method Summary | |
|---|---|
void |
addContainerListener(ContainerListener listener)
Adds a listener to be notified when a graphic is added or removed. |
void |
dispose()
Provides a hint that a GraphicsContainer is no longer needed. |
Canvas |
getCanvas()
Returns the canvas where this GraphicsContainer will drawn the graphics. |
Envelope |
getGraphicsEnvelope()
|
Collection<G> |
graphics()
Returns the collection of all graphics. |
void |
removeContainerListener(ContainerListener listener)
Removes a listener. |
| Method Detail |
|---|
Canvas getCanvas()
Envelope getGraphicsEnvelope()
Collection<G> graphics()
When new graphics are added, implementations shall respect
the z-order retrieved by calling Graphic#getZOrderHint(). When two
added graphics have the same z-order, the most recently added one should be
on top.
void addContainerListener(ContainerListener listener)
listener - The listener to add.void removeContainerListener(ContainerListener listener)
listener - The listener to remove.void dispose()
It is an error to reference a GraphicsContainer in any way after its dispose method has been
called.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||