Class DragHandle
- java.lang.Object
-
- ca.cgjennings.apps.arkham.deck.item.DragHandle
-
public abstract class DragHandle extends java.lang.ObjectA 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 voidbeginDrag(java.awt.geom.Point2D startPoint, java.awt.event.MouseEvent e)voidcancelDrag()voiddrag(java.awt.geom.Point2D point, java.awt.event.MouseEvent e)voidendDrag()java.awt.CursorgetCursor()Returns the cursor to use when the pointer is over this handle.PageItemgetOwner()booleanhandleMovedDuringDrag()abstract booleanhitTest(java.awt.geom.Point2D p)Returnstrueif a point is over this handle.booleanisDragging()abstract voidpaintDragState(java.awt.Graphics2D g)abstract voidpaintHandle(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)
Returnstrueif 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:
trueif the point falls within the handle
-
getCursor
public java.awt.Cursor getCursor()
Returns the cursor to use when the pointer is over this handle.DragHandlereturns 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()
-
-