org.nakedobjects.plugins.dnd
Class SimpleInternalDrag

java.lang.Object
  extended by org.nakedobjects.plugins.dnd.PointerEvent
      extended by org.nakedobjects.plugins.dnd.Drag
          extended by org.nakedobjects.plugins.dnd.InternalDrag
              extended by org.nakedobjects.plugins.dnd.SimpleInternalDrag

public class SimpleInternalDrag
extends InternalDrag


Field Summary
 
Fields inherited from class org.nakedobjects.plugins.dnd.PointerEvent
mods
 
Constructor Summary
SimpleInternalDrag(View view, Location location)
          Creates a new drag event.
SimpleInternalDrag(View view, Offset off)
           
 
Method Summary
 void cancel(Viewer viewer)
          Indicates the drag has been cancelled; no action should be taken.
 void drag(View target, Location location, int mods)
          Indicates that the drag state has changed.
 void end(Viewer viewer)
          Indicates the drag has properly ended (the mouse button has been released)
 Location getLocation()
          Gets the location of the pointer relative to the view.
 View getOverlay()
           
 java.lang.String toString()
           
 
Methods inherited from class org.nakedobjects.plugins.dnd.PointerEvent
button1, button2, button3, isAlt, isCtrl, isMeta, isShift
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleInternalDrag

public SimpleInternalDrag(View view,
                          Location location)
Creates a new drag event. The source view has its pickup(), and then, exited() methods called on it. The view returned by the pickup method becomes this event overlay view, which is moved continuously so that it tracks the pointer,

Parameters:
view - the view over which the pointer was when this event started
location - the location within the viewer (the Frame/Applet/Window etc) TODO combine the two constructors

SimpleInternalDrag

public SimpleInternalDrag(View view,
                          Offset off)
Method Detail

cancel

public void cancel(Viewer viewer)
Description copied from class: Drag
Indicates the drag has been cancelled; no action should be taken.

Specified by:
cancel in class Drag

drag

public void drag(View target,
                 Location location,
                 int mods)
Description copied from class: Drag
Indicates that the drag state has changed.

Specified by:
drag in class Drag

end

public void end(Viewer viewer)
Description copied from class: Drag
Indicates the drag has properly ended (the mouse button has been released)

Specified by:
end in class Drag

getLocation

public Location getLocation()
Gets the location of the pointer relative to the view.

Specified by:
getLocation in class InternalDrag

getOverlay

public View getOverlay()
Specified by:
getOverlay in class Drag

toString

public java.lang.String toString()
Overrides:
toString in class PointerEvent


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.