# Class SubsetStack

java.lang.Object
uk.ac.starlink.topcat.plot2.SubsetStack

public class SubsetStack extends Object
Provides a panel with a list of subsets and a configuration panel for each one. The list is selectable and the configuration panel for the currently selected subset is shown. The list of subsets is a CheckBoxList, so has selection boxes and drag handles.

Since:
  14 Mar 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`SubsetStack(ListModel<RowSubset> baseModel, SubsetConfigManager subManager)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`void`
`addActionListener(ActionListener listener)`
Adds a listener to be notified when the selection list changes content or sequence.
`JComponent`
`getComponent()`
Returns the graphical component for this stack.
`RowSubset[]`
`getSelectedSubsets()`
Return an array of the subsets which are currently active.
`void`
`removeActionListener(ActionListener listener)`
Removes a listener previously added.
`void`
`setSelected(RowSubset rset, boolean isSel)`
Sets the active status of a given subset.
`void`
`setSelectedSubsets(RowSubset[] rsets)`
Sets the list of active subsets.

### Methods inherited from class Object

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

## Constructor Details

### SubsetStack

public SubsetStack(ListModel<RowSubset> baseModel, SubsetConfigManager subManager)
Constructor.

Parameters:
  `baseModel` - list model containing RowSubset objects
  `subManager` - provides per-subset configuration components

## Method Details

### getSelectedSubsets

public RowSubset[] getSelectedSubsets()
Return an array of the subsets which are currently active.

Returns:
  subsets in list with checked checkboxes

### setSelectedSubsets

public void setSelectedSubsets(RowSubset[] rsets)
Sets the list of active subsets.

Parameters:
  `rsets` - subsets in list for which checkboxes should be checked

### setSelected

public void setSelected(RowSubset rset, boolean isSel)
Sets the active status of a given subset.

Parameters:
  `rset` - row subset
  `isSel` - true for selected, false for unselected

### getComponent

public JComponent getComponent()
Returns the graphical component for this stack.

Returns:
  component

### addActionListener

public void addActionListener(ActionListener listener)
Adds a listener to be notified when the selection list changes content or sequence.

Parameters:
  `listener` - listener to add

### removeActionListener

public void removeActionListener(ActionListener listener)
Removes a listener previously added.

Parameters:
  `listener` - listener to remove