edu.jhu.ece.iacl.jist.pipeline
Class PipeLayout

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.pipeline.PipeLayout

public class PipeLayout
extends java.lang.Object

Pipe Layout stores all information necessary to construct the pipe graph and layout preferences.

Author:
Blake Lucas

Nested Class Summary
static class PipeLayout.RunParameters
          The Class RunParameters.
 
Field Summary
protected  boolean dirty
          flag to indicate whether the layout has changed and needs to be saved.
protected  java.io.File file
          file location for this layout.
protected  boolean initializing
          flag indicating that layout is initializing and should not be edited.
protected  long lastModified
          Time for when the file was last modified.
protected  PipeLayout.RunParameters params
          Layout preferences.
protected  java.util.Vector<PipeModule> pipes
          List of all modules for this layout.
protected  PipeScheduler scheduler
          scheduler used to schedule execution of this layout.
 
Constructor Summary
PipeLayout()
          Instantiates a new pipe layout.
PipeLayout(PipeAlgorithm algo)
          Instantiates a new pipe layout.
PipeLayout(PipeInternalFrame frame)
          The Constructor.
 
Method Summary
 void add(PipeModule mod)
          Add module to layout.
static PipeLayout clean(PipeLayout layout)
          Clean.
 boolean close()
          Ask user if they want to save before closing layout.
static PipeLayout fromXML(java.lang.String str)
          Reconstruct layout from string.
 java.util.Vector<PipeModule> getAllDescendantPipes()
          Get all modules including parents and children.
 java.util.Vector<PipeModule> getAllLeafPipes()
          Get all leaf modules.
 java.io.File getFileLocation()
          Returns file location for this layout.
 long getLastModifiedTime()
          Gets the last modified time.
 ParamModel getModuleInputParam(java.lang.String name)
          Get input parameters for particular module by identifying name.
 ParamModel getModuleOutputParam(java.lang.String name)
          Get module output parameters.
 java.util.Vector<PipeModule> getPipes()
          Get all modules for this layout.
 PipeLayout.RunParameters getRunParameters()
          Runt.
 PipeScheduler getScheduler()
          Get scheduler.
 java.lang.String getTitle()
          Get title of layout.
 void init()
          Initialize transient fields that could not be deserialized.
 void init(PipeJGraph graph, javax.swing.ProgressMonitor monitor)
          Initialize transient fields that could not be deserialized.
 boolean isCurrent()
          Detect if current version of layout is most current.
 boolean isDirty()
          Returns true if layout has changed since last save.
 boolean isInitializing()
          Returns true if layout is initializing and should not be edited.
static PipeLayout open()
          Create "Open Dialog".
static PipeLayout open(java.awt.Component parent)
          Create "Open Dialog".
static PipeLayout read(java.io.File f)
          Read layout from file.
 void remove(PipeModule mod)
          Remove module from layout.
static void replacePath(PipeLayout layout, java.io.File origDir, java.io.File replaceDir)
          Replace path.
 boolean save(boolean commit)
          Open "Save" dialog.
 boolean saveAs()
          Open "Save As" dialog.
 boolean saveAs(boolean commit)
          Open "Save As" dialog.
 void setDirty(boolean dirty)
          Indicate that the layout has changed since last save.
 void setFileLocation(java.io.File file)
          Set file location for this layout.
 void setFrame(PipeInternalFrame parent)
          Set frame used to render this layout.
 void setInputDir(java.io.File f)
          Set root input directory.
 void setInputDir(java.net.URI f)
          Set root input directory.
 void setMaxHeap(int heap)
          Set maximum allowable heap.
 void setMaxProcs(int procs)
          Set maximum allowable simultaneous processes.
 void setNamingConvention(JistPreferences.NamingConvention convention)
          Set naming convention for output directory.
 void setOutputDir(java.io.File f)
          Set root output directory.
 void setOutputDir(java.net.URI f)
          Set root output directory.
 void setRunParams(PipeLayout.RunParameters runParams)
          Set runtime parameters.
 void setScheduler(PipeScheduler scheduler)
          Set scheduler.
 void setUseGridEngine(boolean useGrid)
          Sets the use grid engine.
 java.lang.String toXML()
          Serialize class as XML.
 void ungroup(PipeAlgorithmGroup mod)
          Ungroup module group.
 boolean write(java.io.File f, boolean commit)
          Write layout to file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

params

protected PipeLayout.RunParameters params
Layout preferences.


pipes

protected java.util.Vector<PipeModule> pipes
List of all modules for this layout.


file

protected transient java.io.File file
file location for this layout.


dirty

protected transient boolean dirty
flag to indicate whether the layout has changed and needs to be saved.


scheduler

protected transient PipeScheduler scheduler
scheduler used to schedule execution of this layout.


initializing

protected transient boolean initializing
flag indicating that layout is initializing and should not be edited.


lastModified

protected transient long lastModified
Time for when the file was last modified.

Constructor Detail

PipeLayout

public PipeLayout()
Instantiates a new pipe layout.


PipeLayout

public PipeLayout(PipeAlgorithm algo)
Instantiates a new pipe layout.

Parameters:
algo - the algorithm

PipeLayout

public PipeLayout(PipeInternalFrame frame)
The Constructor.

Parameters:
frame - Bind layout to specified frame
Method Detail

fromXML

public static PipeLayout fromXML(java.lang.String str)
Reconstruct layout from string.

Parameters:
str - XML string
Returns:
layout from string

open

public static PipeLayout open()
Create "Open Dialog".

Returns:
the pipe layout

open

public static PipeLayout open(java.awt.Component parent)
Create "Open Dialog".

Parameters:
parent - Parent component
Returns:
the pipe layout

read

public static PipeLayout read(java.io.File f)
Read layout from file.

Parameters:
f - layout location
Returns:
layout

isCurrent

public boolean isCurrent()
Detect if current version of layout is most current.

Returns:
true, if checks if is current

getLastModifiedTime

public long getLastModifiedTime()
Gets the last modified time.

Returns:
the last modified time

add

public void add(PipeModule mod)
Add module to layout.

Parameters:
mod - module

close

public boolean close()
Ask user if they want to save before closing layout.

Returns:
true if window should be disposed.

getAllDescendantPipes

public java.util.Vector<PipeModule> getAllDescendantPipes()
Get all modules including parents and children.

Returns:
the all descendant pipes

getAllLeafPipes

public java.util.Vector<PipeModule> getAllLeafPipes()
Get all leaf modules.

Returns:
leaf modules

getFileLocation

public java.io.File getFileLocation()
Returns file location for this layout.

Returns:
layout location

getModuleInputParam

public ParamModel getModuleInputParam(java.lang.String name)
Get input parameters for particular module by identifying name.

Parameters:
name - identifying name
Returns:
input parameter

getModuleOutputParam

public ParamModel getModuleOutputParam(java.lang.String name)
Get module output parameters.

Parameters:
name - identifying name
Returns:
input parameter

getPipes

public java.util.Vector<PipeModule> getPipes()
Get all modules for this layout.

Returns:
modules

getRunParameters

public PipeLayout.RunParameters getRunParameters()
Runt.

Returns:
the run parameters

getScheduler

public PipeScheduler getScheduler()
Get scheduler.

Returns:
scheduler

getTitle

public java.lang.String getTitle()
Get title of layout. Add asterisk if layout has been modified since last change

Returns:
the title

init

public void init()
Initialize transient fields that could not be deserialized.


init

public void init(PipeJGraph graph,
                 javax.swing.ProgressMonitor monitor)
Initialize transient fields that could not be deserialized.

Parameters:
graph - Layout graph if one is available, null otherwise
monitor - the monitor

isDirty

public boolean isDirty()
Returns true if layout has changed since last save.

Returns:
true if changes made

isInitializing

public boolean isInitializing()
Returns true if layout is initializing and should not be edited.

Returns:
true if initializing

remove

public void remove(PipeModule mod)
Remove module from layout.

Parameters:
mod - module

save

public boolean save(boolean commit)
Open "Save" dialog.

Parameters:
commit - Force layout to commit input parameters from parameter pane before saving
Returns:
true, if save

saveAs

public boolean saveAs()
Open "Save As" dialog.

Returns:
true, if save as

saveAs

public boolean saveAs(boolean commit)
Open "Save As" dialog.

Parameters:
commit - Force layout to commit input parameters from parameter pane before saving
Returns:
true, if save as

setDirty

public void setDirty(boolean dirty)
Indicate that the layout has changed since last save.

Parameters:
dirty - true if layout has changed

setFileLocation

public void setFileLocation(java.io.File file)
Set file location for this layout.

Parameters:
file - layout location

setFrame

public void setFrame(PipeInternalFrame parent)
Set frame used to render this layout.

Parameters:
parent - internal frame

setInputDir

public void setInputDir(java.io.File f)
Set root input directory.

Parameters:
f - root input directory

setInputDir

public void setInputDir(java.net.URI f)
Set root input directory.

Parameters:
f - root input directory

setMaxHeap

public void setMaxHeap(int heap)
Set maximum allowable heap.

Parameters:
heap - maximum heap size

setMaxProcs

public void setMaxProcs(int procs)
Set maximum allowable simultaneous processes.

Parameters:
procs - maximum number of processes

setNamingConvention

public void setNamingConvention(JistPreferences.NamingConvention convention)
Set naming convention for output directory.

Parameters:
convention - naming convention

setUseGridEngine

public void setUseGridEngine(boolean useGrid)
Sets the use grid engine.

Parameters:
useGrid - the new use grid engine

setOutputDir

public void setOutputDir(java.io.File f)
Set root output directory.

Parameters:
f - root output directory

setOutputDir

public void setOutputDir(java.net.URI f)
Set root output directory.

Parameters:
f - root output directory

setRunParams

public void setRunParams(PipeLayout.RunParameters runParams)
Set runtime parameters.

Parameters:
runParams - runtime parameters

setScheduler

public void setScheduler(PipeScheduler scheduler)
Set scheduler.

Parameters:
scheduler - scheduler

toXML

public java.lang.String toXML()
Serialize class as XML.

Returns:
the string

ungroup

public void ungroup(PipeAlgorithmGroup mod)
Ungroup module group.

Parameters:
mod - module group

clean

public static PipeLayout clean(PipeLayout layout)
Clean.

Parameters:
layout - the layout
Returns:
the pipe layout

replacePath

public static void replacePath(PipeLayout layout,
                               java.io.File origDir,
                               java.io.File replaceDir)
Replace path.

Parameters:
layout - the layout
origDir - the orig dir
replaceDir - the replace dir

write

public boolean write(java.io.File f,
                     boolean commit)
Write layout to file.

Parameters:
f - output file
commit - Force layout commit current values in parameter pane before saving
Returns:
true, if write