Pandora
Class GeneratorFrame

public class GeneratorFrame
extends javax.swing.JFrame

This is the main class of the Pandora program.

To add a new model in the generator, one has to add some code in this class. Specifically the model name should be added at the String[] variable called modelNames ( this causes the model name to be added to the JList models from which we select which model we want to use. After creating a class that will be the implementation of the desired model, the object of the class should be declared at the end of the GeneratorFrame variables section. Finaly add the model at getSelectedModel function like all the other models are added.

Version:
0.1
Author:
Foudalis Ilias
Constructor Detail

GeneratorFrame

public GeneratorFrame()
Class constructor.

Method Detail

main

public static void main(java.lang.String[] args)
Main class of the program.
Parameters:
args - String[].

jbInit

private void jbInit()
Method automaticaly generated by JBuilder. Used to initialize the graphics.

JMenuItemAnalizer_actionPerformed

private void JMenuItemAnalizer_actionPerformed()
This method opens the Pandora Analyzer.

resetDrawPanel

private void resetDrawPanel()
Method that resets the state of the DrawPanel so that we can paint a new graph.

JButtonGraphGeneration_actionPerformed

public void JButtonGraphGeneration_actionPerformed()
If a model is selected, when the graph generation button is pressed, this method will invoke a new thread that will create the graph of the model.

createGraph

public void createGraph()
This method is actually a thread called from JButtonGraphGeneration_actionPerformed and it is responsible for creating the graph depending on the model selected by the user.

JButtonStepByStep_actionPerformed

public void JButtonStepByStep_actionPerformed()
Method called when button step by step is pressed. It initializes the graph creation process and waits for the user to press the next step.

JButtonNextStep_actionPerformed

public void JButtonNextStep_actionPerformed()
Method called when the >> ( next step ) button is pressed. This method works like createGraph but adds one node every time the button is pressed.

JButtonStopCreation_actionPerformed

public void JButtonStopCreation_actionPerformed()
Method called when stop creation button is pressed. This method terminates the creation of a graph.

getSelectedModel

private void getSelectedModel(javax.swing.event.ListSelectionEvent e)
This method is used to get the current model and start a new instance of a model. Users of the program that want to implement a new model have to add some code here.
Parameters:
e - ListSelectionEvent

JButtonSaveGraphImage_actionPerformed

public void JButtonSaveGraphImage_actionPerformed()
Method that opens a JFileChooser and enables the user to select where to save the image of the graph that he/she created.

saveImage

private void saveImage(javax.swing.JPanel panel,
                       java.lang.String filename)
Method used to save an image as a .gif file. This Method is called from JButtonSaveGraphImage_actionPerformed.
Parameters:
panel - JPanel : The JPanel that we want to convert and save as a .gif file.
filename - String : The path in which the image will be saved.

JButtonLoadTopo_actionPerformed

public void JButtonLoadTopo_actionPerformed()
Method that calls the ImportParser and loads a previously generated topology in the generator. Currently .pnd , .inet and .topgen files are supported.

JButtonDrawTopo_actionPerformed

public void JButtonDrawTopo_actionPerformed()
Method used to draw a previously generated topology that has been imported from a file.

JButtonExportGraphData_actionPerformed

public void JButtonExportGraphData_actionPerformed()
Method used to save the graph data of the graph that is currently generated.