ru.tunegov.mathematic
Class FunctionBean

java.lang.Object
  |
  +--ru.tunegov.mathematic.FunctionBean
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Operation, Visualizer

public abstract class FunctionBean
extends java.lang.Object
implements java.io.Serializable

This class is a base class for all non visual beans. This abstract class provides implementation for firing events like FetchArgumentsEvent, TriggerNextActionEvent, ActionErrorEvent which are to be fired by these beans. This class provides methods for triggering the computation of the bean (triggerAction). It should be subclassed to provide the concrete implementation.

Since:
DatesBeans 1.0
See Also:
Serialized Form

Constructor Summary
FunctionBean()
          Default constructor.
 
Method Summary
 void addActionErrorListener(ActionErrorListener newListener)
          Adds a new ActionErrorListener.
 void addFetchArgumentsListener(FetchArgumentsListener newListener)
          Adds a new FetchArgumentsListener.
 void addPropertyChangeListener(java.beans.PropertyChangeListener newListener)
          Adds a new PropertyChangeListener.
 void addTriggerNextActionListener(TriggerNextActionListener newListener)
          Adds a new TriggerNextActionListener.
 boolean getAutoAction()
          Returns the flag whether the bean function executes immediately.
 void removeActionErrorListener(ActionErrorListener newListener)
          Removes a ActionErrorListener.
 void removeFetchArgumentsListener(FetchArgumentsListener newListener)
          Removes a FetchArgumentsListener.
 void removePropertyChangeListener(java.beans.PropertyChangeListener newListener)
          Removes a PropertyChangeListener.
 void removeTriggerNextActionListener(TriggerNextActionListener newListener)
          Removes a TriggerNextActionListener.
 void setAutoAction(boolean value)
          Sets the autoAction flag.
 void triggerAction()
          Initiates the computation of the bean.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionBean

public FunctionBean()
Default constructor.
Method Detail

addActionErrorListener

public void addActionErrorListener(ActionErrorListener newListener)
Adds a new ActionErrorListener.
Parameters:
newListener - The ActionErrorListener to be added

addFetchArgumentsListener

public void addFetchArgumentsListener(FetchArgumentsListener newListener)
Adds a new FetchArgumentsListener.
Parameters:
newListener - The FetchArgumentsListener to be added

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener newListener)
Adds a new PropertyChangeListener.
Parameters:
newListener - The PropertyChangeListener to be added

addTriggerNextActionListener

public void addTriggerNextActionListener(TriggerNextActionListener newListener)
Adds a new TriggerNextActionListener.
Parameters:
newListener - The TriggerNextActionListener to be added

getAutoAction

public boolean getAutoAction()
Returns the flag whether the bean function executes immediately.
Returns:
the flag whether the bean function executes immediately

removeActionErrorListener

public void removeActionErrorListener(ActionErrorListener newListener)
Removes a ActionErrorListener.
Parameters:
newListener - The ActionErrorListener to be removed

removeFetchArgumentsListener

public void removeFetchArgumentsListener(FetchArgumentsListener newListener)
Removes a FetchArgumentsListener.
Parameters:
newListener - The FetchArgumentsListener to be removed

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener newListener)
Removes a PropertyChangeListener.
Parameters:
newListener - The PropertyChangeListener to be removed

removeTriggerNextActionListener

public void removeTriggerNextActionListener(TriggerNextActionListener newListener)
Removes a TriggerNextActionListener.
Parameters:
newListener - The TriggerNextActionListener to be removed

setAutoAction

public void setAutoAction(boolean value)
Sets the autoAction flag. This is used to check whether to call triggerAction method whenever input or control properties of a bean are modified. If the flag is true triggerAction method is called.
Parameters:
value - new value of autoAction property

triggerAction

public void triggerAction()
Initiates the computation of the bean. This method causes FetchArgumentsEvent to be fired. This event is used for setting the input or control arguments of its subclass. After firing this event, it checks the precondition. If the precondition is satisfied, it calls the computeFunction else ActionErrorEvent is fired. If the computeFunction is successful, TriggerNextActionEvent is fired else ActionErrorEvent is fired.