APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing

pack-priv Class Autoscroller

extends Object
implements ActionListener
Class Inheritance
All Implemented Interfaces
java.awt.event.ActionListener, java.util.EventListener
Imports
java.awt.*, java.awt.event.*, sun.awt.AWTAccessor, .AWTAccessor.MouseEventAccessor

Autoscroller is responsible for generating synthetic mouse dragged events. It is the responsibility of the Component (or its MouseListeners) that receive the events to do the actual scrolling in response to the mouse dragged events.
Authors
Dave Moore, Scott Violet

Field Summary

Modifier and TypeField and Description
private static JComponent
private static MouseEvent
private static Autoscroller
sharedInstance

Global Autoscroller.

private static Timer

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean
_isRunning(JComponent c)

Returns true if autoscrolling is currently running for the specified widget.

private void
_processMouseDragged(MouseEvent e)

MouseListener method, invokes start/stop as necessary.

private void
_stop(JComponent c)

Stops scrolling for the passed in widget.

public void
public static boolean
isRunning(JComponent c)

Stops autoscroll events from happening on the specified component.

public static void
processMouseDragged(MouseEvent e)

Invoked when a mouse dragged event occurs, will start the autoscroller if necessary.

private void
start(JComponent c, MouseEvent e)

Starts the timer targeting the passed in component.

public static void
stop(JComponent c)

Stops autoscroll events from happening on the specified component.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

componentback to summary
private static JComponent component
eventback to summary
private static MouseEvent event
sharedInstanceback to summary
private static Autoscroller sharedInstance

Global Autoscroller.

timerback to summary
private static Timer timer

Constructor Detail

Autoscrollerback to summary
pack-priv Autoscroller()

Method Detail

_isRunningback to summary
private boolean _isRunning(JComponent c)

Returns true if autoscrolling is currently running for the specified widget.

_processMouseDraggedback to summary
private void _processMouseDragged(MouseEvent e)

MouseListener method, invokes start/stop as necessary.

_stopback to summary
private void _stop(JComponent c)

Stops scrolling for the passed in widget.

actionPerformedback to summary
public void actionPerformed(ActionEvent x)

Implements java.awt.event.ActionListener.actionPerformed.

ActionListener method. Invoked when the Timer fires. This will scroll if necessary.

Annotations
@SuppressWarnings:deprecation
isRunningback to summary
public static boolean isRunning(JComponent c)

Stops autoscroll events from happening on the specified component.

processMouseDraggedback to summary
public static void processMouseDragged(MouseEvent e)

Invoked when a mouse dragged event occurs, will start the autoscroller if necessary.

startback to summary
private void start(JComponent c, MouseEvent e)

Starts the timer targeting the passed in component.

Annotations
@SuppressWarnings:deprecation
stopback to summary
public static void stop(JComponent c)

Stops autoscroll events from happening on the specified component.