Class DragHandle
- java.lang.Object
-
- ca.cgjennings.apps.arkham.deck.item.DragHandle
-
public abstract class DragHandle extends java.lang.Object
A handle that can be attached to a component and that the user can drag to modify the item in some way.- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description DragHandle(PageItem owner)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
beginDrag(java.awt.geom.Point2D startPoint, java.awt.event.MouseEvent e)
void
cancelDrag()
void
drag(java.awt.geom.Point2D point, java.awt.event.MouseEvent e)
void
endDrag()
java.awt.Cursor
getCursor()
Returns the cursor to use when the pointer is over this handle.PageItem
getOwner()
boolean
handleMovedDuringDrag()
abstract boolean
hitTest(java.awt.geom.Point2D p)
Returnstrue
if a point is over this handle.boolean
isDragging()
abstract void
paintDragState(java.awt.Graphics2D g)
abstract void
paintHandle(java.awt.Graphics2D g)
-
-
-
Constructor Detail
-
DragHandle
public DragHandle(PageItem owner)
-
-
Method Detail
-
paintHandle
public abstract void paintHandle(java.awt.Graphics2D g)
-
paintDragState
public abstract void paintDragState(java.awt.Graphics2D g)
-
hitTest
public abstract boolean hitTest(java.awt.geom.Point2D p)
Returnstrue
if a point is over this handle. When this method returnstrue
, dragging the mouse would begin a drag operation.- Parameters:
p
- the point to test- Returns:
true
if the point falls within the handle
-
getCursor
public java.awt.Cursor getCursor()
Returns the cursor to use when the pointer is over this handle.DragHandle
returns the default cursor.- Returns:
- the cursor to use for this handle
-
beginDrag
public void beginDrag(java.awt.geom.Point2D startPoint, java.awt.event.MouseEvent e)
-
drag
public void drag(java.awt.geom.Point2D point, java.awt.event.MouseEvent e)
-
handleMovedDuringDrag
public boolean handleMovedDuringDrag()
-
endDrag
public void endDrag()
-
cancelDrag
public void cancelDrag()
-
getOwner
public PageItem getOwner()
-
isDragging
public boolean isDragging()
-
-