edu.jhu.ece.iacl.jist.pipeline.graph
Class PipeModuleCell

java.lang.Object
  extended by DefaultGraphCell
      extended by edu.jhu.ece.iacl.jist.pipeline.graph.PipeModuleCell
Direct Known Subclasses:
PipeAlgorithmFactory.AlgorithmCell, PipeDestinationFactory.DestinationCell, PipeSourceFactory.SourceCell

public abstract class PipeModuleCell
extends DefaultGraphCell

Module cell to display on graph.

Author:
Blake Lucas (bclucas@jhu.edu)

Field Summary
protected static java.awt.Dimension defaultSize
          The Constant defaultSize.
protected static int hspace
          The Constant hspace.
protected  PipeModule pipe
          The pipe.
protected  java.awt.Dimension preferredSize
          The preferred size.
 
Constructor Summary
PipeModuleCell(java.lang.String name, PipeModule pipe)
          Constructor.
 
Method Summary
protected  java.util.Map createCellAttributes()
          Create cell attributes that are default with all cells.
protected  void createPorts()
          Create ports for module.
 java.lang.Class getModuleClass()
          Module class that is stored in this cell.
 PipeModule getPipeModule()
          Get pipe module that is stored in this cell.
static java.awt.Dimension getPreferredSize(int numInput, int numOutput)
          Get preferred size for module as a function of the number of incoming and outgoing ports.
static java.awt.Dimension getPreferredSize(ParamCollection inputParams, ParamCollection outputParams)
          Get preferred size for module as a function of the input and output parameters.
 void setBounds(java.awt.geom.Rectangle2D bounds)
          Set the size of this module.
 void setLocation(int x, int y)
          Set the location of the module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultSize

protected static final java.awt.Dimension defaultSize
The Constant defaultSize.


hspace

protected static final int hspace
The Constant hspace.

See Also:
Constant Field Values

pipe

protected PipeModule pipe
The pipe.


preferredSize

protected java.awt.Dimension preferredSize
The preferred size.

Constructor Detail

PipeModuleCell

public PipeModuleCell(java.lang.String name,
                      PipeModule pipe)
Constructor.

Parameters:
name - name of module
pipe - module
Method Detail

getPreferredSize

public static java.awt.Dimension getPreferredSize(int numInput,
                                                  int numOutput)
Get preferred size for module as a function of the number of incoming and outgoing ports.

Parameters:
numInput - number of incoming ports
numOutput - number of outgoing ports
Returns:
the preferred size

getPreferredSize

public static java.awt.Dimension getPreferredSize(ParamCollection inputParams,
                                                  ParamCollection outputParams)
Get preferred size for module as a function of the input and output parameters.

Parameters:
inputParams - input parameters
outputParams - output parameters
Returns:
the preferred size

createCellAttributes

protected java.util.Map createCellAttributes()
Create cell attributes that are default with all cells.

Returns:
the map

createPorts

protected void createPorts()
Create ports for module.


getModuleClass

public java.lang.Class getModuleClass()
Module class that is stored in this cell.

Returns:
the module class

getPipeModule

public PipeModule getPipeModule()
Get pipe module that is stored in this cell.

Returns:
the pipe module

setBounds

public void setBounds(java.awt.geom.Rectangle2D bounds)
Set the size of this module.

Parameters:
bounds - dimensions

setLocation

public void setLocation(int x,
                        int y)
Set the location of the module.

Parameters:
x - X coordinate
y - Y coordinate