com.alee.laf.list
Class ListRolloverSelectionAdapter

java.lang.Object
  extended by java.awt.event.MouseMotionAdapter
      extended by com.alee.laf.list.ListRolloverSelectionAdapter
All Implemented Interfaces:
java.awt.event.MouseMotionListener, java.util.EventListener

public class ListRolloverSelectionAdapter
extends java.awt.event.MouseMotionAdapter

This adapter allows you to install (and uninstall if needed) select-on-rollover behavior into any JList without any additional coding.

Author:
Mikle Garin

Constructor Summary
ListRolloverSelectionAdapter(javax.swing.JList list)
          Constructs rollover selection adapter for the specified list.
 
Method Summary
static ListRolloverSelectionAdapter install(javax.swing.JList list)
          Installs rollover selection adapter into list and ensures that it is the only one installed.
static boolean isInstalled(javax.swing.JList list)
          Returns whether the specified list has any rollover selection adapters installed or not.
 void mouseMoved(java.awt.event.MouseEvent e)
          Performs selection change on rollover.
static void uninstall(javax.swing.JList list)
          Uninstalls all rollover selection adapters from the specified list.
 
Methods inherited from class java.awt.event.MouseMotionAdapter
mouseDragged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListRolloverSelectionAdapter

public ListRolloverSelectionAdapter(javax.swing.JList list)
Constructs rollover selection adapter for the specified list.

Parameters:
list - list into which this adapter is installed
Method Detail

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Performs selection change on rollover.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class java.awt.event.MouseMotionAdapter
Parameters:
e - mouse event

install

public static ListRolloverSelectionAdapter install(javax.swing.JList list)
Installs rollover selection adapter into list and ensures that it is the only one installed.

Parameters:
list - list to modify
Returns:
installed rollover selection adapter

uninstall

public static void uninstall(javax.swing.JList list)
Uninstalls all rollover selection adapters from the specified list.

Parameters:
list - list to modify

isInstalled

public static boolean isInstalled(javax.swing.JList list)
Returns whether the specified list has any rollover selection adapters installed or not.

Parameters:
list - list to process
Returns:
true if the specified list has any rollover selection adapters installed, false otherwise