com.taursys.xml
Class Trigger

java.lang.Object
  extended bycom.taursys.xml.Component
      extended bycom.taursys.xml.Trigger
All Implemented Interfaces:
MapperComponent
Direct Known Subclasses:
Button

public class Trigger
extends Component

A Component which responds to TriggerEvents. By default, this component uses a ButtonModel to hold its state. You can change this by overriding the createDefaultModel method or explicitly setting the model property.


Constructor Summary
Trigger()
          Creates a new Trigger and its default model.
 
Method Summary
protected  javax.swing.ButtonModel createDefaultModel()
          Creates the model used by this component.
 javax.swing.ButtonModel getModel()
          Returns the current model used by this component
 java.lang.String getParameter()
          Returns the name of the parameter this components listens for
 java.lang.String getText()
          Returns the text value that will trigger this button.
 boolean isDefaultTrigger()
          Get whether this is to act as the defaultTrigger if no parameter is received.
protected  void processTriggerEvent(TriggerEvent e)
          Store value and fires parameter event if event has correct parameter name.
 void setDefaultTrigger(boolean newDefaultTrigger)
          Set this whether to act as the defaultTrigger if no parameter is received.
 void setModel(javax.swing.ButtonModel newModel)
          Sets the current model used by this component
 void setParameter(java.lang.String newParameter)
          Sets the name of the parameter this components listens for.
 void setText(java.lang.String newText)
          Sets the text value that will trigger this button.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class com.taursys.xml.Component
addEventType, addInputListener, addNotify, addParameterListener, addRecycleListener, addRenderListener, addTriggerListener, dispatchEvent, fireActionPerformed, fireInputReceived, fireParameterReceived, fireRecycle, fireRender, getEventTypeList, getParent, isNotifySet, isVisible, lazyAddNotify, lazyRemoveNotify, processEvent, processInputEvent, processParameterEvent, processRecycleEvent, processRenderEvent, removeEventType, removeInputListener, removeNotify, removeParameterListener, removeRecycleListener, removeRenderListener, removeTriggerListener, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trigger

public Trigger()
Creates a new Trigger and its default model. The default model, a DefaultButtonModel, is created via the createDefaultModel method.

Method Detail

createDefaultModel

protected javax.swing.ButtonModel createDefaultModel()
Creates the model used by this component. Override this method to provide your own default ButtonModel for the component.


getModel

public javax.swing.ButtonModel getModel()
Returns the current model used by this component


setModel

public void setModel(javax.swing.ButtonModel newModel)
Sets the current model used by this component


processTriggerEvent

protected void processTriggerEvent(TriggerEvent e)
                            throws java.lang.Exception
Store value and fires parameter event if event has correct parameter name.

Overrides:
processTriggerEvent in class Component
Throws:
java.lang.Exception

setParameter

public void setParameter(java.lang.String newParameter)
Sets the name of the parameter this components listens for.


getParameter

public java.lang.String getParameter()
Returns the name of the parameter this components listens for


setText

public void setText(java.lang.String newText)
Sets the text value that will trigger this button.


getText

public java.lang.String getText()
Returns the text value that will trigger this button.


setDefaultTrigger

public void setDefaultTrigger(boolean newDefaultTrigger)
Set this whether to act as the defaultTrigger if no parameter is received. If this property is true, it will be used during trigger dispatching whenever the expected parameter is NOT present in the input. In that case, this component will respond as if its expected parameter value was received.

Parameters:
newDefaultTrigger - whether to act as the defaultTrigger.

isDefaultTrigger

public boolean isDefaultTrigger()
Get whether this is to act as the defaultTrigger if no parameter is received. If this property is true, it will be used during trigger dispatching whenever the expected parameter is NOT present in the input. In that case, this component will respond as if its expected parameter value was received.

Returns:
whether to act as the defaultTrigger.

toString

public java.lang.String toString()
Returns a string representation of this object. This contains the object identity and state information.

Overrides:
toString in class Component
Returns:
a string representation of this object


Copyright © 2007 Martin T Phelan. All Rights Reserved.