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. 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.

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

Field Summary
static int ALL_AVAILABLE
          Flag used to indicate all available selection behaviors
static int DELETE
          Flag used to indicate selection deletion
static int MODIFY
          Flag used to indicate selection modification
static int MOVE
          Flag used to indicate selection movement
static int RESIZE
          Flag used to indicate selection resizing
static int SCALE
          Flag used to indicate selection keyboard scaling
 
Constructor Summary
ZCompositeSelectionHandler(ZNode node, ZCamera camera, ZCanvas canvas, ZLayerGroup marqueeLayer)
          Creates a composite selection handler with all available selection event handler types enabled.
ZCompositeSelectionHandler(ZNode node, ZCamera camera, ZCanvas canvas, ZLayerGroup marqueeLayer, int flags)
          Creates a composite selection handler with the specified enabled selection event handler types.
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
 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

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
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,
                                  ZCamera camera,
                                  ZCanvas canvas,
                                  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

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

ZCompositeSelectionHandler

public ZCompositeSelectionHandler(ZNode node,
                                  ZCamera camera,
                                  ZCanvas canvas,
                                  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 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


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