plugins.adufour.vars.lang
Class VarTrigger

java.lang.Object
  extended by plugins.adufour.vars.lang.Var<N>
      extended by plugins.adufour.vars.lang.VarNumber<java.lang.Integer>
          extended by plugins.adufour.vars.lang.VarInteger
              extended by plugins.adufour.vars.lang.VarTrigger
All Implemented Interfaces:
icy.file.xml.XMLPersistent, java.lang.Comparable<java.lang.Integer>, VarListener<java.lang.Integer>

public class VarTrigger
extends VarInteger

Variable providing a trigger (i.e. a button in the graphical interface) and the number of times it was triggered

Author:
Alexandre Dufour

Nested Class Summary
static interface VarTrigger.TriggerListener
           
 
Field Summary
 
Fields inherited from class plugins.adufour.vars.lang.Var
listeners, NO_VALUE, type, XML_KEY_ID
 
Constructor Summary
VarTrigger(java.lang.String name, VarTrigger.TriggerListener... listeners)
          Creates a new trigger with the given name
 
Method Summary
 VarEditor<java.lang.Integer> createVarEditor()
          Creates a new VarEditor object that allows the user to graphically adjust the value of this variable.
 void reset()
          Resets the trigger count (equivalent to setting the value of this variable to 0)
 void trigger()
          Triggers the variable (equivalent to incrementing the value of this variable)
 
Methods inherited from class plugins.adufour.vars.lang.VarInteger
compareTo, getValue, parse
 
Methods inherited from class plugins.adufour.vars.lang.VarNumber
isAssignableFrom
 
Methods inherited from class plugins.adufour.vars.lang.Var
addListener, createVarViewer, fireVariableChanged, fireVariableChanged, getDefaultEditorModel, getDefaultValue, getIterableReferrers, getName, getReference, getReferencingPolicy, getReferrers, getType, getTypeAsString, getValue, getValueAsString, getValueAsString, isEnabled, isOptional, isReferenced, loadFromXML, prettyPrint, referenceChanged, removeListener, removeListeners, saveToXML, setDefaultEditorModel, setEnabled, setOptional, setReference, setReferencingPolicy, setValue, toString, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VarTrigger

public VarTrigger(java.lang.String name,
                  VarTrigger.TriggerListener... listeners)
Creates a new trigger with the given name

Parameters:
name - the name of the trigger (will be the title of the button in graphical mode)
listeners - the trigger listeners
Method Detail

createVarEditor

public VarEditor<java.lang.Integer> createVarEditor()
Description copied from class: Var
Creates a new VarEditor object that allows the user to graphically adjust the value of this variable. By default this editor is an empty label for generic types, but this method can be overridden to provide a custom editor.

Overrides:
createVarEditor in class VarNumber<java.lang.Integer>
Returns:
the variable editor embarking the graphical component

reset

public void reset()
Resets the trigger count (equivalent to setting the value of this variable to 0)


trigger

public void trigger()
Triggers the variable (equivalent to incrementing the value of this variable)