com.jgoodies.bookfinder.model
Class MainModel

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by com.jgoodies.bookfinder.model.MainModel
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, com.jgoodies.uif.application.ExitListener, Serializable, EventListener

public final class MainModel
extends com.jgoodies.binding.beans.Model
implements com.jgoodies.uif.application.ExitListener

References all application-level data or sub models and provides convenience accessors.

Version:
$Revision: 1.22 $
Author:
Karsten Lentzsch
See Also:
SearchModel, SearchResultModel, DetailsModel, WebService, BookFilter, Serialized Form

Field Summary
static String ACTION_EXIT
           
static String ACTION_OPEN_ABOUT_DIALOG
           
static String ACTION_OPEN_FILTER_DIALOG
           
static String ACTION_OPEN_HELP_CONTENTS
           
static String ACTION_OPEN_PREFERENCES
           
static String ACTION_START_TOUR
           
static String PROPERTYNAME_ACTIVITY
           
 
Constructor Summary
MainModel()
          Constructs a MainModel.
 
Method Summary
 void addBooks(List moreBooks)
          Adds books to the existing list of all books.
 boolean applicationExitAllowed(EventObject event)
           
 void applicationExiting()
          Stores this model's state if the application is closing.
 void exit(ActionEvent e)
           
 AmazonAccessor getAmazonAccessor()
           
 com.jgoodies.uif.action.ToggleAction getAnimateHeaderAction()
           
 DetailsModel getDetailsModel()
          Returns the sub model that provides the details models and actions.
 BookFilter getFilter()
          Returns the current filter that is used to filter elements from the raw list to build up the filtered details list.
 com.jgoodies.uif.action.ToggleAction getListModeAction()
           
 SearchModel getSearchModel()
          Returns the submodel that provides the search models and actions.
 SearchResultModel getSearchResultModel()
          Returns the submodel that provides the search result models.
 com.jgoodies.binding.list.SelectionInList getSelectionInFilteredBook()
          Returns a ListModel of filtered books with a selection.
 com.jgoodies.uif.action.ToggleAction getShowDetailsAction()
           
 com.jgoodies.uif.action.ToggleAction getSummaryModeAction()
           
 com.jgoodies.uif.action.ToggleAction getTableModeAction()
           
 UISettingsModel getUISettingsModel()
          Returns the presentation settings that provides bound Bean properties for view related state.
 WebService getWebService()
          Returns the description of the web service.
 void openAboutDialog(ActionEvent e)
          Opens the about dialog.
 void openFilterDialog(ActionEvent e)
          Opens the filter dialog.
 void openHelpContents(ActionEvent e)
           
 void openPreferences(ActionEvent e)
          Opens the preferences dialog.
 void reset()
          Clears the books list and resets the message.
 void setActivity(String newActivity)
           
 void setDisplayModeActionsEnabled(boolean b)
          Enables or disables the display mode actions.
 void setMessage(String message)
          Sets the given message in the search result model.
 void setSearchContentsBlank()
          Sets author and keywords to blank strings.
 void showActivity(String prefix, String suffix)
          Shows a message.
 void showDetails()
          Makes the details panel visible.
 void startTour(ActionEvent e)
          Starts the integrated tour.
 
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, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME_ACTIVITY

public static final String PROPERTYNAME_ACTIVITY
See Also:
Constant Field Values

ACTION_OPEN_ABOUT_DIALOG

public static final String ACTION_OPEN_ABOUT_DIALOG
See Also:
Constant Field Values

ACTION_OPEN_FILTER_DIALOG

public static final String ACTION_OPEN_FILTER_DIALOG
See Also:
Constant Field Values

ACTION_OPEN_PREFERENCES

public static final String ACTION_OPEN_PREFERENCES
See Also:
Constant Field Values

ACTION_EXIT

public static final String ACTION_EXIT
See Also:
Constant Field Values

ACTION_OPEN_HELP_CONTENTS

public static final String ACTION_OPEN_HELP_CONTENTS
See Also:
Constant Field Values

ACTION_START_TOUR

public static final String ACTION_START_TOUR
See Also:
Constant Field Values
Constructor Detail

MainModel

public MainModel()
Constructs a MainModel.

Method Detail

getSearchModel

public SearchModel getSearchModel()
Returns the submodel that provides the search models and actions.

Returns:
the submodel that provides the search models and actions.

getSearchResultModel

public SearchResultModel getSearchResultModel()
Returns the submodel that provides the search result models.

Returns:
the submodel that provides the search result models.

getDetailsModel

public DetailsModel getDetailsModel()
Returns the sub model that provides the details models and actions.

Returns:
the sub model that provides the details models and actions.

getUISettingsModel

public UISettingsModel getUISettingsModel()
Returns the presentation settings that provides bound Bean properties for view related state.

Returns:
the presentation settings.

getWebService

public WebService getWebService()
Returns the description of the web service.

Returns:
the description of the web service.

getAmazonAccessor

public AmazonAccessor getAmazonAccessor()

getFilter

public BookFilter getFilter()
Returns the current filter that is used to filter elements from the raw list to build up the filtered details list.

Returns:
the current filter

getSelectionInFilteredBook

public com.jgoodies.binding.list.SelectionInList getSelectionInFilteredBook()
Returns a ListModel of filtered books with a selection.

Returns:
a ListModel of filtered books with a selection.

applicationExiting

public void applicationExiting()
Stores this model's state if the application is closing.

Specified by:
applicationExiting in interface com.jgoodies.uif.application.ExitListener

applicationExitAllowed

public boolean applicationExitAllowed(EventObject event)
Specified by:
applicationExitAllowed in interface com.jgoodies.uif.application.ExitListener

getAnimateHeaderAction

public com.jgoodies.uif.action.ToggleAction getAnimateHeaderAction()

getSummaryModeAction

public com.jgoodies.uif.action.ToggleAction getSummaryModeAction()

getListModeAction

public com.jgoodies.uif.action.ToggleAction getListModeAction()

getTableModeAction

public com.jgoodies.uif.action.ToggleAction getTableModeAction()

getShowDetailsAction

public com.jgoodies.uif.action.ToggleAction getShowDetailsAction()

openAboutDialog

@Action
public void openAboutDialog(ActionEvent e)
Opens the about dialog.


openFilterDialog

@Action
public void openFilterDialog(ActionEvent e)
Opens the filter dialog.


openPreferences

@Action
public void openPreferences(ActionEvent e)
Opens the preferences dialog.


exit

@Action
public void exit(ActionEvent e)

openHelpContents

@Action
public void openHelpContents(ActionEvent e)

startTour

@Action
public void startTour(ActionEvent e)
Starts the integrated tour.


reset

public void reset()
Clears the books list and resets the message.


setDisplayModeActionsEnabled

public void setDisplayModeActionsEnabled(boolean b)
Enables or disables the display mode actions.


setSearchContentsBlank

public void setSearchContentsBlank()
Sets author and keywords to blank strings.


setMessage

public void setMessage(String message)
Sets the given message in the search result model.

Parameters:
message - the message to be set

showActivity

public void showActivity(String prefix,
                         String suffix)
Shows a message.


showDetails

public void showDetails()
Makes the details panel visible.


addBooks

public void addBooks(List moreBooks)
Adds books to the existing list of all books.

Parameters:
moreBooks - the list of books to add

setActivity

public void setActivity(String newActivity)


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