com.jgoodies.skeleton.domain
Class Project

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by com.jgoodies.skeleton.domain.Project
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, Serializable

public class Project
extends com.jgoodies.binding.beans.Model

References all relevant project data: the project description and a list of shafts. The shafts refer to their child components: segments and flanges

Version:
$Revision: 1.7 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Constructor Summary
Project(String name)
          Constructs a Project with the given name and and empty shaft list.
 
Method Summary
 void addShaft(Shaft shaft)
          Adds the given shaft to this project's shafts.
 Description getDescription()
           
 String getFileName()
          Returns the name of this project's associated filename, or "e;Unsaved"e; if it has no file associated.
 String getName()
           
 List<Shaft> getShafts()
          Returns an unmodifiable list of this project's shafts.
 boolean hasFile()
          Checks and answers whether this project has an associated file as backing store.
static Project readFrom(File f)
          Reads, creates and returns a Project from the given File.
 void removeShaft(Shaft shaft)
          Removes the given shaft from this project's shafts.
 void save()
          Saves this project to its associated File.
 void saveAs(File aFile)
          Saves this project to the given File.
 String toString()
          Returns a string representation for this project.
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Project

public Project(String name)
Constructs a Project with the given name and and empty shaft list.

Parameters:
name - the project's name
Method Detail

getName

public String getName()

getDescription

public Description getDescription()

getShafts

public List<Shaft> getShafts()
Returns an unmodifiable list of this project's shafts.

Returns:
an unmodifiable list of this project's shafts.

addShaft

public void addShaft(Shaft shaft)
Adds the given shaft to this project's shafts.

Parameters:
shaft - the shaft to add

removeShaft

public void removeShaft(Shaft shaft)
Removes the given shaft from this project's shafts.

Parameters:
shaft - the shaft to remove

readFrom

public static Project readFrom(File f)
Reads, creates and returns a Project from the given File.

A real app would parse the file.

Parameters:
f - the file to read the project from
Returns:
the Project read from the given file

save

public void save()
Saves this project to its associated File.


saveAs

public void saveAs(File aFile)
Saves this project to the given File.

Parameters:
aFile - the file to save to

hasFile

public boolean hasFile()
Checks and answers whether this project has an associated file as backing store.

Returns:
true if this project has an associated file

getFileName

public String getFileName()
Returns the name of this project's associated filename, or "e;Unsaved"e; if it has no file associated.

Returns:
this project's filename or a default if it has no file

toString

public String toString()
Returns a string representation for this project. Currently it prints the class info and file name.

Overrides:
toString in class Object
Returns:
a string representation for this project


Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.