com.alee.utils.swing
Class ConditionalVisibilityListener

java.lang.Object
  extended by com.alee.utils.swing.ConditionalVisibilityListener
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.MouseListener, java.util.EventListener

public class ConditionalVisibilityListener
extends java.lang.Object
implements java.awt.event.FocusListener, java.awt.event.MouseListener

This listener allows a quick creation of component visibility change action on any focus changes. You can also invert the way visibility changes on focus change.


Constructor Summary
ConditionalVisibilityListener(java.awt.Component component)
           
ConditionalVisibilityListener(java.awt.Component component, java.lang.Boolean focusedVisible, java.lang.Boolean mouseoverVisible)
           
 
Method Summary
 void focusGained(java.awt.event.FocusEvent e)
           
 void focusLost(java.awt.event.FocusEvent e)
           
 java.awt.Component getComponent()
           
 java.lang.Boolean getFocusedVisible()
           
 java.lang.Boolean getMouseoverVisible()
           
static void install(java.awt.Component tracked, java.awt.Component component, java.lang.Boolean focusedVisible, java.lang.Boolean mouseoverVisible)
           
 boolean isVisible()
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setComponent(java.awt.Component component)
           
 void setFocusedVisible(java.lang.Boolean focusedVisible)
           
 void setMouseoverVisible(java.lang.Boolean mouseoverVisible)
           
 void updateVisibility()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConditionalVisibilityListener

public ConditionalVisibilityListener(java.awt.Component component)

ConditionalVisibilityListener

public ConditionalVisibilityListener(java.awt.Component component,
                                     java.lang.Boolean focusedVisible,
                                     java.lang.Boolean mouseoverVisible)
Method Detail

install

public static void install(java.awt.Component tracked,
                           java.awt.Component component,
                           java.lang.Boolean focusedVisible,
                           java.lang.Boolean mouseoverVisible)

getFocusedVisible

public java.lang.Boolean getFocusedVisible()

setFocusedVisible

public void setFocusedVisible(java.lang.Boolean focusedVisible)

getMouseoverVisible

public java.lang.Boolean getMouseoverVisible()

setMouseoverVisible

public void setMouseoverVisible(java.lang.Boolean mouseoverVisible)

getComponent

public java.awt.Component getComponent()

setComponent

public void setComponent(java.awt.Component component)

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

updateVisibility

public void updateVisibility()

isVisible

public boolean isVisible()