main
Class FunSiPGui

java.lang.Object
  extended by main.FunSiPGui
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.util.EventListener

public class FunSiPGui
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.WindowListener

This class consists of the building blocks for a graphical representation of the FunSiP program. Not only can FunSiPGui launch FunSiP from the GUI, it can also be used to edit configuration files or create new configuration files. This goal can be achieved by either giving all the values of a configuration file directly, or by using a wizard which delivers most of the available options in a nice and structured way. WARNING 1: The source-code of FunSiPGui is a spaghetti-mess, this has yet to be cleaned up, either by restructuring or by rewriting. WARNING 2: Because of its very tight connection with the FunSiP program itself, we have opted to give FunSiPGui the same version-code as FunSiP.

Author:
Michiel Van Bel

Constructor Summary
FunSiPGui()
          Constructor for the graphical framework.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 java.lang.String createConfigurationFile(java.lang.String fileName)
          Creates the configuration file, with the currently loaded SPRWorkflow object as content.
 FunSiPWorkflow getSPRWorkflow(java.lang.String fileName)
          This method tries to create a FunSiPWorkflow object (one of the basic building blocks of FunSiP) from a given configuration file.
static void main(java.lang.String[] args)
          Main method for FunSiPGui.
 void setNewConfiguration(java.lang.String newConfigurationFile)
          Sets a new configuration file as standard loaded configuration file.
 void setSprOutput(FunSiP spr, SprOutputPanel output)
          Changes the output of the supplied FunSiP program, according to the content of the output panel.
 void updateLabels()
          Updates all the labels in the current frame of the gui, according to the new state in which it is positioned (e.g. after changing the content of a configuration file, but not saving it, the gui will change).
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunSiPGui

public FunSiPGui()
Constructor for the graphical framework. Loads and configures all the necessary elements for a GUI.

Method Detail

main

public static void main(java.lang.String[] args)
Main method for FunSiPGui. Launches the program.

Parameters:
args - The supplied commandline parameters.

getSPRWorkflow

public FunSiPWorkflow getSPRWorkflow(java.lang.String fileName)
This method tries to create a FunSiPWorkflow object (one of the basic building blocks of FunSiP) from a given configuration file.

Parameters:
fileName - The filename of the configuration file containing the data from which the workflow-object should be built. Can be null, in which case a simple and empty FunSipWorkflow will be returned.
Returns:
The FunSiPWorkflow object that is built. Can be null of the parameter file parser was unable to extract the correct data from the supplied configuration file.

createConfigurationFile

public java.lang.String createConfigurationFile(java.lang.String fileName)
Creates the configuration file, with the currently loaded SPRWorkflow object as content.

Parameters:
fileName - The name of the configuration file
Returns:
The name of the configuration file. Can be null if the creation of the configuration file failed.

setSprOutput

public void setSprOutput(FunSiP spr,
                         SprOutputPanel output)
Changes the output of the supplied FunSiP program, according to the content of the output panel.

Parameters:
spr - The FunSiP program from which the output should be changed. Can be null, in which case nothing happens.
output - The content panel which has all the different options defined as how the output can be changed. Can be null, in which case nothing happens.

updateLabels

public void updateLabels()
Updates all the labels in the current frame of the gui, according to the new state in which it is positioned (e.g. after changing the content of a configuration file, but not saving it, the gui will change).


setNewConfiguration

public void setNewConfiguration(java.lang.String newConfigurationFile)
Sets a new configuration file as standard loaded configuration file.

Parameters:
newConfigurationFile - The name and location of the new configuration file.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener