|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.CanvasPane
public abstract class CanvasPane
A canvas pane groups canvas layers. The layers all share the same logical-to-screen transform as the canvas pane. This is an abstract superclass of all canvas panes, and provides the implementation of everything related to panes but the storage of the layers. Subclasses must provide methods to add and (possibly) reorder and remove layers. Particular applications may choose to create their own special-purpose sub-classes.
Yellow |
Field Summary | |
---|---|
private boolean |
_antialias
The antialiasing flag. |
private JCanvas |
_canvas
The parent canvas. |
private boolean |
_enabled
The enabled flag. |
private java.awt.geom.Point2D |
_paneSize
The size of this pane, in logical coordinates |
private CanvasComponent |
_parent
The parent component. |
private TransformContext |
_transformContext
The transform context of this pane |
Constructor Summary | |
---|---|
CanvasPane()
|
Method Summary | |
---|---|
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. |
private void |
updateRangeModel()
set the model params for the range models. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private CanvasComponent _parent
private JCanvas _canvas
private boolean _enabled
private boolean _antialias
private java.awt.geom.Point2D _paneSize
private TransformContext _transformContext
Constructor Detail |
---|
public CanvasPane()
Method Detail |
---|
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
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)
private void updateRangeModel()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |