|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JDialogScriptableBase edu.jhu.ece.iacl.jist.pipeline.ProcessingDialog
public class ProcessingDialog
Processing Dialog is a generic class that replaces all MIPAV plug-in dialogs The dialogs are auto-generated based on the input and output parameters. This class should not be extended. Any changes to this class will appear globally across all plug-ins.
Field Summary | |
---|---|
protected ProcessingAlgorithm |
algorithm
processing algorithm |
protected javax.swing.JPanel |
buttonPanel
Panel for pushing buttons. |
protected ParamInputView |
inputView
View for input parameters. |
protected ParamOutputView |
outputView
View for output parameters. |
protected static java.util.regex.Pattern |
paramInfoRegex
Regular expression to find parameter information in a string *. |
protected static java.lang.String |
paramListDelimiter
Delimeter used for parameters *. |
protected ViewJFrameBase |
parentFrame
parent MIPAV frame. |
protected static long |
serialVersionUID
The Constant serialVersionUID. |
Constructor Summary | |
---|---|
ProcessingDialog()
Empty constructor needed for dynamic instantiation. |
|
ProcessingDialog(ProcessingAlgorithm algorithm)
Constructor creates input and output parameters from algorithm and uses the algorithm name as title. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Handle action events. |
void |
algorithmPerformed(AlgorithmBase algo)
Handle the termination of the algorithm. |
protected javax.swing.JPanel |
buildInputButtons()
Build buttons that will appear on input pane. |
protected javax.swing.JPanel |
buildOutputButtons()
Build buttons that will appear on output pane. |
void |
callAlgorithm()
Start the algorithm; but first, save the input parameters as defaults. |
void |
clickClose()
Handle event when user clicks "Close". |
boolean |
clickOk()
Handle event when user clicks "OK". |
boolean |
clickOpen(java.io.File file)
Handle event when user clicks "Open". |
void |
clickSaveAll(java.io.File saveDir)
Handle event when user clicks "Save Parameters and Resources". |
void |
clickSaveDefinition(java.io.File saveFile)
Handle event when user clicks "Save As Module Definition". |
void |
clickSaveInput(java.io.File saveFile)
Handle event when user clicks "Save As Algorithm Input". |
void |
componentHidden(java.awt.event.ComponentEvent arg0)
|
void |
componentMoved(java.awt.event.ComponentEvent arg0)
|
void |
componentResized(java.awt.event.ComponentEvent event)
Shameless hack to circumvent bug in linux implementation that prevents window from being resized. |
void |
componentShown(java.awt.event.ComponentEvent arg0)
|
protected void |
createInputDialog()
Create input dialog frame from input parameters. |
javax.swing.JMenuBar |
createInputMenuBar()
Create menubar for input pane. |
void |
dispose()
Dispose of dialog. |
protected void |
doPostAlgorithmActions()
Store result images in script runner. |
ParamInputView |
getInputView()
Get input view. |
ParamOutputView |
getOutputView()
Get output view. |
ViewJFrameBase |
getParentFrame()
Get parent frame for Mipav. |
void |
init(java.io.File pipeFile)
Initialize parameters and algorithm from file. |
void |
init(PipeAlgorithm pipe)
Initialize parameter and algorithm from existing algorithm. |
boolean |
load(java.io.File file)
Loads algorithm input profile from specified location into input parameters. |
void |
loadDefaults()
Load defaults from MIPAV preferences. |
protected boolean |
saveAll(java.io.File saveDir)
Save all input and output parameters and their external resources. |
void |
saveDefaults()
Saves input dialog settings to XML file. |
protected boolean |
saveInput(java.io.File saveFile)
Save all input parameters to specified file. |
protected boolean |
saveInputBeforeRun()
Save all input params after run so that inputs can be checked for current consistency 2009.06.21 DO NOT SAVE INPUTs after run |
protected java.io.File |
selectSaveDirectory()
Open dialog to specify output directory for parameters. |
protected void |
setGUIFromParams()
Set up the dialog GUI based on the parameters before running the algorithm as part of a script. |
void |
setOutputDirectory(java.io.File f)
Set directory to store output results. |
void |
setParentFrame(ViewJFrameBase parentFrame)
Set parent MIPAV frame. |
void |
start()
Start dialog with input parameters from algorithm. |
protected void |
storeParamsFromGUI()
Store the parameters from the dialog to record the execution of this algorithm. |
void |
update(ParamModel model,
ParamInputView view)
An update to the parameters occurred. |
void |
windowClosing(java.awt.event.WindowEvent e)
Make sure all threads shutdown when window is closed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final long serialVersionUID
protected static final java.util.regex.Pattern paramInfoRegex
protected static final java.lang.String paramListDelimiter
protected ParamInputView inputView
protected ParamOutputView outputView
protected ViewJFrameBase parentFrame
protected ProcessingAlgorithm algorithm
protected javax.swing.JPanel buttonPanel
Constructor Detail |
---|
public ProcessingDialog()
public ProcessingDialog(ProcessingAlgorithm algorithm)
algorithm
- the algorithmMethod Detail |
---|
public void actionPerformed(java.awt.event.ActionEvent event)
event
- dialog eventspublic void algorithmPerformed(AlgorithmBase algo)
algo
- algorithmprotected javax.swing.JPanel buildInputButtons()
protected javax.swing.JPanel buildOutputButtons()
public void callAlgorithm()
public void clickClose()
public boolean clickOk()
public boolean clickOpen(java.io.File file)
file
- the file
public void clickSaveAll(java.io.File saveDir)
saveDir
- the save dirpublic void clickSaveDefinition(java.io.File saveFile)
saveFile
- the save filepublic void clickSaveInput(java.io.File saveFile)
saveFile
- the save filepublic void componentHidden(java.awt.event.ComponentEvent arg0)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent arg0)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent event)
componentResized
in interface java.awt.event.ComponentListener
event
- the eventpublic void componentShown(java.awt.event.ComponentEvent arg0)
componentShown
in interface java.awt.event.ComponentListener
protected void createInputDialog()
public javax.swing.JMenuBar createInputMenuBar()
public void dispose()
protected void doPostAlgorithmActions()
public ParamInputView getInputView()
public ParamOutputView getOutputView()
public ViewJFrameBase getParentFrame()
public void init(java.io.File pipeFile)
pipeFile
- pipe filepublic void init(PipeAlgorithm pipe)
pipe
- algorithmpublic boolean load(java.io.File file)
file
- the file
public void loadDefaults()
protected boolean saveAll(java.io.File saveDir)
saveDir
- the save dir
protected boolean saveInputBeforeRun()
saveDir
- the save dir
public void saveDefaults()
protected boolean saveInput(java.io.File saveFile)
saveFile
- the save file
protected java.io.File selectSaveDirectory()
protected void setGUIFromParams()
public void setOutputDirectory(java.io.File f)
f
- output directorypublic void setParentFrame(ViewJFrameBase parentFrame)
parentFrame
- the parent framepublic void start()
protected void storeParamsFromGUI() throws ParserException
ParserException
- If there is a problem creating one of the new parameters.public void update(ParamModel model, ParamInputView view)
update
in interface ParamViewObserver
model
- parameterview
- input viewpublic void windowClosing(java.awt.event.WindowEvent e)
e
- window event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |