brain.gui.ActionListeners
Class ActionListenerSaveParameters

java.lang.Object
  extended by brain.gui.ActionListeners.ActionListenerSaveParameters
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ActionListenerSaveParameters
extends java.lang.Object
implements java.awt.event.ActionListener

ActionListenerSaveParameters does handle saving the parameter table of a module. It offers a file chooser with a suggested, preselected name as the parameter file name. It does contain a FileFilter class for the file chooser so it would show only files ending with ".par". In case a user defined a different postfix the file filter might be forced in the dialog to show all types of files.


Constructor Summary
ActionListenerSaveParameters()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Opens a JFileChooser to select a file name.
 java.lang.String getDialogTitle()
          Returns JFileChooser title
 java.lang.String getSuggestFileName()
          Returns a suggested file name
 javax.swing.JTable getTable()
          Returns the table which parameters are to write to storage
 void setDialogTitle(java.lang.String _dialogTitle)
          Sets JFileChooser title.
 void setSuggestFileName(java.lang.String _suggestFileName)
          Sets a suggested file name
 void setTable(javax.swing.JTable _table)
          Sets the table with parameters whose data we want to write to storage.
static java.lang.String suggestName(java.lang.String moduleName)
          Just suggests a name for the parameter file to save.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionListenerSaveParameters

public ActionListenerSaveParameters()
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Opens a JFileChooser to select a file name. Saves, aborts or cancels this action according to user selection.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getTable

public javax.swing.JTable getTable()
Returns the table which parameters are to write to storage

Returns:
JTable which parameters are to save

setTable

public void setTable(javax.swing.JTable _table)
Sets the table with parameters whose data we want to write to storage.

Parameters:
_table - the table with parameters

suggestName

public static java.lang.String suggestName(java.lang.String moduleName)
Just suggests a name for the parameter file to save.

Parameters:
moduleName - name of a module
Returns:
a file name

getDialogTitle

public java.lang.String getDialogTitle()
Returns JFileChooser title

Returns:
dialog title

setDialogTitle

public void setDialogTitle(java.lang.String _dialogTitle)
Sets JFileChooser title.

Parameters:
_dialogTitle -

getSuggestFileName

public java.lang.String getSuggestFileName()
Returns a suggested file name

Returns:
a suggested file name

setSuggestFileName

public void setSuggestFileName(java.lang.String _suggestFileName)
Sets a suggested file name

Parameters:
_suggestFileName -