ar.com.da.swing
Class DefaultDragAndResizePolicy

java.lang.Object
  extended by ar.com.da.swing.DefaultDragAndResizePolicy
All Implemented Interfaces:
DragAndResizePolicy, java.io.Serializable

public class DefaultDragAndResizePolicy
extends java.lang.Object
implements DragAndResizePolicy, java.io.Serializable

Default implementation of the drag & resize policy

Author:
Carlos E.Descalzi
See Also:
Serialized Form

Constructor Summary
DefaultDragAndResizePolicy()
           
DefaultDragAndResizePolicy(int threshold)
          Construct the default policy with a given theshold
 
Method Summary
 DragType getDragType(java.awt.Component component, java.awt.Point point)
           
 ResizeType getResizeType(java.awt.Component component, java.awt.Point point)
          Determines the resize type for a given point and a component
 int getThreshold()
          returns the current threshold
 void setThreshold(int threshold)
          sets a new threshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDragAndResizePolicy

public DefaultDragAndResizePolicy(int threshold)
Construct the default policy with a given theshold

Parameters:
threshold -

DefaultDragAndResizePolicy

public DefaultDragAndResizePolicy()
Method Detail

getResizeType

public ResizeType getResizeType(java.awt.Component component,
                                java.awt.Point point)
Description copied from interface: DragAndResizePolicy
Determines the resize type for a given point and a component

Specified by:
getResizeType in interface DragAndResizePolicy
Parameters:
component - the component to be resized/dragged
point - where the mouse button has been pressed
Returns:
the resize type, if is UNDEFINED, then the component will be moved

getThreshold

public int getThreshold()
returns the current threshold

Returns:
the current threshold

setThreshold

public void setThreshold(int threshold)
sets a new threshold

Parameters:
threshold - the new threshold

getDragType

public DragType getDragType(java.awt.Component component,
                            java.awt.Point point)
Specified by:
getDragType in interface DragAndResizePolicy


Copyright © 2006 null. All Rights Reserved.