edu.umd.cs.jazz.event
Class ZCompositeSelectionHandler

java.lang.Object
  |
  +--edu.umd.cs.jazz.event.ZCompositeSelectionHandler
All Implemented Interfaces:
java.io.Serializable, ZEventHandler

public class ZCompositeSelectionHandler
extends java.lang.Object
implements ZEventHandler, java.io.Serializable

ZCompositeSelectionHandler is a convenience class that allows applications to use a single event handler to manage the multiple jazz selection event handlers.

Author:
Lance Good
See Also:
ZSelectionManager, ZSelectionModifyHandler, ZSelectionMoveHandler, ZSelectionDeleteHandler, ZSelectionScaleHandler, ZSelectionResizeHandler, Serialized Form

Field Summary
protected  boolean active
          true when event handler is active
static int ALL_AVAILABLE
          Flag used to indicate all available selection behaviors
protected  ZCanvas canvas
          canvas this event handler attaches to
static int DELETE
          Flag used to indicate selection deletion
protected  ZLayerGroup layer
          Marquee layer
static int MODIFY
          Flag used to indicate selection modification
static int MOVE
          Flag used to indicate selection movement
protected  ZNode node
          node this event handler attaches to
static int RESIZE
          Flag used to indicate selection resizing
static int SCALE
          Flag used to indicate selection keyboard scaling
 
Constructor Summary
ZCompositeSelectionHandler(ZNode node, ZCanvas canvas, ZLayerGroup marqueeLayer)
          Creates a composite selection handler with all available selection event handler types enabled.
ZCompositeSelectionHandler(ZNode node, ZCanvas canvas, ZLayerGroup marqueeLayer, int flags)
          Creates a composite selection handler with the specified enabled selection event handler types.
 
Method Summary
protected  ZSelectionDeleteHandler createSelectionDeleteHandler()
           
protected  ZSelectionModifyHandler createSelectionModifyHandler()
           
protected  ZSelectionMoveHandler createSelectionMoveHandler()
           
protected  ZSelectionResizeHandler createSelectionResizeHandler()
           
protected  ZSelectionScaleHandler createSelectionScaleHandler()
           
 ZLayerGroup getMarqueeLayer()
           
 ZSelectionDeleteHandler getSelectionDeleteHandler()
          This method returns the current selection delete handler if ZCompositeSelectionHandler.DELETE is enabled.
 ZSelectionModifyHandler getSelectionModifyHandler()
          This method returns the current selection modify handler if ZCompositeSelectionHandler.MODIFY is enabled.
 ZSelectionMoveHandler getSelectionMoveHandler()
          This method returns the current selection move handler if ZCompositeSelectionHandler.MOVE is enabled.
 ZSelectionResizeHandler getSelectionResizeHandler()
          This method returns the current selection resize handler if ZCompositeSelectionHandler.RESIZE is enabled.
 ZSelectionScaleHandler getSelectionScaleHandler()
          This method returns the current selection scale handler if ZCompositeSelectionHandler.SCALE is enabled.
 boolean isActive()
          Determines if this event handler is active.
 void setActive(boolean active)
          Specifies whether this event handler is active
 void setEnabled(int flags, boolean enable)
          Sets whether the specified event handlers are enabled.
 void setMarqueeLayer(ZLayerGroup layer)
          Sets the marquee layer for this event handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODIFY

public static final int MODIFY
Flag used to indicate selection modification

See Also:
Constant Field Values

MOVE

public static final int MOVE
Flag used to indicate selection movement

See Also:
Constant Field Values

SCALE

public static final int SCALE
Flag used to indicate selection keyboard scaling

See Also:
Constant Field Values

DELETE

public static final int DELETE
Flag used to indicate selection deletion

See Also:
Constant Field Values

RESIZE

public static final int RESIZE
Flag used to indicate selection resizing

See Also:
Constant Field Values

ALL_AVAILABLE

public static final int ALL_AVAILABLE
Flag used to indicate all available selection behaviors

See Also:
Constant Field Values

active

protected boolean active
true when event handler is active


node

protected ZNode node
node this event handler attaches to


canvas

protected ZCanvas canvas
canvas this event handler attaches to


layer

protected ZLayerGroup layer
Marquee layer

Constructor Detail

ZCompositeSelectionHandler

public ZCompositeSelectionHandler(ZNode node,
                                  ZCanvas canvas,
                                  ZLayerGroup marqueeLayer)
Creates a composite selection handler with all available selection event handler types enabled. This event handler will operate across all cameras.

Parameters:
node - The node to which this event hander attaches
canvas - The canvas for which this event handler is active
marqueeLayer - The layer on which marquee selection is drawn

ZCompositeSelectionHandler

public ZCompositeSelectionHandler(ZNode node,
                                  ZCanvas canvas,
                                  ZLayerGroup marqueeLayer,
                                  int flags)
Creates a composite selection handler with the specified enabled selection event handler types. This event handler will operate across all cameras. Possible values for flags include boolean combinations of MOVE, MODIFY, SCALE, DELETE, and ALL_AVAILABLE.

Parameters:
node - The node to which this event hander attaches
canvas - The canvas for which this event handler is active
marqueeLayer - The layer on which marquee selection is drawn
flags - The event handlers to enable
Method Detail

setActive

public void setActive(boolean active)
Specifies whether this event handler is active

Specified by:
setActive in interface ZEventHandler
Parameters:
active - True to make this event handler active

isActive

public boolean isActive()
Determines if this event handler is active.

Specified by:
isActive in interface ZEventHandler
Returns:
True if active

getMarqueeLayer

public ZLayerGroup getMarqueeLayer()
Returns:
The current marquee layer

setMarqueeLayer

public void setMarqueeLayer(ZLayerGroup layer)
Sets the marquee layer for this event handler

Parameters:
layer - The new marquee layer

setEnabled

public void setEnabled(int flags,
                       boolean enable)
Sets whether the specified event handlers are enabled. Possible values for flags include boolean combinations of MOVE, MODIFY, SCALE, DELETE, and ALL_AVAILABLE.

Parameters:
flags - The event handlers to enable or disable
enable - Should the specified event handlers be enabled or disabled

getSelectionModifyHandler

public ZSelectionModifyHandler getSelectionModifyHandler()
This method returns the current selection modify handler if ZCompositeSelectionHandler.MODIFY is enabled. Otherwise it returns null.

Returns:
The selection modify handler associated with this event handler

getSelectionMoveHandler

public ZSelectionMoveHandler getSelectionMoveHandler()
This method returns the current selection move handler if ZCompositeSelectionHandler.MOVE is enabled. Otherwise it returns null.

Returns:
The selection move handler associated with this event handler

getSelectionScaleHandler

public ZSelectionScaleHandler getSelectionScaleHandler()
This method returns the current selection scale handler if ZCompositeSelectionHandler.SCALE is enabled. Otherwise it returns null.

Returns:
The selection scale handler associated with this event handler

getSelectionDeleteHandler

public ZSelectionDeleteHandler getSelectionDeleteHandler()
This method returns the current selection delete handler if ZCompositeSelectionHandler.DELETE is enabled. Otherwise it returns null.

Returns:
The selection delete handler associated with this event handler

getSelectionResizeHandler

public ZSelectionResizeHandler getSelectionResizeHandler()
This method returns the current selection resize handler if ZCompositeSelectionHandler.RESIZE is enabled. Otherwise it returns null.

Returns:
The selection delete handler associated with this event handler

createSelectionMoveHandler

protected ZSelectionMoveHandler createSelectionMoveHandler()
Returns:
a new instance of a ZSelectionMoveHandler

createSelectionResizeHandler

protected ZSelectionResizeHandler createSelectionResizeHandler()
Returns:
a new instance of a ZSelectionResizeHandler

createSelectionModifyHandler

protected ZSelectionModifyHandler createSelectionModifyHandler()
Returns:
a new instance of a ZSelectionModifyHandler

createSelectionScaleHandler

protected ZSelectionScaleHandler createSelectionScaleHandler()
Returns:
a new instance of a ZSelectionScaleHandler

createSelectionDeleteHandler

protected ZSelectionDeleteHandler createSelectionDeleteHandler()
Returns:
a new instance of a ZSelectionDeleteHandler


Copyright 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.