facets.core.app.avatar
Class DragPolicy

java.lang.Object
  extended by facets.core.app.avatar.DragPolicy

public abstract class DragPolicy
extends java.lang.Object

Defines how a custom viewer should drag an avatar selection.

A DragPolicy supplies the Painters needed by a viewer to paint the content of an avatar selection as it is dragged, and specifies the effects on content of terminating the drag.


Field Summary
static java.lang.Integer CONSTRAINTS_CROSS
           
static java.lang.Integer CONSTRAINTS_NONE
           
static java.lang.Integer CONSTRAINTS_SIX_AXIAL
           
static java.lang.Integer CONSTRAINTS_THREE_AXIAL
           
static java.lang.Integer STATE_DRAG_UNCONSTRAINED
           
static java.lang.Integer STATE_NORMAL
           
 
Constructor Summary
DragPolicy()
           
 
Method Summary
 boolean checkSnap()
          Should the viewer attempt to snap the drag to non-selected avatars?
 java.lang.Object constraints()
          Specifies constraints on the movement of the drag.
abstract  java.lang.Object[] newDragEdits(Point anchorAt, Point dragAt)
          Return suitable edits for the drop specified.
abstract  Painter[] newDragPainters(Point anchorAt, Point dragAt)
          Return motion painters for the specified drag position.
 java.lang.Object[] newSnapDropEdits(Point anchorAt, Point dragAt, Vector snapShift)
          Variant method for use in snapping.
 Painter[] newSnapPainters(Point anchorAt, Point dragAt, Vector snapShift)
          Variant method for use in snapping.
 java.lang.Object stateCursor(java.lang.Object state)
          Defines the cursor to appear over different drag states.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_NORMAL

public static final java.lang.Integer STATE_NORMAL

STATE_DRAG_UNCONSTRAINED

public static final java.lang.Integer STATE_DRAG_UNCONSTRAINED

CONSTRAINTS_NONE

public static final java.lang.Integer CONSTRAINTS_NONE

CONSTRAINTS_CROSS

public static final java.lang.Integer CONSTRAINTS_CROSS

CONSTRAINTS_THREE_AXIAL

public static final java.lang.Integer CONSTRAINTS_THREE_AXIAL

CONSTRAINTS_SIX_AXIAL

public static final java.lang.Integer CONSTRAINTS_SIX_AXIAL
Constructor Detail

DragPolicy

public DragPolicy()
Method Detail

newDragPainters

public abstract Painter[] newDragPainters(Point anchorAt,
                                          Point dragAt)
Return motion painters for the specified drag position.

New painters will generally be requested for each change in dragAt.

Parameters:
anchorAt - starting point of the drag
dragAt - latest (possibly constrained) drag position
Returns:
a non-null Painter[]

newDragEdits

public abstract java.lang.Object[] newDragEdits(Point anchorAt,
                                                Point dragAt)
Return suitable edits for the drop specified.

@param anchorAt starting point of the drag

Parameters:
dragAt - final (possibly constrained) drag position before dropping
Returns:
an Object[] specifying changes to the content of the dragged selection

stateCursor

public java.lang.Object stateCursor(java.lang.Object state)
Defines the cursor to appear over different drag states.

Parameters:
state - an implementation-dependent object
Returns:
an implementation-dependent object

constraints

public java.lang.Object constraints()
Specifies constraints on the movement of the drag.

Returns:
an implementation-dependent object

checkSnap

public boolean checkSnap()
Should the viewer attempt to snap the drag to non-selected avatars?

Default returns false.


newSnapDropEdits

public java.lang.Object[] newSnapDropEdits(Point anchorAt,
                                           Point dragAt,
                                           Vector snapShift)
Variant method for use in snapping.

Invalid implementation


newSnapPainters

public Painter[] newSnapPainters(Point anchorAt,
                                 Point dragAt,
                                 Vector snapShift)
Variant method for use in snapping.

Invalid implementation