|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.CanvasLayer
diva.canvas.event.EventLayer
public class EventLayer
An event layer is a canvas layer that accepts mouse events. It is designed to be layered over or under other layers, such as FigureLayer, and accepts a number of options that control whether it consumes events and so on. Event layers can have event listeners attached to them, which will be notified when events occur.
Sample uses of the event layer
Field Summary | |
---|---|
private boolean |
_consuming
The consuming flag. |
private Interactor |
_currentInteractor
The current interactor |
private boolean |
_enabled
The enabled flag. |
private java.util.ArrayList<Interactor> |
_interactors
The list of attached interactors |
private LayerListener |
layerListener
The layer listeners |
private LayerMotionListener |
layerMotionListener
The layer motion listeners |
Constructor Summary | |
---|---|
EventLayer()
|
Method Summary | |
---|---|
void |
addInteractor(Interactor i)
Add an interactor to this interactor. |
void |
addLayerListener(LayerListener l)
Add the given layer listener to this dispatcher. |
void |
addLayerMotionListener(LayerMotionListener l)
Add the given layer motion listener to this dispatcher. |
void |
dispatchEvent(java.awt.AWTEvent event)
Dispatch an AWT event on this layer. |
java.util.Iterator |
interactors()
Return an interactor over the attached interactors. |
boolean |
isConsuming()
Test the consuming flag of this layer. |
boolean |
isEnabled()
Test the enabled flag of this layer. |
protected void |
processLayerEvent(LayerEvent event)
Process a layer event. |
void |
removeInteractor(Interactor i)
Remove the given interactor from this interactor. |
void |
removeLayerListener(LayerListener l)
Remove the given layer listener from this dispatcher. |
void |
removeLayerMotionListener(LayerMotionListener l)
Remove the given layer motion listener from this dispatcher. |
void |
setConsuming(boolean flag)
Set the consuming flag of this layer. |
void |
setEnabled(boolean flag)
Set the enabled flag of this layer. |
Methods inherited from class diva.canvas.CanvasLayer |
---|
getCanvasPane, getLayerBounds, getParent, getToolTipText, getTransformContext, repaint, repaint, setParent |
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, repaint |
Field Detail |
---|
private boolean _enabled
private boolean _consuming
private Interactor _currentInteractor
private java.util.ArrayList<Interactor> _interactors
private transient LayerListener layerListener
private transient LayerMotionListener layerMotionListener
Constructor Detail |
---|
public EventLayer()
Method Detail |
---|
public void addInteractor(Interactor i)
public void addLayerListener(LayerListener l)
public void addLayerMotionListener(LayerMotionListener l)
public void dispatchEvent(java.awt.AWTEvent event)
dispatchEvent
in interface EventAcceptor
public java.util.Iterator interactors()
public boolean isConsuming()
public boolean isEnabled()
isEnabled
in interface EventAcceptor
protected void processLayerEvent(LayerEvent event)
public void removeInteractor(Interactor i)
public void removeLayerListener(LayerListener l)
public void removeLayerMotionListener(LayerMotionListener l)
public void setConsuming(boolean flag)
public void setEnabled(boolean flag)
setEnabled
in interface EventAcceptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |