Sweet Home 3D 3.4

com.eteks.sweethome3d.model
Class HomeApplication

java.lang.Object
  extended by com.eteks.sweethome3d.model.HomeApplication
Direct Known Subclasses:
AppletApplication, SweetHome3D

public abstract class HomeApplication
extends java.lang.Object

Application managing a list of homes displayed at screen.

Author:
Emmanuel Puybaret

Constructor Summary
HomeApplication()
           
 
Method Summary
 void addHome(Home home)
          Adds a given home to the homes list of this application.
 void addHomesListener(CollectionListener<Home> listener)
          Adds the home listener in parameter to this application.
 Home createHome()
          Returns a new home.
 void deleteHome(Home home)
          Removes a given home from the homes list of this application.
abstract  HomeRecorder getHomeRecorder()
          Returns the default recorder able to write and read homes.
 HomeRecorder getHomeRecorder(HomeRecorder.Type type)
          Returns a recorder of a given type able to write and read homes.
 java.util.List<Home> getHomes()
          Returns an unmodifiable collection of the homes of this application.
 java.lang.String getName()
          Returns the name of this application.
abstract  UserPreferences getUserPreferences()
          Returns user preferences.
 java.lang.String getVersion()
          Returns information about the version of this application.
 void removeHomesListener(CollectionListener<Home> listener)
          Removes the home listener in parameter from this application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeApplication

public HomeApplication()
Method Detail

addHomesListener

public void addHomesListener(CollectionListener<Home> listener)
Adds the home listener in parameter to this application.


removeHomesListener

public void removeHomesListener(CollectionListener<Home> listener)
Removes the home listener in parameter from this application.


createHome

public Home createHome()
Returns a new home.

Returns:
a new home with wall heights equal to the one in user preferences.
Since:
2.2

getHomes

public java.util.List<Home> getHomes()
Returns an unmodifiable collection of the homes of this application.


addHome

public void addHome(Home home)
Adds a given home to the homes list of this application. Once the home is added, home listeners added to this application will receive a collectionChanged notification, with an event type equal to ADD.


deleteHome

public void deleteHome(Home home)
Removes a given home from the homes list of this application. Once the home is removed, home listeners added to this application will receive a collectionChanged notification, with an event type equal to DELETE.


getHomeRecorder

public abstract HomeRecorder getHomeRecorder()
Returns the default recorder able to write and read homes.


getHomeRecorder

public HomeRecorder getHomeRecorder(HomeRecorder.Type type)
Returns a recorder of a given type able to write and read homes. Subclasses may override this method to return a recorder matching type.

Parameters:
type - a hint for the application to choose the returned recorder.
Returns:
the default recorder able to write and read homes.
Since:
1.8

getUserPreferences

public abstract UserPreferences getUserPreferences()
Returns user preferences.


getName

public java.lang.String getName()
Returns the name of this application. Default implementation returns Sweet Home 3D.

Since:
1.6

getVersion

public java.lang.String getVersion()
Returns information about the version of this application. Default implementation returns an empty string.

Since:
1.6

Sweet Home 3D 3.4

? Copyrights 2006-2011 eTeks - All rights reserved
Distributed under GNU General Public License