Methods Summary |
---|
private boolean | _isRunning(javax.swing.JComponent c)Returns true if autoscrolling is currently running for the specified
widget.
return (c == component && timer != null && timer.isRunning());
|
private void | _processMouseDragged(java.awt.event.MouseEvent e)MouseListener method, invokes start/stop as necessary.
JComponent component = (JComponent)e.getComponent();
Rectangle visibleRect = component.getVisibleRect();
boolean contains = visibleRect.contains(e.getX(), e.getY());
if (contains) {
_stop(component);
} else {
start(component, e);
}
|
private void | _stop(javax.swing.JComponent c)Stops scrolling for the passed in widget.
if (component == c) {
if (timer != null) {
timer.stop();
}
timer = null;
event = null;
component = null;
}
|
public void | actionPerformed(java.awt.event.ActionEvent x)ActionListener method. Invoked when the Timer fires. This will scroll
if necessary.
JComponent component = Autoscroller.component;
if (component == null || !component.isShowing() || (event == null)) {
_stop(component);
return;
}
Point screenLocation = component.getLocationOnScreen();
MouseEvent e = new MouseEvent(component, event.getID(),
event.getWhen(), event.getModifiers(),
event.getX() - screenLocation.x,
event.getY() - screenLocation.y,
event.getClickCount(),
event.isPopupTrigger());
component.superProcessMouseMotionEvent(e);
|
public static boolean | isRunning(javax.swing.JComponent c)Stops autoscroll events from happening on the specified component.
return sharedInstance._isRunning(c);
|
public static void | processMouseDragged(java.awt.event.MouseEvent e)Invoked when a mouse dragged event occurs, will start the autoscroller
if necessary.
sharedInstance._processMouseDragged(e);
|
private void | start(javax.swing.JComponent c, java.awt.event.MouseEvent e)Starts the timer targeting the passed in component.
Point screenLocation = c.getLocationOnScreen();
if (component != c) {
_stop(component);
}
component = c;
event = new MouseEvent(component, e.getID(), e.getWhen(),
e.getModifiers(), e.getX() + screenLocation.x,
e.getY() + screenLocation.y,
e.getClickCount(), e.isPopupTrigger());
if (timer == null) {
timer = new Timer(100, this);
}
if (!timer.isRunning()) {
timer.start();
}
|
public static void | stop(javax.swing.JComponent c)Stops autoscroll events from happening on the specified component.
//
// The public API, all methods are cover methods for an instance method
//
sharedInstance._stop(c);
|