be.ac.ulg.montefiore.run.totem.visualtopo.facade
Class GUIManager

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.visualtopo.facade.GUIManager

public class GUIManager
extends java.lang.Object

This class is used to manage most interractions between TOTEM and the GUI.

Creation date: 10-Jan-2005

Author:
Olivier Materne (O.Materne@student.ulg.ac.be), Gael Monfort (monfort@run.montefiore.ulg.ac.be)

Field Summary
static int TOPO_NOT_LOADED
           
 
Method Summary
 void addDemandMatrix(java.io.File mFile)
          Load DemandMatrix from file and add it to the TrafficMatrixManager TrafficMatrix file must match one of the loaded domain.
 void closeDomain(int ASID)
          Remove the Domain from InterDomainManager and display another one (if exists).
 Domain getCurrentDomain()
          Returns the Domain currently loaded in the GUI
static GUIManager getInstance()
          Use this method to get an instance of GUIManager since the constructor is private
 java.util.List<java.lang.Integer> getManagedMatrices()
          Return a list of matrices TMID.
 java.lang.String getName()
          This methods return the current topology name (the domain URI)
 java.lang.String[] getNodesList()
          A method that returns all topology nodes in a vector
 int loadTopology(java.io.File tFile)
           
 void openDomain(Domain domain)
          Load given domain in the InterDomainManager and Display it in the GUI If domain is null, do nothing.
 void openDomainReplace(Domain domain)
          Load given domain in the InterDomainManager and Display it in the GUI.
 void removeTrafficMatrices()
          Remove all matrices currently managed (all matrices for the domain displayed)
 void removeTrafficMatrix(int tmid)
          Remove Traffic Matrix with the specified tmid from both Gui and TrafficMatrixManager
 void saveTopo()
          Called by the actionlistener when the save Button in the menubar is pressed, this method call a chooser and then save the topology in the selected file.
 void saveTrafficMatrix(int tmid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOPO_NOT_LOADED

public static final int TOPO_NOT_LOADED
See Also:
Constant Field Values
Method Detail

getInstance

public static GUIManager getInstance()
Use this method to get an instance of GUIManager since the constructor is private

Returns:
returns an instance of GUIManager

getCurrentDomain

public Domain getCurrentDomain()
Returns the Domain currently loaded in the GUI

Returns:
the Domain currently loaded in the GUI

loadTopology

public int loadTopology(java.io.File tFile)
                 throws InvalidDomainException,
                        DomainAlreadyExistException
Throws:
InvalidDomainException
DomainAlreadyExistException

openDomain

public void openDomain(Domain domain)
                throws DomainAlreadyExistException
Load given domain in the InterDomainManager and Display it in the GUI If domain is null, do nothing.

Parameters:
domain -
Throws:
DomainAlreadyExistException - if a domain with same ASID is already in the InterDomainManager

openDomainReplace

public void openDomainReplace(Domain domain)
Load given domain in the InterDomainManager and Display it in the GUI. If the domain is already in InterDomainManager, it'll be replaced by the given one. If domain is null, do nothing.

Parameters:
domain -

closeDomain

public void closeDomain(int ASID)
Remove the Domain from InterDomainManager and display another one (if exists).

Parameters:
ASID -

addDemandMatrix

public void addDemandMatrix(java.io.File mFile)
Load DemandMatrix from file and add it to the TrafficMatrixManager TrafficMatrix file must match one of the loaded domain.

Parameters:
mFile - the File from which the matrix will be loaded

removeTrafficMatrices

public void removeTrafficMatrices()
Remove all matrices currently managed (all matrices for the domain displayed)


removeTrafficMatrix

public void removeTrafficMatrix(int tmid)
Remove Traffic Matrix with the specified tmid from both Gui and TrafficMatrixManager

Parameters:
tmid - the matrix to be removed

saveTrafficMatrix

public void saveTrafficMatrix(int tmid)

saveTopo

public void saveTopo()
Called by the actionlistener when the save Button in the menubar is pressed, this method call a chooser and then save the topology in the selected file.


getName

public java.lang.String getName()
This methods return the current topology name (the domain URI)

Returns:
current domain name

getNodesList

public java.lang.String[] getNodesList()
A method that returns all topology nodes in a vector

Returns:
returns vector containing containing IDs of the node of the current domain

getManagedMatrices

public java.util.List<java.lang.Integer> getManagedMatrices()
Return a list of matrices TMID. All these matrices are compatible with the currently selected Domain and were previously loaded from the gui.

Returns:
a list of matrices TMID


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.