public class GraphicsPane extends CanvasPane
(front) Foreground event Overlay Foreground graphics Background graphics Background eventThis organization allows applications to easily overlay and underlay graphics and event handling around the main application window.
Typical uses of each of these layers include:
Modifier and Type | Field and Description |
---|---|
protected EventLayer |
_backgroundEventLayer |
protected CanvasLayer |
_backgroundLayer |
protected EventLayer |
_foregroundEventLayer |
protected FigureLayer |
_foregroundLayer |
protected CanvasLayer[] |
_layers |
protected OverlayLayer |
_overlayLayer |
Constructor and Description |
---|
GraphicsPane()
Create a new Graphics pane with an instance of
FigureLayer as the main figure layer.
|
GraphicsPane(FigureLayer foregroundLayer)
Create a new Graphics pane with the passed Layer
as the main graphics pane.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_rebuildLayerArray()
Rebuild the array of layers for use by iterators.
|
EventLayer |
getBackgroundEventLayer()
Get the background event layer.
|
CanvasLayer |
getBackgroundLayer()
Get the background layer.
|
EventLayer |
getForegroundEventLayer()
Get the foreground event layer.
|
FigureLayer |
getForegroundLayer()
Get the foreground layer.
|
OverlayLayer |
getOverlayLayer()
Get the overlay layer.
|
java.util.Iterator |
layersFromBack()
Return an iteration of the layers, in redraw order (that is,
from back to front).
|
java.util.Iterator |
layersFromFront()
Return an iteration of the layers, in event-processing order
(that is, from front to back).
|
void |
setBackgroundEventLayer(EventLayer l)
Set the background event layer.
|
void |
setBackgroundLayer(CanvasLayer l)
Set the background figure layer.
|
void |
setForegroundEventLayer(EventLayer l)
Set the foreground event layer.
|
void |
setForegroundLayer(FigureLayer l)
Set the foreground figure layer.
|
void |
setOverlayLayer(OverlayLayer l)
Set the overlay layer.
|
_initNewLayer, _nullifyLayer, dispatchEvent, getCanvas, getParent, getSize, getToolTipText, getTransformContext, isAntialiasing, isEnabled, layers, paint, paint, processLayerEvent, repaint, repaint, scale, setAntialiasing, setCanvas, setEnabled, setParent, setSize, setSize, setTransform, translate
protected CanvasLayer[] _layers
protected EventLayer _foregroundEventLayer
protected OverlayLayer _overlayLayer
protected FigureLayer _foregroundLayer
protected CanvasLayer _backgroundLayer
protected EventLayer _backgroundEventLayer
public GraphicsPane()
public GraphicsPane(FigureLayer foregroundLayer)
foregroundLayer
- The foreground layerpublic EventLayer getBackgroundEventLayer()
setBackgroundEventLayer(EventLayer)
public CanvasLayer getBackgroundLayer()
setBackgroundLayer(CanvasLayer)
public FigureLayer getForegroundLayer()
setForegroundLayer(FigureLayer)
public OverlayLayer getOverlayLayer()
setOverlayLayer(OverlayLayer)
public EventLayer getForegroundEventLayer()
setForegroundEventLayer(EventLayer)
public java.util.Iterator layersFromFront()
layersFromFront
in class CanvasPane
public java.util.Iterator layersFromBack()
layersFromBack
in class CanvasPane
public void setBackgroundEventLayer(EventLayer l)
l
- The layer.getBackgroundEventLayer()
public void setBackgroundLayer(CanvasLayer l)
l
- The layer.getBackgroundLayer()
public void setForegroundLayer(FigureLayer l)
l
- The layer.getForegroundLayer()
public void setOverlayLayer(OverlayLayer l)
l
- The layer.getOverlayLayer()
public void setForegroundEventLayer(EventLayer l)
l
- The layer.getForegroundEventLayer()
protected void _rebuildLayerArray()