uk.ac.starlink.topcat.plot2
Class ControlStackModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by uk.ac.starlink.topcat.plot2.ControlStackModel
All Implemented Interfaces:
Serializable, ListModel

public class ControlStackModel
extends AbstractListModel

ListModel for the control stack. All the entries are Control objects.

Since:
13 Mar 2013
Author:
Mark Taylor
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
ControlStackModel()
          Constructor.
 
Method Summary
 void addControl(Control control)
          Adds a control to this model.
 void addPlotActionListener(ActionListener listener)
          Adds a listener which will be notified if this stack's state changes in such a way that the plot might be affected.
 Control getControlAt(int ix)
          Returns the control at a given index in this list.
 Object getElementAt(int ix)
           
 LayerControl[] getLayerControls(boolean activeOnly)
          Returns a list of the controls which can contribute layers to the plot, that is LayerControls.
 int getSize()
           
 boolean isControlActive(Control control)
          Indicates whether a given control is marked as active in this stack.
 void moveControl(int iFrom, int iTo)
          Relocates a control in this list.
 void removeControl(Control control)
          Removes a control from this model.
 void removePlotActionListener(ActionListener listener)
          Removes a listener previously added.
 void setControlActive(Control control, boolean isActive)
          Sets the activeness of a control in this stack.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControlStackModel

public ControlStackModel()
Constructor.

Method Detail

getElementAt

public Object getElementAt(int ix)

getSize

public int getSize()

getControlAt

public Control getControlAt(int ix)
Returns the control at a given index in this list.

Parameters:
ix - list index

isControlActive

public boolean isControlActive(Control control)
Indicates whether a given control is marked as active in this stack.

Parameters:
control - control
Returns:
true iff active

setControlActive

public void setControlActive(Control control,
                             boolean isActive)
Sets the activeness of a control in this stack.

Parameters:
control - control
isActive - true iff active

getLayerControls

public LayerControl[] getLayerControls(boolean activeOnly)
Returns a list of the controls which can contribute layers to the plot, that is LayerControls. If the activeOnly parameter is set, it is restricted further to controls which are currently marked as active and which are known to contribute at least one layer.

Parameters:
activeOnly - if true, return only controls contributing layers; if false, return all
Returns:
layer controls that would contribute to a plot

addControl

public void addControl(Control control)
Adds a control to this model.

Parameters:
control - new control

removeControl

public void removeControl(Control control)
Removes a control from this model.

Parameters:
control - previously added control

moveControl

public void moveControl(int iFrom,
                        int iTo)
Relocates a control in this list.

Parameters:
iFrom - source list index
iTo - destination list index

addPlotActionListener

public void addPlotActionListener(ActionListener listener)
Adds a listener which will be notified if this stack's state changes in such a way that the plot might be affected. That includes changes in the state of any of the controls contained in this stack.

Parameters:
listener - listener to add

removePlotActionListener

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

Parameters:
listener - listener to remove


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.