unbbayes.controller
Class MainController

java.lang.Object
  extended by unbbayes.controller.MainController

public class MainController
extends Object

This class is responsible for creating, loading and saving networks supported by UnBBayes.

Version:
1.5 2006/09/14
Author:
Rommel Novaes Carvalho, Michael S. Onishi

Constructor Summary
MainController()
          Contructs the main controller with the UnBBayes main frame.
 
Method Summary
 void loadConfigurations()
          Load the configuration file and setting the configurations object in the ConfigurationsController.
 UnBBayesModule loadNet(File file, UnBBayesModule moduleToUse)
          Loads the probabilistic network from both .net and .xml format, depending on the file's extension
 ProbabilisticNetwork makeProbabilisticNetwork(ArrayList<Node> nodeList)
          Method responsible for creating a network based on its variables.
 void newPN()
          This method is responsible for creating a new probabilistic network.
 void saveConfigurations()
           
 boolean saveNet(File file, BaseIO ioToUse, Graph graphToSave)
          Saves the probabilistic network using the given IO class.
 boolean saveNet(File file, UnBBayesModule moduleToUse)
          Saves the probabilistic network in both .net and .xml format, depending on the file's extension.
 void showProbabilisticNetwork(ProbabilisticNetwork net)
          Shows the given probabilistic network in edition or compilation mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainController

public MainController()
Contructs the main controller with the UnBBayes main frame.

Method Detail

loadConfigurations

public void loadConfigurations()
                        throws IOException
Load the configuration file and setting the configurations object in the ConfigurationsController.

Throws:
IOException - Exception try to read the configurations file

saveConfigurations

public void saveConfigurations()
                        throws IOException
Throws:
IOException

newPN

public void newPN()
This method is responsible for creating a new probabilistic network.


saveNet

public boolean saveNet(File file,
                       UnBBayesModule moduleToUse)
                throws NoObjectToBeSavedException,
                       InvalidFileNameException,
                       FileNotFoundException,
                       IOException,
                       Exception
Saves the probabilistic network in both .net and .xml format, depending on the file's extension.

Parameters:
file - The file where to save the network.
moduleToUse - : what module/plugin we shall use in order to store the file
Throws:
javax.xml.bind.JAXBException
IOException - : it can throw FileExtensionIODelegator.MoreThanOneCompatibleIOException if the module uses FileExtensionIODelegator and when 2 or more IO class can manage the same file.
FileNotFoundException
NoObjectToBeSavedException
InvalidFileNameException
Exception

saveNet

public boolean saveNet(File file,
                       BaseIO ioToUse,
                       Graph graphToSave)
                throws IOException
Saves the probabilistic network using the given IO class.

Parameters:
file - The file where to save the network.
ioToUse - : this is the single IO class to be used
graphToSave -
Throws:
IOException

loadNet

public UnBBayesModule loadNet(File file,
                              UnBBayesModule moduleToUse)
                       throws IOException
Loads the probabilistic network from both .net and .xml format, depending on the file's extension

Parameters:
file - : file to load
moduleToUse - : the module/plugin to use in order to load file.
Returns:
the new created module filled the network described by file
Throws:
IOException

makeProbabilisticNetwork

public ProbabilisticNetwork makeProbabilisticNetwork(ArrayList<Node> nodeList)
Method responsible for creating a network based on its variables.

Parameters:
nodeList - List of nodes to create the network.
Returns:
The probabilistic network created.

showProbabilisticNetwork

public void showProbabilisticNetwork(ProbabilisticNetwork net)
Shows the given probabilistic network in edition or compilation mode.

Parameters:
net -


Copyright © 2001-2010 University of Brasilia - UnB. All Rights Reserved.