JIDE 3.5.15

com.jidesoft.swing
Class AutoRepeatButtonUtils

java.lang.Object
  extended by com.jidesoft.swing.AutoRepeatButtonUtils
All Implemented Interfaces:
ActionListener, MouseListener, EventListener

public class AutoRepeatButtonUtils
extends Object
implements ActionListener, MouseListener

AutoRepeatButtonUtils is a utility class which can make a button automatically trigger action events continuously. To enable this feature on any button, just call AutoRepeatButtonUtils.install(button) or AutoRepeatButtonUtils.install(button, delay, initialDelay).


Field Summary
static String AUTO_REPEAT
           
static String CLIENT_PROPERTY_AUTO_REPEAT
           
static int DEFAULT_DELAY
           
static int DEFAULT_INITIAL_DELAY
           
 
Constructor Summary
AutoRepeatButtonUtils()
           
 
Method Summary
 void actionPerformed(ActionEvent event)
           
static void install(AbstractButton button)
          Enable auto-repeat feature on the button.
static void install(AbstractButton button, int delay, int initialDelay)
          Enable auto-repeat feature on the button.
protected  void installListeners(AbstractButton button, int delay, int initialDelay)
           
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
static void uninstall(AbstractButton button)
          Disabled the auto-repeat feature on the button which called install before.
protected  void uninstallListeners()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTO_REPEAT

public static String AUTO_REPEAT

CLIENT_PROPERTY_AUTO_REPEAT

public static String CLIENT_PROPERTY_AUTO_REPEAT

DEFAULT_DELAY

public static int DEFAULT_DELAY

DEFAULT_INITIAL_DELAY

public static int DEFAULT_INITIAL_DELAY
Constructor Detail

AutoRepeatButtonUtils

public AutoRepeatButtonUtils()
Method Detail

install

public static void install(AbstractButton button)
Enable auto-repeat feature on the button.

Parameters:
button - the button.

install

public static void install(AbstractButton button,
                           int delay,
                           int initialDelay)
Enable auto-repeat feature on the button.

Parameters:
button - the button.
delay - the delay between action events, in ms.
initialDelay - the initial delay, in ms. It is from the time mouse is pressed to the first action event.

uninstall

public static void uninstall(AbstractButton button)
Disabled the auto-repeat feature on the button which called install before.

Parameters:
button - the button that has auto-repeat feature.

installListeners

protected void installListeners(AbstractButton button,
                                int delay,
                                int initialDelay)

uninstallListeners

protected void uninstallListeners()

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

JIDE 3.5.15