it.unibz.gui
Class OpenFileDialog

java.lang.Object
  extended by it.unibz.gui.OpenFileDialog

public class OpenFileDialog
extends java.lang.Object

A GUI Dialog to let user choose a file, that lets us filter only the extensions we decide (in our case, .arff files)


Field Summary
private  java.lang.String filePath
          Contain the full path of the file chosen
private  boolean isFileSelected
          State variable, true when a file is selected
private static javax.swing.JFileChooser jFileChooser
          Swing default File Chooser dialog
 
Constructor Summary
OpenFileDialog()
          The constructor automatically looks if there is an instance of jFileChooser, or creates a new one if needed, it forces a filtering of .arff files, makes the dialog appear and sets the behavior of the OK and CANCEL buttons
 
Method Summary
 java.lang.String getFilePath()
          Gets the file path directory from the open file dialog
 boolean isFileSelected()
          If a file was selected this returns a true.
private  void setFilePath(java.lang.String fpath)
          Allows setting of the file path
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jFileChooser

private static javax.swing.JFileChooser jFileChooser
Swing default File Chooser dialog


filePath

private java.lang.String filePath
Contain the full path of the file chosen


isFileSelected

private boolean isFileSelected
State variable, true when a file is selected

Constructor Detail

OpenFileDialog

public OpenFileDialog()
The constructor automatically looks if there is an instance of jFileChooser, or creates a new one if needed, it forces a filtering of .arff files, makes the dialog appear and sets the behavior of the OK and CANCEL buttons

Method Detail

getFilePath

public java.lang.String getFilePath()
Gets the file path directory from the open file dialog

Returns:
String of the filepath.

setFilePath

private void setFilePath(java.lang.String fpath)
Allows setting of the file path

Parameters:
fpath - String of the file path

isFileSelected

public boolean isFileSelected()
If a file was selected this returns a true.

Returns:
true file was selected else a false