org.simbrain.network
Class NetworkSerializer

java.lang.Object
  extended by org.simbrain.network.NetworkSerializer

 class NetworkSerializer
extends Object

NetworkSerializer contains the code for reading and writing network files.


Field Summary
static String FS
          File Separator constant.
 
Constructor Summary
NetworkSerializer(NetworkPanel parent)
          Construct the serializer object.
 
Method Summary
 String getCurrentDirectory()
           
 File getCurrentFile()
          Get a reference to the current network file.
 void readNetwork(File f)
          Read a network in from a File object.
 boolean showOpenFileDialog()
          Show the dialog for choosing a network to open.
 void showSaveFileDialog()
          Show the dialog for saving a network.
 void writeNet(File theFile)
          Saves network information to the specified file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FS

public static final String FS
File Separator constant.

Constructor Detail

NetworkSerializer

public NetworkSerializer(NetworkPanel parent)
Construct the serializer object.

Parameters:
parent - reference to the panel containing the network to be saved
Method Detail

showOpenFileDialog

public boolean showOpenFileDialog()
Show the dialog for choosing a network to open.

Returns:
true if file exists

readNetwork

public void readNetwork(File f)
Read a network in from a File object.

Parameters:
f - file to read.

showSaveFileDialog

public void showSaveFileDialog()
Show the dialog for saving a network.


writeNet

public void writeNet(File theFile)
Saves network information to the specified file.

Parameters:
theFile - the file to save the network to.

getCurrentFile

public File getCurrentFile()
Get a reference to the current network file.

Returns:
a reference to the current network file

getCurrentDirectory

public String getCurrentDirectory()
Returns:
Returns the currentDirectory.