ch.epfl.craft.magmap
Class MagMapMainFrame

java.lang.Object
  extended bych.epfl.craft.magmap.MagMapMainFrame

public class MagMapMainFrame
extends java.lang.Object

This is the main "frame" of the MagMap application. It uses the applet contentPane to layout the elements.

The core of this class is the instantiation of the MagnetView which requires to load the data, prepare the models, the renderers etc.

The file was generated automatically by JBuilder, which has a nice GUI editor. This might gives the code of this class a frightening look, but this is mainly only tons of GUI initialisations.

There is however some unusual initialization due to the use of GlazedGists library that enable live filtering

Version:
1.0
Author:
Jerome Caffaro

Nested Class Summary
 class MagMapMainFrame.MyList
          Provide a kind of bug fix the the behaviour of JList when it has to handle drag and drop: it is usually not possible to drag a row if it has not been selected.
 
Field Summary
 javax.swing.JEditorPane detailsPane
           
 
Constructor Summary
MagMapMainFrame(javax.swing.JApplet enclosingApplet)
          Constructor of the GUI
 
Method Summary
 void exportToConstraintDot()
          Exports the view as dot file.
 void exportToJpeg()
          Exports the view as jpeg image
 void jButtonDebug_actionPerformed(java.awt.event.ActionEvent e)
          Debug button | Print the list of nodes in the view
 void jButtonDemagnetizeAll_actionPerformed(java.awt.event.ActionEvent e)
          Demagnetize All button/menu | Remove all magnetic nodes in the view
 void jMenuDebugWindow_actionPerformed(java.awt.event.ActionEvent e)
          Debug | Open debug window action performed
 void jMenuFileExit_actionPerformed(java.awt.event.ActionEvent e)
          File | Exit action performed
 void jMenuFileLoadData_actionPerformed(java.awt.event.ActionEvent e)
          File | Load Data action performed
 void jMenuFileSaveConstraintDot_actionPerformed(java.awt.event.ActionEvent e)
          File | Save as Constraint dot (position of nodes are constraint)
 void jMenuFileSaveJpeg_actionPerformed(java.awt.event.ActionEvent e)
          File | Save as Jpeg
 void jMenuHelp_actionPerformed(java.awt.event.ActionEvent e)
          Help button action performed
 void jMenuHelpAbout_actionPerformed(java.awt.event.ActionEvent e)
          Help | About action performed
 void loadData(java.lang.String pathToCorpus, java.lang.String pathToSimilarityMatrix)
          Loads the data in the frame.
 void toggleDisplayForceField_actionPerformed(java.awt.event.ActionEvent e)
          Toggle Force Field visibility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

detailsPane

public javax.swing.JEditorPane detailsPane
Constructor Detail

MagMapMainFrame

public MagMapMainFrame(javax.swing.JApplet enclosingApplet)
Constructor of the GUI

Parameters:
enclosingApplet - the applet on which we lay out the GUI elements
Method Detail

loadData

public void loadData(java.lang.String pathToCorpus,
                     java.lang.String pathToSimilarityMatrix)
Loads the data in the frame. Will show a progress status under the form of ProgressMonitor when run standalone, or a simpler JDialog when run as applet. This duplication is necessary since applets do not behave the same as applications and ProgressMonitor are better because they can cancel the task

Parameters:
pathToCorpus - the path to the corpus data (blogs)
pathToSimilarityMatrix - the path to the similarity matrix

jMenuFileExit_actionPerformed

public void jMenuFileExit_actionPerformed(java.awt.event.ActionEvent e)
File | Exit action performed

Parameters:
e - the event associated with the action

jMenuFileLoadData_actionPerformed

public void jMenuFileLoadData_actionPerformed(java.awt.event.ActionEvent e)
File | Load Data action performed

Parameters:
e - the event associated with the action

jMenuFileSaveJpeg_actionPerformed

public void jMenuFileSaveJpeg_actionPerformed(java.awt.event.ActionEvent e)
File | Save as Jpeg

Parameters:
e - the event associated with the action

jMenuFileSaveConstraintDot_actionPerformed

public void jMenuFileSaveConstraintDot_actionPerformed(java.awt.event.ActionEvent e)
File | Save as Constraint dot (position of nodes are constraint)

Parameters:
e - the event associated with the action

jMenuHelp_actionPerformed

public void jMenuHelp_actionPerformed(java.awt.event.ActionEvent e)
Help button action performed

Parameters:
e - the event associated with the action

jMenuHelpAbout_actionPerformed

public void jMenuHelpAbout_actionPerformed(java.awt.event.ActionEvent e)
Help | About action performed

Parameters:
e - the event associated with the action

jMenuDebugWindow_actionPerformed

public void jMenuDebugWindow_actionPerformed(java.awt.event.ActionEvent e)
Debug | Open debug window action performed

Parameters:
e - the event associated with the action

toggleDisplayForceField_actionPerformed

public void toggleDisplayForceField_actionPerformed(java.awt.event.ActionEvent e)
Toggle Force Field visibility

Parameters:
e - the event associated with the action

jButtonDemagnetizeAll_actionPerformed

public void jButtonDemagnetizeAll_actionPerformed(java.awt.event.ActionEvent e)
Demagnetize All button/menu | Remove all magnetic nodes in the view

Parameters:
e - the event associated with the action

jButtonDebug_actionPerformed

public void jButtonDebug_actionPerformed(java.awt.event.ActionEvent e)
Debug button | Print the list of nodes in the view

Parameters:
e - the event associated with the action

exportToJpeg

public void exportToJpeg()
Exports the view as jpeg image


exportToConstraintDot

public void exportToConstraintDot()
Exports the view as dot file. BETA: Node are inversed node origin are centered in dot, while here it is at the upper left corner, etc..



Copyright © CRAFT EPFL. All Rights Reserved.