edu.umd.cs.jazz.event
Class ZSelectionResizeHandler.ResizeEvent

java.lang.Object
  |
  +--edu.umd.cs.jazz.event.ZSelectionResizeHandler.ResizeEvent
Enclosing class:
ZSelectionResizeHandler

public static class ZSelectionResizeHandler.ResizeEvent
extends java.lang.Object

An event to signal that a node has been resized by this event handler. This event provides several scale values to allow for various resizing behaviors other than the default.

The boolean value constrained signals that this resize was considered constrained by the default standard, namely that the shift key was depressed during the resize.

The values returned by getScaleX and getScaleY represent the default scale values based on the value of constrained. The constrained values are provided by the getConstrainScaleX and getConstrainScaleY.

The scale values for no flip scaling are also provided. The term "no flip" does not indicate that the values will always be positive but rather indicates that the point from which the scale is computed remains constant. For example, if the bottom right resize handle is grabbed, the new size will always be computed from the upper right hand corner. In the previous case (ie. when flipping is employed) when the scale becomes negative, it is necessary to change the point from which the new width is computed. This is necessary for resizing in which flipping occurs because of the representation of rectangles. Rectangles can not have negative width or height, hence when the object's scale becomes negative the point from which the new width or height is computed must change, eg. from the x point to the x point plus the width.


Constructor Summary
ZSelectionResizeHandler.ResizeEvent(ZNode node, ZMouseEvent mouseEvent, double xScale, double yScale, double constrainXScale, double constrainYScale, double noFlipXScale, double noFlipYScale, double constrainNoFlipXScale, double constrainNoFlipYScale, double x, double y)
           
 
Method Summary
 double getConstrainScaleX()
           
 double getConstrainScaleY()
           
 ZMouseEvent getMouseEvent()
           
 ZNode getNode()
           
 double getNoFlipConstrainScaleX()
           
 double getNoFlipConstrainScaleY()
           
 double getNoFlipScaleX()
           
 double getNoFlipScaleY()
           
 double getScaleX()
           
 double getScaleY()
           
 double getX()
           
 double getY()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZSelectionResizeHandler.ResizeEvent

public ZSelectionResizeHandler.ResizeEvent(ZNode node,
                                           ZMouseEvent mouseEvent,
                                           double xScale,
                                           double yScale,
                                           double constrainXScale,
                                           double constrainYScale,
                                           double noFlipXScale,
                                           double noFlipYScale,
                                           double constrainNoFlipXScale,
                                           double constrainNoFlipYScale,
                                           double x,
                                           double y)
Parameters:
node - The node that is being resized
mouseEvent - The mouse event that caused the resize
xScale - The percentage of the current width
yScale - The percentage of the current height
constrainXScale - The constrained x scale percentage
constrainYScale - The constrained y scale percentage
noFlipXScale - The non-flipping x scale percentage
noFlipYScale - The non-flipping y scale percentage
constrainNoFlipXScale - The constrained non-flip x scale
constrainNoFlipYScale - The constrained non-flip y scale
x - The x point around which resizing occurs
y - The y point around which resizing occurs
Method Detail

getNode

public ZNode getNode()
Returns:
The node that was resized

getMouseEvent

public ZMouseEvent getMouseEvent()
Returns:
The mouse event that cause the resize

getScaleX

public double getScaleX()
Returns:
The default x scale

getScaleY

public double getScaleY()
Returns:
The default y scale

getConstrainScaleX

public double getConstrainScaleX()
Returns:
The constrained x scale

getConstrainScaleY

public double getConstrainScaleY()
Returns:
The constrained y scale

getNoFlipScaleX

public double getNoFlipScaleX()
Returns:
The default no-flip x scale

getNoFlipScaleY

public double getNoFlipScaleY()
Returns:
The default no-flip y scale

getNoFlipConstrainScaleX

public double getNoFlipConstrainScaleX()
Returns:
The constrained no-flip x scale

getNoFlipConstrainScaleY

public double getNoFlipConstrainScaleY()
Returns:
The constrained no-flip y scale

getX

public double getX()
Returns:
The x coordinate around which the object is resized

getY

public double getY()
Returns:
The y coordinate around which the object is resized


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