org.jurvis.swing.actions
Class JvViewAction
java.lang.Object
javax.swing.AbstractAction
org.jurvis.swing.actions.JvViewAction
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action, JvToggleAction
public class JvViewAction
- extends AbstractAction
- implements JvToggleAction
An Action for toggling the visibility of a Component.
- Author:
- Neil W. Weber
- See Also:
- Serialized Form
|
Constructor Summary |
JvViewAction(String name,
Component component)
Create a JvViewAction with the given name that controls
the visibility of the given component. |
component
protected final Component component
- The controlled component.
buttonModel
protected final ButtonModel buttonModel
- The button model tracking the component's visibility.
JvViewAction
public JvViewAction(String name,
Component component)
- Create a
JvViewAction with the given name that controls
the visibility of the given component.
- Parameters:
name - the name of the actioncomponent - the controlled component
setVisible
public void setVisible(boolean visible)
- Set the visibility of the controlled component.
- Parameters:
visible - the new visibility setting
isVisible
public boolean isVisible()
- Return the visibility of the controlled component.
- Returns:
- true if the component is visible; false otherwise
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed in interface ActionListener
getButtonModel
public ButtonModel getButtonModel()
- Specified by:
getButtonModel in interface JvToggleAction
- Returns:
- a ButtonModel useful for checking the toggle state of this action.
Copyright © 1999-2004 Neil W. Weber. All Rights Reserved.