CESE 1.4.7

com.simulogic.dataview
Class DataStorage

java.lang.Object
  extended by javax.swing.tree.DefaultTreeModel
      extended by com.simulogic.dataview.DataStorage
All Implemented Interfaces:
java.io.Serializable, javax.swing.tree.TreeModel

public class DataStorage
extends javax.swing.tree.DefaultTreeModel

Container for all the data (i.e. model)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultTreeModel
asksAllowsChildren, listenerList, root
 
Constructor Summary
DataStorage()
          Default constructor
 
Method Summary
 void addChannel(DataChannel c, int g)
          Adds a channel to the specific group in the storage
 void addGroup(DataGroup g)
          Adds a group to the storage
 java.awt.geom.Rectangle2D.Double getAutoscaleRectangle(double xMin, double xMax)
          Returns autoscale rectangle for data interval
 DataChannel getChannel(int g, int c)
          Returns channel in the group from this storage
 javax.swing.tree.DefaultMutableTreeNode getChannelNode(int g, int c)
          Returns node that keeps channel in the group from this storage
 int getChannelsSize(int g)
          Returns number of channels in the specific group
 DataGroup getGroup(int g)
          Returns group from this storage
 int getGroupsSize()
          Returns number of groups in this storage
 java.awt.geom.Rectangle2D.Double getLimitRectangle()
          Returns rectangle of data limits
 DataChannel getSelectedChannel()
          Returns a currently selected channel
 DataChannel getXChannel(DataChannel chan)
          Returns X channel that corresponds to the given channel
 boolean isXChannel(DataChannel chan)
          Returns true if given channel is an X channel in one of the groups
 void setSelectedChannel(DataChannel selectedChannel)
          Sets the new selected channel
 void setXChannel(DataChannel chan)
          Sets an attribute of the given channel to X channel and adjusts all entries in the correspondent group
 void updateModel(int g)
          Updates group in the storage
 
Methods inherited from class javax.swing.tree.DefaultTreeModel
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataStorage

public DataStorage()
Default constructor

Method Detail

addGroup

public void addGroup(DataGroup g)
Adds a group to the storage

Parameters:
g - a group to add

addChannel

public void addChannel(DataChannel c,
                       int g)
Adds a channel to the specific group in the storage

Parameters:
c - channel to add
g - target group

getGroup

public DataGroup getGroup(int g)
                   throws java.lang.ClassCastException
Returns group from this storage

Parameters:
g - group index
Returns:
DataGroup for index
Throws:
java.lang.ClassCastException - if object is not of type DataGroup

getGroupsSize

public int getGroupsSize()
Returns number of groups in this storage

Returns:
number of groups

getChannel

public DataChannel getChannel(int g,
                              int c)
                       throws java.lang.ClassCastException
Returns channel in the group from this storage

Parameters:
c - channel index in group g
g - group index
Returns:
DataChannel for index
Throws:
java.lang.ClassCastException - if object is not of type DataChannel

getChannelNode

public javax.swing.tree.DefaultMutableTreeNode getChannelNode(int g,
                                                              int c)
                                                       throws java.lang.ClassCastException
Returns node that keeps channel in the group from this storage

Parameters:
c - channel index in group g
g - group index
Returns:
DataChannel for index
Throws:
java.lang.ClassCastException - if object is not of type DefaultMutableTreeNode

getChannelsSize

public int getChannelsSize(int g)
Returns number of channels in the specific group

Parameters:
g - target group
Returns:
number of channels in group

getXChannel

public DataChannel getXChannel(DataChannel chan)
Returns X channel that corresponds to the given channel

Parameters:
chan - channel to test
Returns:
X channel in the correspondent group

isXChannel

public boolean isXChannel(DataChannel chan)
Returns true if given channel is an X channel in one of the groups

Parameters:
chan - channel to test
Returns:
true if X channel

setXChannel

public void setXChannel(DataChannel chan)
Sets an attribute of the given channel to X channel and adjusts all entries in the correspondent group

Parameters:
chan - channel to test

getSelectedChannel

public DataChannel getSelectedChannel()
Returns a currently selected channel

Returns:
selected channel

setSelectedChannel

public void setSelectedChannel(DataChannel selectedChannel)
Sets the new selected channel

Parameters:
selectedChannel - selected channel

getLimitRectangle

public java.awt.geom.Rectangle2D.Double getLimitRectangle()
Returns rectangle of data limits

Returns:
limit rectangle

getAutoscaleRectangle

public java.awt.geom.Rectangle2D.Double getAutoscaleRectangle(double xMin,
                                                              double xMax)
Returns autoscale rectangle for data interval

Parameters:
xMin - minimum limit for x
xMax - maximum limit for x
Returns:
autoscale rectangle

updateModel

public void updateModel(int g)
Updates group in the storage

Parameters:
g - target group index

CESE 1.4.7

Copyright (c) 1999 - 2007 Cell Electrophysiology Simulation Environment (CESE). All rights reserved.