|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.PaneWrapper
public class PaneWrapper
A figure that wraps a whole canvas pane. This class is thus one of the ways in which a canvas pane can be nested within other canvas panes. It can be given a figure that is drawn as the background or outline of the pane. Once an instance of this class has been created, the wrapped pane cannot be changed.
In order to pass events down into the contained pane, the PaneWrapper implements EventAccepter. It forwards events to the internal pane.
Red |
Field Summary | |
---|---|
private Figure |
_background
The background figure |
private boolean |
_clipEnabled
The flag saying whether to clip. |
private CanvasPane |
_wrappedPane
The contained pane. |
Constructor Summary | |
---|---|
PaneWrapper(CanvasPane pane)
Create a new pane figure with the given pane. |
Method Summary | |
---|---|
void |
dispatchEvent(java.awt.AWTEvent event)
Dispatch an AWT event on this pane figure. |
Figure |
getBackground()
Get the background figure. |
java.awt.Shape |
getShape()
Get the shape of this figure. |
CanvasPane |
getWrappedPane()
Get the wrapped pane |
boolean |
isClipEnabled()
Get the clipping enabled flag. |
boolean |
isEnabled()
Test the enabled flag of the wrapped pane. |
void |
paint(java.awt.Graphics2D g)
Paint the pane figure. |
void |
paint(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D region)
Paint the pane figure within the given region. |
protected void |
processLayerEvent(LayerEvent event)
Process a layer event. |
void |
repaint(DamageRegion d)
Accept notification that a repaint has occurred in the wrapped pane. |
void |
setBackground(Figure background)
Set the background figure. |
void |
setClipEnabled(boolean flag)
Set the clipping enabled flag. |
void |
setEnabled(boolean flag)
Set the enabled flag of the wrapped pane. |
void |
setTransform(java.awt.geom.AffineTransform at)
Set the transform of the internal pane, relative to the external one. |
void |
transform(java.awt.geom.AffineTransform at)
Transform the figure with the supplied transform. |
void |
translate(double x,
double y)
Translate this pane wrapper the given distance. |
Methods inherited from class diva.canvas.AbstractFigure |
---|
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface diva.canvas.CanvasComponent |
---|
getParent, getTransformContext, repaint |
Field Detail |
---|
private boolean _clipEnabled
private CanvasPane _wrappedPane
private Figure _background
Constructor Detail |
---|
public PaneWrapper(CanvasPane pane)
Method Detail |
---|
public void dispatchEvent(java.awt.AWTEvent event)
dispatchEvent
in interface EventAcceptor
public Figure getBackground()
public java.awt.Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public CanvasPane getWrappedPane()
public boolean isClipEnabled()
public boolean isEnabled()
isEnabled
in interface EventAcceptor
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D region)
paint
in interface VisibleComponent
paint
in class AbstractFigure
protected void processLayerEvent(LayerEvent event)
Currently, this methods also implements a simple technique to manage event-handling between the "inner" and "outer" panes. If this PaneWrapper has a selection interactor, and it is in the selection, then don't process the event. This means that the outer pane gets to handle all events if the wrapper has already been selected.
public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
repaint
in class AbstractFigure
public void setBackground(Figure background)
public void setClipEnabled(boolean flag)
public void setEnabled(boolean flag)
setEnabled
in interface EventAcceptor
public void setTransform(java.awt.geom.AffineTransform at)
public void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |