org.nakedobjects.plugins.dnd
Class ContentDrag

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

public class ContentDrag
extends Drag

Details a drag event that affects a view's content (as opposed to the view itself).


Field Summary
 
Fields inherited from class org.nakedobjects.plugins.dnd.PointerEvent
mods
 
Constructor Summary
ContentDrag(View source, Location offset, View dragView)
          Creates a new drag event.
 
Method Summary
 void cancel(Viewer viewer)
          Cancels drag by calling dragOut() on the current target, and changes the cursor back to the default.
 void drag(View target, Location location, int mods)
          Indicates that the drag state has changed.
 void end(Viewer viewer)
          Ends the drag by calling drop() on the current target, and changes the cursor back to the default.
 Location getOffset()
           
 View getOverlay()
           
 View getSource()
           
 Content getSourceContent()
          Returns the Content object from the source view.
 Location getTargetLocation()
           
 View getTargetView()
          Returns the current target view.
 void subtract(int left, int top)
           
 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

ContentDrag

public ContentDrag(View source,
                   Location offset,
                   View dragView)
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:
source - the view over which the pointer was when this event started
Method Detail

cancel

public void cancel(Viewer viewer)
Cancels drag by calling dragOut() on the current target, and changes the cursor back to the default.

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)
Ends the drag by calling drop() on the current target, and changes the cursor back to the default.

Specified by:
end in class Drag

getOverlay

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

getSource

public View getSource()

getSourceContent

public Content getSourceContent()
Returns the Content object from the source view.


getTargetLocation

public Location getTargetLocation()

getOffset

public Location getOffset()

getTargetView

public View getTargetView()
Returns the current target view.


toString

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

subtract

public void subtract(int left,
                     int top)


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