org.opensha.commons.param.impl
Class ButtonParameter

java.lang.Object
  extended by org.opensha.commons.param.AbstractParameter<Integer>
      extended by org.opensha.commons.param.impl.ButtonParameter
All Implemented Interfaces:
Serializable, Comparable<Parameter<?>>, Named, XMLSaveable, Parameter<Integer>

public class ButtonParameter
extends AbstractParameter<Integer>

This is a dummy parameter useful in GUIs/ParameterLists where buttons are needed but not associated with an actual parameter. A ParameterChangeEvent will be fired whenever the button is clicked in the editor.

Author:
kevin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.opensha.commons.param.AbstractParameter
C, constraint, D, defaultValue, editable, independentParameters, info, metadataString, name, units, value, XML_COMPLEX_VAL_EL_NAME, XML_GROUP_METADATA_NAME, XML_METADATA_NAME, XML_NULL_VALUE
 
Fields inherited from interface org.opensha.commons.param.Parameter
XML_INDEPENDENT_PARAMS_NAME
 
Constructor Summary
ButtonParameter(String name, String buttonText)
           
 
Method Summary
 Object clone()
          Returns a copy so you can't edit or damage the origial.
 String getButtonText()
           
 ParameterEditor getEditor()
          Returns the Editor for this Parameter.
 void setButtonText(String buttonText)
           
protected  boolean setIndividualParamValueFromXML(Element el)
          This should set the value of this individual parameter.
 
Methods inherited from class org.opensha.commons.param.AbstractParameter
addIndependentParameter, addParameterChangeFailListener, addParameterChangeListener, checkEditable, compareTo, containsIndependentParameter, equals, firePropertyChange, firePropertyChangeFailed, getConstraint, getConstraintName, getDefaultValue, getDependentParamMetadataString, getIndependentParameter, getIndependentParameterList, getIndependentParametersKey, getInfo, getMetadataString, getName, getNumIndependentParameters, getType, getUnits, getValue, isAllowed, isEditable, isNullAllowed, removeIndependentParameter, removeParameterChangeFailListener, removeParameterChangeListener, setConstraint, setDefaultValue, setDependentParamMetadataString, setIndependentParameters, setIndepParamsFromXML, setInfo, setName, setNonEditable, setUnits, setValue, setValueAsDefault, setValueFromXMLMetadata, toXMLMetadata, toXMLMetadata, unableToSetValue, valueToXML
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonParameter

public ButtonParameter(String name,
                       String buttonText)
Method Detail

getEditor

public ParameterEditor getEditor()
Description copied from interface: Parameter
Returns the Editor for this Parameter. It is recommended that editors be lazily instantiated.

Returns:
the Editor

getButtonText

public String getButtonText()

setButtonText

public void setButtonText(String buttonText)

clone

public Object clone()
Description copied from class: AbstractParameter
Returns a copy so you can't edit or damage the origial.

Specified by:
clone in interface Parameter<Integer>
Specified by:
clone in class AbstractParameter<Integer>

setIndividualParamValueFromXML

protected boolean setIndividualParamValueFromXML(Element el)
Description copied from class: AbstractParameter
This should set the value of this individual parameter. The values of the independent parameters will be set by the final setValueFromXMLMetadata method

Specified by:
setIndividualParamValueFromXML in class AbstractParameter<Integer>
Returns: