venice
Class VCompositeSelectionHandler

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

public class VCompositeSelectionHandler
extends java.lang.Object
implements edu.umd.cs.jazz.event.ZEventHandler, java.io.Serializable

VCompositeSelectionHandler is a convenience class that allows applications to use a single event handler to manage the multiple jazz selection event handlers. Class is derived from ZCompositeSelectionHandler. Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

THIS IS A MODIFIED VERSION OF ZCOMPOSITESELECTIONHANDLER FROM JAZZ CODE!

Author:
Lance Good, modified by Antti Pietarinen
See Also:
Serialized Form

Field Summary
private  boolean active
          true when event handler is active
static int ALL_AVAILABLE
          Flag used to indicate all available selection behaviors
private  edu.umd.cs.jazz.ZCamera camera
          non-null only if this event handler is active on a single camera
private  edu.umd.cs.jazz.util.ZCanvas canvas
          canvas this event handler attaches to
static int DELETE
          Flag used to indicate selection deletion
private  edu.umd.cs.jazz.event.ZSelectionDeleteHandler deleteHandler
          Selection delete handler
private  int enabledFlag
          The current enabled event handlers
private  boolean globallyActive
          true if this event handler is active on all cameras
private  edu.umd.cs.jazz.ZLayerGroup layer
          Marquee layer
static int MODIFY
          Flag used to indicate selection modification
private  VSelectionModifyHandler modifyHandler
          Selection modify handler
static int MOVE
          Flag used to indicate selection movement
private  edu.umd.cs.jazz.event.ZSelectionMoveHandler moveHandler
          Selection move handler
private  edu.umd.cs.jazz.ZNode node
          node this event handler attaches to
static int RESIZE
          Flag used to indicate selection resizing
private  edu.umd.cs.jazz.event.ZSelectionResizeHandler resizeHandler
          Selection resize handler
static int SCALE
          Flag used to indicate selection keyboard scaling
private  edu.umd.cs.jazz.event.ZSelectionScaleHandler scaleHandler
          Selection scale handler
 
Constructor Summary
VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node, edu.umd.cs.jazz.ZCamera camera, edu.umd.cs.jazz.util.ZCanvas canvas, edu.umd.cs.jazz.ZLayerGroup marqueeLayer)
          Creates a composite selection handler with all available selection event handler types enabled.
VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node, edu.umd.cs.jazz.ZCamera camera, edu.umd.cs.jazz.util.ZCanvas canvas, edu.umd.cs.jazz.ZLayerGroup marqueeLayer, int flags)
          Creates a composite selection handler with the specified enabled selection event handler types.
VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node, edu.umd.cs.jazz.util.ZCanvas canvas, edu.umd.cs.jazz.ZLayerGroup marqueeLayer)
          Creates a composite selection handler with all available selection event handler types enabled.
VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node, edu.umd.cs.jazz.util.ZCanvas canvas, edu.umd.cs.jazz.ZLayerGroup marqueeLayer, int flags)
          Creates a composite selection handler with the specified enabled selection event handler types.
 
Method Summary
 edu.umd.cs.jazz.ZLayerGroup getMarqueeLayer()
           
 edu.umd.cs.jazz.event.ZSelectionDeleteHandler getSelectionDeleteHandler()
          This method returns the current selection delete handler if ZCompositeSelectionHandler.DELETE is enabled.
 VSelectionModifyHandler getSelectionModifyHandler()
          This method returns the current selection modify handler if ZCompositeSelectionHandler.MODIFY is enabled.
 edu.umd.cs.jazz.event.ZSelectionMoveHandler getSelectionMoveHandler()
          This method returns the current selection move handler if ZCompositeSelectionHandler.MOVE is enabled.
 edu.umd.cs.jazz.event.ZSelectionResizeHandler getSelectionResizeHandler()
          This method returns the current selection resize handler if ZCompositeSelectionHandler.RESIZE is enabled.
 edu.umd.cs.jazz.event.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(edu.umd.cs.jazz.ZLayerGroup layer)
          Sets the marquee layer for this event handler
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

MODIFY

public static final int MODIFY
Flag used to indicate selection modification

MOVE

public static final int MOVE
Flag used to indicate selection movement

SCALE

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

DELETE

public static final int DELETE
Flag used to indicate selection deletion

RESIZE

public static final int RESIZE
Flag used to indicate selection resizing

ALL_AVAILABLE

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

enabledFlag

private int enabledFlag
The current enabled event handlers

active

private boolean active
true when event handler is active

globallyActive

private boolean globallyActive
true if this event handler is active on all cameras

node

private edu.umd.cs.jazz.ZNode node
node this event handler attaches to

camera

private edu.umd.cs.jazz.ZCamera camera
non-null only if this event handler is active on a single camera

canvas

private edu.umd.cs.jazz.util.ZCanvas canvas
canvas this event handler attaches to

layer

private edu.umd.cs.jazz.ZLayerGroup layer
Marquee layer

modifyHandler

private VSelectionModifyHandler modifyHandler
Selection modify handler

moveHandler

private edu.umd.cs.jazz.event.ZSelectionMoveHandler moveHandler
Selection move handler

scaleHandler

private edu.umd.cs.jazz.event.ZSelectionScaleHandler scaleHandler
Selection scale handler

deleteHandler

private edu.umd.cs.jazz.event.ZSelectionDeleteHandler deleteHandler
Selection delete handler

resizeHandler

private edu.umd.cs.jazz.event.ZSelectionResizeHandler resizeHandler
Selection resize handler
Constructor Detail

VCompositeSelectionHandler

public VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node,
                                  edu.umd.cs.jazz.util.ZCanvas canvas,
                                  edu.umd.cs.jazz.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

VCompositeSelectionHandler

public VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node,
                                  edu.umd.cs.jazz.ZCamera camera,
                                  edu.umd.cs.jazz.util.ZCanvas canvas,
                                  edu.umd.cs.jazz.ZLayerGroup marqueeLayer)
Creates a composite selection handler with all available selection event handler types enabled. This event handler will operate only on the specified camera.
Parameters:
node - The node to which this event hander attaches
camera - The camera on which this event handler operates
canvas - The canvas for which this event handler is active
marqueeLayer - The layer on which marquee selection is drawn

VCompositeSelectionHandler

public VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node,
                                  edu.umd.cs.jazz.util.ZCanvas canvas,
                                  edu.umd.cs.jazz.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

VCompositeSelectionHandler

public VCompositeSelectionHandler(edu.umd.cs.jazz.ZNode node,
                                  edu.umd.cs.jazz.ZCamera camera,
                                  edu.umd.cs.jazz.util.ZCanvas canvas,
                                  edu.umd.cs.jazz.ZLayerGroup marqueeLayer,
                                  int flags)
Creates a composite selection handler with the specified enabled selection event handler types. This event handler will operate only on the specified camera. 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
camera - The camera on which this event handler operates
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 edu.umd.cs.jazz.event.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 edu.umd.cs.jazz.event.ZEventHandler
Returns:
True if active

getMarqueeLayer

public edu.umd.cs.jazz.ZLayerGroup getMarqueeLayer()
Returns:
The current marquee layer

setMarqueeLayer

public void setMarqueeLayer(edu.umd.cs.jazz.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 VSelectionModifyHandler 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 edu.umd.cs.jazz.event.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 edu.umd.cs.jazz.event.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 edu.umd.cs.jazz.event.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 edu.umd.cs.jazz.event.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