nz.ac.waikato.modeljunit.gui
Class Project

java.lang.Object
  extended by nz.ac.waikato.modeljunit.gui.Project

public class Project
extends java.lang.Object

A container class for projects. Designed to contain preferences and configuration information, as well as logic for saving/opening projects from files.

Author:
Gian Perrone

Constructor Summary
Project()
          Create a new (empty) project, untitled and unsaved
 
Method Summary
 int getAlgorithm()
           
 java.util.Map<java.lang.String,java.lang.String> getConfiguration()
           
 boolean[] getCoverageOptions()
           
 boolean getFailureVerbosity()
           
 java.io.File getFileName()
          Get the current filename for the project.
 boolean getGenerateGraph()
           
static Project getInstance()
           
 java.util.Date getLastModified()
           
 java.io.File getModelFile()
           
 java.lang.String getName()
          Get the project name
 Parameter getParameter()
           
 java.lang.String getProperty(java.lang.String key)
          Get a configuration value
 double getResetProbability()
           
 java.lang.String getVersion()
           
 int getWalkLength()
           
 boolean isModified()
          Read the modified flag.
static Project load(java.io.File file)
           
 void modify()
          Set the "modified" flag to indicate that the project is unsaved.
static boolean save(Project project)
          Save the project state to the currently set filename.
 void setAlgorithm(int algorithm)
           
 void setConfiguration(java.util.Map<java.lang.String,java.lang.String> strings)
           
 void setCoverageOptions(boolean[] options)
           
 void setFailureVerbosity(boolean verbosity)
           
 void setFileName(java.io.File file)
          Set a filename for the project to save to.
 void setGenerateGraph(boolean generate)
           
static void setInstance(Project pr)
           
 void setLastModified(java.util.Date lastModified)
           
 void setModelFile(java.io.File m)
           
 void setName(java.lang.String name)
          Update the project name
 void setParameter(Parameter p)
           
 void setProperty(java.lang.String key, java.lang.String value)
          Set a configuration value.
 void setResetProbability(double prob)
           
 void setVersion(java.lang.String version)
           
 void setWalkLength(int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Project

public Project()
Create a new (empty) project, untitled and unsaved

Method Detail

setName

public void setName(java.lang.String name)
Update the project name


getName

public java.lang.String getName()
Get the project name


getModelFile

public java.io.File getModelFile()

setModelFile

public void setModelFile(java.io.File m)

modify

public void modify()
Set the "modified" flag to indicate that the project is unsaved.


getConfiguration

public java.util.Map<java.lang.String,java.lang.String> getConfiguration()

setConfiguration

public void setConfiguration(java.util.Map<java.lang.String,java.lang.String> strings)

isModified

public boolean isModified()
Read the modified flag.


getLastModified

public java.util.Date getLastModified()

setLastModified

public void setLastModified(java.util.Date lastModified)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)
Set a configuration value.


getProperty

public java.lang.String getProperty(java.lang.String key)
Get a configuration value


setFileName

public void setFileName(java.io.File file)
Set a filename for the project to save to.


getFileName

public java.io.File getFileName()
Get the current filename for the project.


getParameter

public Parameter getParameter()

setParameter

public void setParameter(Parameter p)

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)

getCoverageOptions

public boolean[] getCoverageOptions()

setCoverageOptions

public void setCoverageOptions(boolean[] options)

getFailureVerbosity

public boolean getFailureVerbosity()

setFailureVerbosity

public void setFailureVerbosity(boolean verbosity)

getAlgorithm

public int getAlgorithm()

setAlgorithm

public void setAlgorithm(int algorithm)

getResetProbability

public double getResetProbability()

setResetProbability

public void setResetProbability(double prob)

getWalkLength

public int getWalkLength()

setWalkLength

public void setWalkLength(int len)

getGenerateGraph

public boolean getGenerateGraph()

setGenerateGraph

public void setGenerateGraph(boolean generate)

save

public static boolean save(Project project)
Save the project state to the currently set filename. A null filename will result in an exception. Checking that the file is writable must be done prior to calling this method.

Returns:
true if writing the file succeeded, false otherwise

load

public static Project load(java.io.File file)

setInstance

public static void setInstance(Project pr)

getInstance

public static Project getInstance()


Copyright © 2009 ModelJUnit Project. All Rights Reserved.