public abstract class CanvasPane extends java.lang.Object implements EventAcceptor, CanvasComponent
Yellow |
Constructor and Description |
---|
CanvasPane() |
Modifier and Type | Method and Description |
---|---|
protected void |
_initNewLayer(CanvasLayer l)
Helper method to initialize a layer when it is added to this
pane.
|
protected void |
_nullifyLayer(CanvasLayer l)
Helper method to tell a layer when it is been removed from
this pane.
|
void |
dispatchEvent(java.awt.AWTEvent event)
Dispatch an AWT event on this pane.
|
JCanvas |
getCanvas()
Get the containing canvas, or null if there isn't one.
|
CanvasComponent |
getParent()
Get the parent component, or null if there isn't one.
|
java.awt.geom.Point2D |
getSize()
Get the size of this pane, in logical coordinates.
|
protected java.lang.String |
getToolTipText(LayerEvent event)
Get the toolTipText for the point in the given LayerEvent.
|
TransformContext |
getTransformContext()
Return the transform context of this pane.
|
boolean |
isAntialiasing()
Return whether or not this pane is antialiased
|
boolean |
isEnabled()
Test the enabled flag of this pane.
|
java.util.Iterator |
layers()
Return an iteration of the layers, in undefined order.
|
abstract java.util.Iterator |
layersFromBack()
Return an iteration of the layers from back to front --
that is, in redraw order.
|
abstract java.util.Iterator |
layersFromFront()
Return an iteration of the layers from front to back --
that is, in event-processing order.
|
void |
paint(java.awt.Graphics2D g)
Paint this pane onto a 2D graphics context.
|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
Paint this pane onto a 2D graphics object, within the given
region.
|
protected void |
processLayerEvent(LayerEvent event)
Process a layer event that has occurred on this pane.
|
void |
repaint()
Schedule a repaint of this pane.
|
void |
repaint(DamageRegion d)
Accept notification that a repaint has occurred somewhere
in this pane.
|
void |
scale(double xcenter,
double ycenter,
double xscale,
double yscale)
Scale this pane the given amount.
|
void |
setAntialiasing(boolean val)
Set whether or not to use antialiasing
when drawing this pane.
|
void |
setCanvas(JCanvas canvas)
Set the containing canvas of this pane.
|
void |
setEnabled(boolean flag)
Set the enabled flag of this pane.
|
void |
setParent(CanvasComponent parent)
Set the parent component of this pane.
|
void |
setSize(double width,
double height)
Set the size of this pane, in logical coordinates.
|
void |
setSize(java.awt.geom.Point2D size)
Set the size of this pane, in logical coordinates.
|
void |
setTransform(java.awt.geom.AffineTransform at)
Set the transform that maps logical coordinates into the
parent's coordinates.
|
void |
translate(double x,
double y)
Translate this pane the given distance.
|
public void dispatchEvent(java.awt.AWTEvent event)
dispatchEvent
in interface EventAcceptor
public final CanvasComponent getParent()
getParent
in interface CanvasComponent
public final JCanvas getCanvas()
public final boolean isAntialiasing()
protected java.lang.String getToolTipText(LayerEvent event)
public final TransformContext getTransformContext()
getTransformContext
in interface CanvasComponent
public java.awt.geom.Point2D getSize()
public final boolean isEnabled()
isEnabled
in interface EventAcceptor
public java.util.Iterator layers()
public abstract java.util.Iterator layersFromBack()
public abstract java.util.Iterator layersFromFront()
public void paint(java.awt.Graphics2D g)
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D region)
protected void processLayerEvent(LayerEvent event)
public void repaint()
repaint
in interface CanvasComponent
public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
d
- The region where a repaint has occurred.public void setAntialiasing(boolean val)
public final void setCanvas(JCanvas canvas)
public final void setEnabled(boolean flag)
setEnabled
in interface EventAcceptor
public final void setParent(CanvasComponent parent)
public void setSize(double width, double height)
public void setSize(java.awt.geom.Point2D size)
public final void setTransform(java.awt.geom.AffineTransform at)
public void translate(double x, double y)
public void scale(double xcenter, double ycenter, double xscale, double yscale)
protected void _initNewLayer(CanvasLayer l)
protected void _nullifyLayer(CanvasLayer l)