com.partnersoft.gui
Class LockingToggleButtonControl

java.lang.Object
  extended by com.partnersoft.gui.LockingToggleButtonControl
All Implemented Interfaces:
GUIControl

public class LockingToggleButtonControl
extends java.lang.Object
implements GUIControl

A locking toggle button.

Author:
Paul Reavis Copyright 1998 Partner Software, Inc.

Constructor Summary
LockingToggleButtonControl()
           
LockingToggleButtonControl(javax.swing.Icon icon)
          Creates a toggle button which displays the provided icon.
LockingToggleButtonControl(java.lang.String label)
          Creates a Toggle button which displays the provided label.
 
Method Summary
 javax.swing.JComponent getGUI()
           
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 boolean isEnabled()
           
 boolean isLocked()
          Returns true if the locker button is on - isOn() must also be true if this is true.
 boolean isOn()
          Returns true if the main button is on.
 boolean releaseUnlessLocked()
          Releases the button UNLESS the lock is on.
 void setEnabled(boolean enabled)
           
 void setLocked(boolean tizit)
           
 void setOn(boolean tizit)
           
 void stateChange(boolean on, boolean locked)
          Handy way for subclasses to handle events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockingToggleButtonControl

public LockingToggleButtonControl()

LockingToggleButtonControl

public LockingToggleButtonControl(java.lang.String label)
Creates a Toggle button which displays the provided label.


LockingToggleButtonControl

public LockingToggleButtonControl(javax.swing.Icon icon)
Creates a toggle button which displays the provided icon.

Method Detail

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

getPreferredSize

public java.awt.Dimension getPreferredSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()

isOn

public boolean isOn()
Returns true if the main button is on. isLocked() must be false if this is false.


isLocked

public boolean isLocked()
Returns true if the locker button is on - isOn() must also be true if this is true.


setOn

public void setOn(boolean tizit)

setLocked

public void setLocked(boolean tizit)

releaseUnlessLocked

public boolean releaseUnlessLocked()
Releases the button UNLESS the lock is on. Returns true if it actually did something.


stateChange

public void stateChange(boolean on,
                        boolean locked)
Handy way for subclasses to handle events. Does nothing by default.


getGUI

public javax.swing.JComponent getGUI()
Specified by:
getGUI in interface GUIControl