# Class WindowToggle

java.lang.Object
javax.swing.DefaultButtonModel
javax.swing.JToggleButton.ToggleButtonModel
uk.ac.starlink.topcat.ToggleButtonModel
uk.ac.starlink.topcat.WindowToggle

All Implemented Interfaces:
  `ItemSelectable, Serializable, ButtonModel`

public abstract class WindowToggle extends ToggleButtonModel
ToggleButtonModel subclass that will lazily create and show/hide a window.

Since:
  20 Jul 2017
Author:
  Mark Taylor
See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class DefaultButtonModel

`actionCommand, ARMED, changeEvent, ENABLED, group, listenerList, mnemonic, PRESSED, ROLLOVER, SELECTED, stateMask`

## Constructor Summary

Constructors
Constructor
Description
`WindowToggle(String name, Icon icon, String descrip)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected abstract Window`
`createWindow()`
This method is called to create the window to be shown when it is first required.

### Methods inherited from class ToggleButtonModel

`createButton, createCheckBox, createMenuItem, createRadioButtons, createToolbarButton, fireActionPerformed, getDescription, getIcon, getText, isSelected, setDescription, setIcon, setSelected, setText`

### Methods inherited from class JToggleButton.ToggleButtonModel

`setPressed`

### Methods inherited from class DefaultButtonModel

`addActionListener, addChangeListener, addItemListener, fireItemStateChanged, fireStateChanged, getActionCommand, getActionListeners, getChangeListeners, getGroup, getItemListeners, getListeners, getMnemonic, getSelectedObjects, isArmed, isEnabled, isPressed, isRollover, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setArmed, setEnabled, setGroup, setMnemonic, setRollover`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WindowToggle

public WindowToggle(String name, Icon icon, String descrip)
Constructor.

Parameters:
  `name` - toggle button name
  `icon` - toggle button icon
  `descrip` - toggle button description

## Method Details

### createWindow

protected abstract Window createWindow()
This method is called to create the window to be shown when it is first required.

Returns:
  window to display when toggle button is selected