com.alee.utils.swing
Class ComponentUpdater

java.lang.Object
  extended by com.alee.utils.swing.WebTimer
      extended by com.alee.utils.swing.ComponentUpdater
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.AncestorListener

public class ComponentUpdater
extends WebTimer
implements javax.swing.event.AncestorListener

This class allows you to install (and uninstall if needed) component updater to any JComponent quickly without any additional coding, which allows you to add optimized rolling updates for the component from the added ActionListeners.

Author:
Mikle Garin

Nested Class Summary
 
Nested classes/interfaces inherited from class com.alee.utils.swing.WebTimer
WebTimer.PartType
 
Field Summary
 
Fields inherited from class com.alee.utils.swing.WebTimer
actionCommand, coalesce, cycleCount, cyclesLimit, defaultCyclesLimit, defaultThreadName, delay, exec, id, initialDelay, lastId, listeners, msInDay, msInHour, msInMinute, msInSecond, name, repeats, running, sleepStart, sleepTime, useEdtByDefault, useEventDispatchThread
 
Constructor Summary
ComponentUpdater(javax.swing.JComponent component)
           
ComponentUpdater(javax.swing.JComponent component, long delay)
           
ComponentUpdater(javax.swing.JComponent component, long delay, java.awt.event.ActionListener listener)
           
ComponentUpdater(javax.swing.JComponent component, long delay, long initialDelay)
           
ComponentUpdater(javax.swing.JComponent component, long delay, long initialDelay, java.awt.event.ActionListener listener)
           
ComponentUpdater(javax.swing.JComponent component, java.lang.String name, long delay)
           
ComponentUpdater(javax.swing.JComponent component, java.lang.String name, long delay, java.awt.event.ActionListener listener)
           
ComponentUpdater(javax.swing.JComponent component, java.lang.String name, long delay, long initialDelay)
           
ComponentUpdater(javax.swing.JComponent component, java.lang.String name, long delay, long initialDelay, java.awt.event.ActionListener listener)
           
 
Method Summary
 void ancestorAdded(javax.swing.event.AncestorEvent event)
           
 void ancestorMoved(javax.swing.event.AncestorEvent event)
           
 void ancestorRemoved(javax.swing.event.AncestorEvent event)
           
 java.awt.Component getComponent()
           
static ComponentUpdater install(javax.swing.JComponent component)
          Installs component updater and ensures that it is the only installed
static ComponentUpdater install(javax.swing.JComponent component, long delay)
           
static ComponentUpdater install(javax.swing.JComponent component, long delay, java.awt.event.ActionListener listener)
           
static ComponentUpdater install(javax.swing.JComponent component, long delay, long initialDelay)
           
static ComponentUpdater install(javax.swing.JComponent component, long delay, long initialDelay, java.awt.event.ActionListener listener)
           
static ComponentUpdater install(javax.swing.JComponent component, java.lang.String name, long delay)
           
static ComponentUpdater install(javax.swing.JComponent component, java.lang.String name, long delay, java.awt.event.ActionListener listener)
           
static ComponentUpdater install(javax.swing.JComponent component, java.lang.String name, long delay, long initialDelay)
           
static ComponentUpdater install(javax.swing.JComponent component, java.lang.String name, long delay, long initialDelay, java.awt.event.ActionListener listener)
           
static boolean isInstalled(javax.swing.JComponent component)
          Checks if component has any component updater installed
 void uninstall()
           
static void uninstall(javax.swing.JComponent component)
          Uninstalls any existing component updater from component
 
Methods inherited from class com.alee.utils.swing.WebTimer
addActionListener, cleanUp, createActionEvent, delay, delay, delay, delay, delay, delay, delay, delay, fireActionPerformed, getActionCommand, getCycleCount, getCycleNumber, getCyclesLimit, getCycleTimeLeft, getCycleTimePassed, getDelay, getInitialDelay, getInitialStringDelay, getListeners, getName, getStringDelay, invokeAndWait, isCoalesce, isLastCycle, isRepeats, isRunning, isUseEventDispatchThread, parseDelay, removeActionListener, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, repeat, restart, restart, restart, restart, restart, setActionCommand, setAlive, setCoalesce, setCyclesLimit, setDelay, setDelay, setInitialDelay, setInitialDelay, setName, setRepeats, setUseEventDispatchThread, shouldContinue, start, startExec, stop, stopExec, toString, toStringDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        long delay)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        java.lang.String name,
                        long delay)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        long delay,
                        long initialDelay)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        java.lang.String name,
                        long delay,
                        long initialDelay)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        long delay,
                        java.awt.event.ActionListener listener)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        java.lang.String name,
                        long delay,
                        java.awt.event.ActionListener listener)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        long delay,
                        long initialDelay,
                        java.awt.event.ActionListener listener)

ComponentUpdater

public ComponentUpdater(javax.swing.JComponent component,
                        java.lang.String name,
                        long delay,
                        long initialDelay,
                        java.awt.event.ActionListener listener)
Method Detail

uninstall

public void uninstall()

getComponent

public java.awt.Component getComponent()

ancestorAdded

public void ancestorAdded(javax.swing.event.AncestorEvent event)
Specified by:
ancestorAdded in interface javax.swing.event.AncestorListener

ancestorRemoved

public void ancestorRemoved(javax.swing.event.AncestorEvent event)
Specified by:
ancestorRemoved in interface javax.swing.event.AncestorListener

ancestorMoved

public void ancestorMoved(javax.swing.event.AncestorEvent event)
Specified by:
ancestorMoved in interface javax.swing.event.AncestorListener

install

public static ComponentUpdater install(javax.swing.JComponent component)
Installs component updater and ensures that it is the only installed


install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       long delay)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       java.lang.String name,
                                       long delay)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       long delay,
                                       long initialDelay)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       java.lang.String name,
                                       long delay,
                                       long initialDelay)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       long delay,
                                       java.awt.event.ActionListener listener)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       java.lang.String name,
                                       long delay,
                                       java.awt.event.ActionListener listener)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       long delay,
                                       long initialDelay,
                                       java.awt.event.ActionListener listener)

install

public static ComponentUpdater install(javax.swing.JComponent component,
                                       java.lang.String name,
                                       long delay,
                                       long initialDelay,
                                       java.awt.event.ActionListener listener)

uninstall

public static void uninstall(javax.swing.JComponent component)
Uninstalls any existing component updater from component


isInstalled

public static boolean isInstalled(javax.swing.JComponent component)
Checks if component has any component updater installed