visualmodeler
Class FileModel

Object
  extended byObservable
      extended byvisualmodeler.FileModel

public class FileModel
extends Observable

FileModel deals with the back-end operation of the VisualModeler system. The operations handle by this class are:

Version:
1.1
Author:
Anthony Sulistio and Chee Shin Yeo
Invariant:
$none

Constructor Summary
FileModel(javax.swing.JFrame frame, UserModel user, ResourceModel res)
          Allocates a new FileModel object
 
Method Summary
 void closeFile()
          A method that shows a close file dialog
 void generateCode()
          Generates a Java source code
 void newFile()
          A method that asks the user to save the changes before exiting the program
 void openFile()
          A method that handles the dialog to open a new file
 boolean quitProgram()
          A method that asks the user whether to quit the program or not
 void saveAsFile()
          A method that shows a Save As dialog
 void saveFile()
          Saves the Visual Modeler project file
 
Methods inherited from class Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileModel

public FileModel(javax.swing.JFrame frame,
                 UserModel user,
                 ResourceModel res)
Allocates a new FileModel object

Parameters:
frame - a JFrame object
user - a UserModel object
res - a ResourceModel object
Pre Condition:
frame != null, user != null, res != null
Post Condition:
$none
Method Detail

saveFile

public void saveFile()
Saves the Visual Modeler project file

Pre Condition:
$none
Post Condition:
$none

newFile

public void newFile()
A method that asks the user to save the changes before exiting the program

Pre Condition:
$none
Post Condition:
$none

openFile

public void openFile()
A method that handles the dialog to open a new file

Pre Condition:
$none
Post Condition:
$none

closeFile

public void closeFile()
A method that shows a close file dialog

Pre Condition:
$none
Post Condition:
$none

saveAsFile

public void saveAsFile()
A method that shows a Save As dialog

Pre Condition:
$none
Post Condition:
$none

quitProgram

public boolean quitProgram()
A method that asks the user whether to quit the program or not

Returns:
true if the user wants to quit, false otherwise
Pre Condition:
$none
Post Condition:
$none

generateCode

public void generateCode()
Generates a Java source code

Pre Condition:
$none
Post Condition:
$none