edu.swri.swiftvis.sources
Class AbstractSource

java.lang.Object
  extended by edu.swri.swiftvis.sources.AbstractSource
All Implemented Interfaces:
DataSource, GraphElement, java.io.Serializable
Direct Known Subclasses:
BinaryPositionData, CartAndRadSource, DiscardData, DumpSource, EncounterData, Fixed2DBinnedSource, GeneralData, MercurySource, Particle2DBinnedSource, SchemeSource, ScriptSource, SequenceSource, SPHSource

public abstract class AbstractSource
extends java.lang.Object
implements DataSource

Author:
Mark Lewis
See Also:
Serialized Form

Field Summary
protected  java.util.ArrayList<DataElement> dataVect
           
protected  javax.swing.JTabbedPane propPanel
           
protected  java.util.ArrayList<DataSink> sinkVector
           
 
Constructor Summary
protected AbstractSource()
           
protected AbstractSource(AbstractSource c, java.util.List<GraphElement> l)
          This constructor is used by the copy method of subclasses.
 
Method Summary
protected  void abstractRedo2()
           
protected  void abstractRedoAllElements()
           
 void addOutput(DataSink sink)
           
 void clearData()
          This method does what the name implies, it clears out data vectors.
 void drawNode(java.awt.Graphics2D g)
           
 java.awt.Rectangle getBounds()
           
 DataElement getElement(int i)
          Returns the specified data element for this source.
 int getNumElements()
          Returns the number of data elements that this source has in it.
 int getNumOutputs()
           
 DataSink getOutput(int which)
           
protected  OutputInfoPanel getOutputInfoPanel()
           
 java.awt.Paint getPaint()
           
 javax.swing.JComponent getPropertiesPanel()
           
protected  void notifySinks()
           
 void redo()
           
protected abstract  void redoAllElements()
           
 void relink(java.util.Hashtable<GraphElement,GraphElement> linkHash)
           
 void removeOutput(DataSink sink)
           
protected abstract  void setupSpecificPanelProperties()
           
 java.lang.String toString()
           
 void translate(int dx, int dy)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.swri.swiftvis.DataSource
getNumParameters, getNumValues, getParameterDescription, getValueDescription
 
Methods inherited from interface edu.swri.swiftvis.GraphElement
copy, getDescription
 

Field Detail

dataVect

protected java.util.ArrayList<DataElement> dataVect

sinkVector

protected java.util.ArrayList<DataSink> sinkVector

propPanel

protected transient javax.swing.JTabbedPane propPanel
Constructor Detail

AbstractSource

protected AbstractSource()

AbstractSource

protected AbstractSource(AbstractSource c,
                         java.util.List<GraphElement> l)
This constructor is used by the copy method of subclasses.

Parameters:
c - The filter we are copying.
l - A list of other elements being copied. Only links to these should go through.
Method Detail

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface GraphElement

translate

public void translate(int dx,
                      int dy)
Specified by:
translate in interface GraphElement

clearData

public void clearData()
Description copied from interface: GraphElement
This method does what the name implies, it clears out data vectors. It is used for saving templates which shouldn't have the data in them.

Specified by:
clearData in interface GraphElement

getPaint

public java.awt.Paint getPaint()

drawNode

public void drawNode(java.awt.Graphics2D g)
Specified by:
drawNode in interface GraphElement

addOutput

public void addOutput(DataSink sink)
Specified by:
addOutput in interface DataSource

removeOutput

public void removeOutput(DataSink sink)
Specified by:
removeOutput in interface DataSource

getNumOutputs

public int getNumOutputs()
Specified by:
getNumOutputs in interface DataSource

getOutput

public DataSink getOutput(int which)
Specified by:
getOutput in interface DataSource

getElement

public DataElement getElement(int i)
Description copied from interface: DataSource
Returns the specified data element for this source. I'm using this instead of an iterator because direct access is much more efficient when trying to make tables of data.

Specified by:
getElement in interface DataSource
Parameters:
i - Which data element to return. Should be between 0 and getNumElements()-1.
Returns:
The selected element.

getNumElements

public int getNumElements()
Returns the number of data elements that this source has in it. I'm using this instead of an iterator because direct access is much more efficient when trying to make tables of data.

Specified by:
getNumElements in interface DataSource
Returns:
The number of data elements in this source.

relink

public void relink(java.util.Hashtable<GraphElement,GraphElement> linkHash)
Specified by:
relink in interface GraphElement

getPropertiesPanel

public javax.swing.JComponent getPropertiesPanel()
Specified by:
getPropertiesPanel in interface GraphElement

notifySinks

protected void notifySinks()

redo

public void redo()
Specified by:
redo in interface GraphElement

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

abstractRedoAllElements

protected void abstractRedoAllElements()

abstractRedo2

protected void abstractRedo2()

redoAllElements

protected abstract void redoAllElements()

setupSpecificPanelProperties

protected abstract void setupSpecificPanelProperties()

getOutputInfoPanel

protected OutputInfoPanel getOutputInfoPanel()