juife
v0.1a

net.sf.juife
Class DefaultNavigationHistoryModel

java.lang.Object
  extended by net.sf.juife.DefaultNavigationHistoryModel
All Implemented Interfaces:
NavigationHistoryModel

public class DefaultNavigationHistoryModel
extends java.lang.Object
implements NavigationHistoryModel

Provides default implementation of the NavigationHistoryModel interface. Note that this implementation of NavigationHistoryModel is not synchronized.


Constructor Summary
DefaultNavigationHistoryModel()
          Creates a new instance of DefaultNavigationHistoryModel.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Registers the specified ActionListener to be notified about changes of the history list.
 void addPage(NavigationPage page)
          Adds the specified page to the history list after the current page.
 void clearHistory()
          Removes all pages from history list except the current page.
protected  void fireActionPerformed()
          Notifies registered listeners that the history list has changed.
 NavigationPage getCurrentPage()
          Gets the current page in the history list.
 int getPageCount()
          Gets the current number of pages in the history list.
 NavigationPage goBack()
          Goes to the previous page in the history list.
 void goFirst()
          Goes to the first page in the history list.
 NavigationPage goForward()
          Goes to the next page in the history list.
 void goLast()
          Goes to the last page in the history list.
 boolean hasBack()
          Determines whether there is at least one page before the current page in the history list.
 boolean hasForward()
          Determines whether there is at least one page after the current page in the history list.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes the specified listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultNavigationHistoryModel

public DefaultNavigationHistoryModel()
Creates a new instance of DefaultNavigationHistoryModel.

Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Registers the specified ActionListener to be notified about changes of the history list.

Specified by:
addActionListener in interface NavigationHistoryModel
Parameters:
l - The ActionListener to register.

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes the specified listener.

Specified by:
removeActionListener in interface NavigationHistoryModel
Parameters:
l - The ActionListener to remove.

fireActionPerformed

protected void fireActionPerformed()
Notifies registered listeners that the history list has changed.


addPage

public void addPage(NavigationPage page)
Adds the specified page to the history list after the current page. All pages after the the current page are removed from the history list and the added page becomes current. Note that this method does nothing if the current page is null or is equal to the page to be added.

Specified by:
addPage in interface NavigationHistoryModel
Parameters:
page - The page to be added to the history list.

goBack

public NavigationPage goBack()
Goes to the previous page in the history list. This means that the previous page becomes the current page of the history list.

Specified by:
goBack in interface NavigationHistoryModel
Returns:
The new current page or null if there is no previous page in the history list.
See Also:
hasBack()

hasBack

public boolean hasBack()
Determines whether there is at least one page before the current page in the history list.

Specified by:
hasBack in interface NavigationHistoryModel
Returns:
true if there is at least one page before the current page in the history list, false otherwise.

goForward

public NavigationPage goForward()
Goes to the next page in the history list. This means that the next page becomes the current page of the history list.

Specified by:
goForward in interface NavigationHistoryModel
Returns:
The new current page or null if there is no next page in the history list.
See Also:
hasForward()

hasForward

public boolean hasForward()
Determines whether there is at least one page after the current page in the history list.

Specified by:
hasForward in interface NavigationHistoryModel
Returns:
true if there is at least one page after the current page in the history list, false otherwise.

goFirst

public void goFirst()
Goes to the first page in the history list. This means that the first page becomes the current page of the history list.

Specified by:
goFirst in interface NavigationHistoryModel

goLast

public void goLast()
Goes to the last page in the history list. This means that the last page becomes the current page of the history list.

Specified by:
goLast in interface NavigationHistoryModel

getCurrentPage

public NavigationPage getCurrentPage()
Gets the current page in the history list.

Specified by:
getCurrentPage in interface NavigationHistoryModel
Returns:
The current page in the history list or null if the history list is empty.

getPageCount

public int getPageCount()
Gets the current number of pages in the history list.

Specified by:
getPageCount in interface NavigationHistoryModel
Returns:
The current number of pages in the history list.

clearHistory

public void clearHistory()
Removes all pages from history list except the current page.

Specified by:
clearHistory in interface NavigationHistoryModel

juife
v0.1a

Copyright © 2005 Grigor Iliev. All rights reserved. SourceForge.net Logo