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.

Foudalis Ilias
Constructor Detail


public GeneratorFrame()
Class constructor.

Method Detail


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


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


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


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


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.


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.


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.


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.


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


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.
e - ListSelectionEvent


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.


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.
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.


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.


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


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