|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.core.ui.util.DragDropScrollHandler
public class DragDropScrollHandler
Adds drag and drop scrolling functionality to a given scrollable. That is, the user can then not only use the scroll bars to scroll, but can click anywhere in the control and drag the mouse to scroll. The control's cursor is optionally set to the hand cursor.
This class assumes that dragging the mouse by 1 pixel would result in changeing the scroll bar value by 1. When dragging occurs, the values of the scroll bar(s) is/are modified and a custom Selection event sent to their selection listeners.
Constructor Summary | |
---|---|
DragDropScrollHandler(Scrollable control)
Constructs a new instance managing the given control and sets the control's cursor to the hand cursor. |
|
DragDropScrollHandler(Scrollable control,
boolean setCursor)
Constructs a new instance manageing the given control, optionally setting the control's cursor to the hand cursor. |
Method Summary | |
---|---|
protected ScrollBar |
getHorizontalBar()
Returns the horizontal scroll bar, if any. |
protected ScrollBar |
getVerticalBar()
Returns the vertical scroll bar, if any. |
void |
mouseDoubleClick(MouseEvent e)
|
void |
mouseDown(MouseEvent e)
|
void |
mouseMove(MouseEvent e)
|
void |
mouseUp(MouseEvent e)
|
protected void |
notifiyOfValueChange()
Sends out the event of a scroll bar's value having changed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DragDropScrollHandler(Scrollable control)
control
- the control to manage. Must have at least one of the two
styles, H_SCROLL
or V_SCROLL
, set.public DragDropScrollHandler(Scrollable control, boolean setCursor)
control
- the control to manage. Must have at least one of the two
styles, H_SCROLL
or V_SCROLL
, set.setCursor
- true
if the control's cursor should be set to the
hand cursor.Method Detail |
---|
protected ScrollBar getHorizontalBar()
protected ScrollBar getVerticalBar()
protected void notifiyOfValueChange()
public void mouseMove(MouseEvent e)
mouseMove
in interface MouseMoveListener
public void mouseDown(MouseEvent e)
mouseDown
in interface MouseListener
public void mouseUp(MouseEvent e)
mouseUp
in interface MouseListener
public void mouseDoubleClick(MouseEvent e)
mouseDoubleClick
in interface MouseListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |