org.openbp.swing.components.wizard
Class SequenceManagerImpl

java.lang.Object
  extended by org.openbp.swing.components.wizard.SequenceManagerImpl
All Implemented Interfaces:
java.lang.Cloneable, SequenceManager

public class SequenceManagerImpl
extends java.lang.Object
implements SequenceManager, java.lang.Cloneable

Sequence manager implementation.

Author:
Heiko Erhardt

Constructor Summary
SequenceManagerImpl()
          Default constructor.
 
Method Summary
 void chain(java.lang.String link)
          Chains the current element with the specified element.
 void chain(java.lang.String name, java.lang.String link)
          Chains the specified elements.
 void clear()
          Clears all sequence manager information, including the first and current references.
 void clearSequence()
          Clears all sequence manager information.
 java.lang.Object clone()
          Creates a clone of this object.
 java.lang.String getCurrent()
          Gets the name of the current element.
 java.lang.String getFirst()
          Gets the name of the first element.
 java.lang.String getNext()
          Gets the name of the element that succeeds the current element.
 java.lang.String getNext(java.lang.String name)
          Gets the name of the element that succeeds the specified element.
 java.lang.String getPrevious()
          Gets the name of the element that preceeds the current element.
 java.lang.String getPrevious(java.lang.String name)
          Gets the name of the element that preceeds the specified element.
 void remove(java.lang.String name)
          Removes an element from the sequence.
 void setCurrent(java.lang.String current)
          Sets the name of the current element.
 void setFirst(java.lang.String first)
          Sets the name of the first element.
 void setNext(java.lang.String link)
          Sets the name of the element that succeeds the current element.
 void setNext(java.lang.String name, java.lang.String link)
          Sets the name of the element that succeeds the specified element.
 void setPrevious(java.lang.String link)
          Sets the name of the element that preceeds the current element.
 void setPrevious(java.lang.String name, java.lang.String link)
          Sets the name of the element that preceeds the specified element.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequenceManagerImpl

public SequenceManagerImpl()
Default constructor.

Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates a clone of this object.

Overrides:
clone in class java.lang.Object
Returns:
The clone (a deep copy of this object)
Throws:
java.lang.CloneNotSupportedException - If the cloning of one of the contained members failed

getFirst

public java.lang.String getFirst()
Gets the name of the first element.

Specified by:
getFirst in interface SequenceManager

setFirst

public void setFirst(java.lang.String first)
Sets the name of the first element.

Specified by:
setFirst in interface SequenceManager

getCurrent

public java.lang.String getCurrent()
Gets the name of the current element.

Specified by:
getCurrent in interface SequenceManager

setCurrent

public void setCurrent(java.lang.String current)
Sets the name of the current element.

Specified by:
setCurrent in interface SequenceManager

getNext

public java.lang.String getNext()
Gets the name of the element that succeeds the current element.

Specified by:
getNext in interface SequenceManager
Returns:
The next element or null if this element does not have a successor

getPrevious

public java.lang.String getPrevious()
Gets the name of the element that preceeds the current element.

Specified by:
getPrevious in interface SequenceManager
Returns:
The next element or null if this element does not have a prdecessor

getNext

public java.lang.String getNext(java.lang.String name)
Gets the name of the element that succeeds the specified element.

Specified by:
getNext in interface SequenceManager
Parameters:
name - Name of the element or null for the current element
Returns:
The next element or null if this element does not have a successor

getPrevious

public java.lang.String getPrevious(java.lang.String name)
Gets the name of the element that preceeds the specified element.

Specified by:
getPrevious in interface SequenceManager
Parameters:
name - Name of the element or null for the current element
Returns:
The next element or null if this element does not have a prdecessor

chain

public void chain(java.lang.String link)
Chains the current element with the specified element.

Specified by:
chain in interface SequenceManager
Parameters:
link - Name of the successor or null if this element is the last element

chain

public void chain(java.lang.String name,
                  java.lang.String link)
Chains the specified elements.

Specified by:
chain in interface SequenceManager
Parameters:
name - Name of the element or null for the current element
link - Name of the successor or null if this element is the last element

setNext

public void setNext(java.lang.String link)
Sets the name of the element that succeeds the current element.

Specified by:
setNext in interface SequenceManager
Parameters:
link - Name of the successor or null if this element is the last element

setNext

public void setNext(java.lang.String name,
                    java.lang.String link)
Sets the name of the element that succeeds the specified element.

Specified by:
setNext in interface SequenceManager
Parameters:
name - Name of the element or null for the current element
link - Name of the successor or null if this element is the last element

setPrevious

public void setPrevious(java.lang.String link)
Sets the name of the element that preceeds the current element.

Specified by:
setPrevious in interface SequenceManager
Parameters:
link - Name of the predecessor or null if this element is the first element

setPrevious

public void setPrevious(java.lang.String name,
                        java.lang.String link)
Sets the name of the element that preceeds the specified element.

Specified by:
setPrevious in interface SequenceManager
Parameters:
name - Name of the element or null for the current element
link - Name of the predecessor or null if this element is the first element

remove

public void remove(java.lang.String name)
Removes an element from the sequence. The predecessor and the successor of the element will be linked with each other, if any.

Specified by:
remove in interface SequenceManager
Parameters:
name - Name of the page to remove

clearSequence

public void clearSequence()
Clears all sequence manager information. Keeps the first and current references.

Specified by:
clearSequence in interface SequenceManager

clear

public void clear()
Clears all sequence manager information, including the first and current references.

Specified by:
clear in interface SequenceManager


Copyright © 2011. All Rights Reserved.