public class PaneWrapper extends AbstractFigure implements EventAcceptor
In order to pass events down into the contained pane, the PaneWrapper implements EventAcceptor. It forwards events to the internal pane.
Constructor and Description |
---|
PaneWrapper(CanvasPane pane)
Create a new pane figure with the given pane.
|
Modifier and Type | Method and Description |
---|---|
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.
|
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParent, getTransformContext, repaint
public PaneWrapper(CanvasPane pane)
pane
- The given panepublic void dispatchEvent(java.awt.AWTEvent event)
dispatchEvent
in interface EventAcceptor
event
- the event.public Figure getBackground()
setBackground(Figure)
public java.awt.Shape getShape()
getShape
in interface Figure
getShape
in class AbstractFigure
public CanvasPane getWrappedPane()
public boolean isClipEnabled()
setClipEnabled(boolean)
public boolean isEnabled()
isEnabled
in interface EventAcceptor
setClipEnabled(boolean)
public void paint(java.awt.Graphics2D g)
paint
in interface VisibleComponent
paint
in class AbstractFigure
g
- The 2D graphics object that this object
it to be painted upon.public void paint(java.awt.Graphics2D g, java.awt.geom.Rectangle2D region)
paint
in interface VisibleComponent
paint
in class AbstractFigure
g
- The 2D graphics object that this object
it to be painted upon.region
- The region.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.
event
- The layer event to be processed.public void repaint(DamageRegion d)
repaint
in interface CanvasComponent
repaint
in class AbstractFigure
d
- The region where a repaint has occurred.public void setBackground(Figure background)
background
- The background figuregetBackground()
public void setClipEnabled(boolean flag)
flag
- The clipping enabled flagisClipEnabled()
public void setEnabled(boolean flag)
setEnabled
in interface EventAcceptor
flag
- True if the object is prepared to handle
events with processEvent();isEnabled()
public void setTransform(java.awt.geom.AffineTransform at)
at
- The affine transformpublic void transform(java.awt.geom.AffineTransform at)
transform
in interface Figure
transform
in class AbstractFigure
at
- The transform to be used.public void translate(double x, double y)
translate
in interface Figure
translate
in class AbstractFigure
x
- The x value to be moved.y
- The y value to be moved.