mascoptLib.gui
Class GraphChooser

java.lang.Object
  extended bymascoptLib.gui.GraphChooser

public class GraphChooser
extends Object

Choose a graph in a ReaderInterface, or in a file.

The goal is to make easy the process of choosing a graph. If you want to program an alogrithm and provide to the user a dialog box to choose a graph in a file, that's for you.


Constructor Summary
GraphChooser()
           
 
Method Summary
static String getFileName(String root, String[] filter, String ident, String actionText)
          Give a graphic way of choosing a file, with some parameters.
static AbstractGraph getGraph(ReaderInterface ri)
          Gives a graph read in a reader interface.
static Vector getGraph(ReaderInterface ri, int number)
          Returns a Vector containing the n graphs read on a ReaderInterface
static HashMap getGraphHashMapMGL()
          Put graphs in an HashMap with popups.
static HashMap getGraphHashMapMGL(String filename)
          Put graphs in an HashMap with popups.
static AbstractGraph getGraphMGL()
          Select a graph in an MGL file with popups.
static Vector getGraphMGL(int number)
          Deprecated. Please now use getGraphVector().
static AbstractGraph getGraphMGL(String file)
          Select a graph in an MGL file with popups.
static Vector getGraphMGL(String file, int number)
          Deprecated. Please now use getGraphVector(String file).
static Vector getGraphVectorMGL()
          Select the graphs in an MGL file with popups.
static Vector getGraphVectorMGL(String filename)
          Select the graphs in an MGL file with popups.
static MGLReader getMGLReader()
          Gives a reader interface via popups.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphChooser

public GraphChooser()
Method Detail

getGraph

public static Vector getGraph(ReaderInterface ri,
                              int number)
Returns a Vector containing the n graphs read on a ReaderInterface

Parameters:
number - the number of graphs to read.
ri - the reader interface.
Returns:
a Vector containins AbstractGraphs.

getGraph

public static AbstractGraph getGraph(ReaderInterface ri)
Gives a graph read in a reader interface. If there is more than one graph a popup window with the list of graphs is displayed. The user choose the graph and the program continues.

Parameters:
ri - the reader interface.
Returns:
an AbstractGraph.

getGraphMGL

public static AbstractGraph getGraphMGL()
Select a graph in an MGL file with popups. This methods provides a graphic way of selecting a graph. The user choose in a dialog box the file to read, then, if necessary, the graph to select in this file.

Returns:
the AbstractGraph selected.

getGraphMGL

public static Vector getGraphMGL(int number)
Deprecated. Please now use getGraphVector().

Select the Nst graph in an MGL file with popups. This methods provides a graphic way of selecting a graph. The user choose in a dialog box the file to read, then, the Nst graph is selected in this file.

Parameters:
number - the Nst graph number.
Returns:
the AbstractGraph selected.
See Also:
getGraphVectorMGL()

getGraphVectorMGL

public static Vector getGraphVectorMGL()
Select the graphs in an MGL file with popups. This methods provides a graphic way of selecting a graph. The user choose in a dialog box the file to read, then, a Vector containing all the graphs found in the selected file is returned.

Returns:
a Vector containing abstractGraphs.

getGraphMGL

public static AbstractGraph getGraphMGL(String file)
Select a graph in an MGL file with popups. This methods provides a graphic way of selecting a graph. It reads a file and then, If necessary, the graph to select in this file.

Parameters:
file - the MGL file to read
Returns:
the AbstractGraph selected.

getGraphMGL

public static Vector getGraphMGL(String file,
                                 int number)
Deprecated. Please now use getGraphVector(String file).

Select the Nst graph in an MGL file with popups. This methods provides a graphic way of selecting a graph. It reads a file and then, the Nst graph is selected in this file.

Parameters:
file - the MGL file to read
number - the Nst graph number.
Returns:
the AbstractGraph selected.
See Also:
getGraphVectorMGL(String file)

getGraphVectorMGL

public static Vector getGraphVectorMGL(String filename)
Select the graphs in an MGL file with popups. This methods provides a graphic way of selecting a graph. The user provides the name of a file file to read, then, a Vector containing all the graphs found in the selected file is returned.

Parameters:
filename - the name of a mgl file
Returns:
a Vector containing abstractGraphs.

getMGLReader

public static MGLReader getMGLReader()
Gives a reader interface via popups. This method popups a window where the user can choose a MGL file. Then it returns an MGLReader object to work with. Beware that the file has not yet been parsed !!

Returns:
an MGLReader object.

getFileName

public static String getFileName(String root,
                                 String[] filter,
                                 String ident,
                                 String actionText)
Give a graphic way of choosing a file, with some parameters. You can specify the root of the file, and some extensions.

Parameters:
root - the root of the filename that are allowed.
filter - the extensions allowed.
ident - the name of this type of files
actionText - the text that will be appear to the user.
Returns:
a String wich is the filename of the file choosen.

getGraphHashMapMGL

public static HashMap getGraphHashMapMGL()
Put graphs in an HashMap with popups. A popups give the ability to choose a file. Then each found graphs is put in the HashMap with key the name of the graph.

Returns:
an HashMap which key is the String name of the graph.

getGraphHashMapMGL

public static HashMap getGraphHashMapMGL(String filename)
Put graphs in an HashMap with popups. A popups give the ability to choose a file. Then each found graphs is put in the HashMap with key the name of the graph.

Parameters:
filename - the file to read
Returns:
an HashMap which key is the String name of the graph.