org.opensha.commons.param.editor
Interface ParameterEditor<E>

All Known Implementing Classes:
AbstractParameterEditor, AbstractParameterEditorConverter, AbstractParameterEditorOld, ArbitrarilyDiscretizedFuncParameterEditor, BooleanParameterEditor, ButtonParameterEditor, CommentsParameterEditor, ConstrainedCPTParameterEditor, ConstrainedDiscreteLocationParameterEditor, ConstrainedDoubleDiscreteParameterEditor, ConstrainedDoubleParameterEditor, ConstrainedEstimateParameterEditor, ConstrainedIntegerDiscreteParameterEditor, ConstrainedIntegerParameterEditor, ConstrainedStringListParameterEditor, ConstrainedStringParameterEditor, DoubleParameterEditor, DoubleValueWeightParameterEditor, EditableConstrainedStringParameterEditor, EnumParameterEditor, EvenlyDiscretizedFuncParameterEditor, FileParameterEditor, IntegerParameterEditor, LocationParameterEditor, LongParameterEditor, MagDistStringParameterEditor, MagFreqDistParameterEditor, MagPDF_ParameterEditor, ParameterListParameterEditor, RegionParameterEditor, SimpleFaultParameterEditor, SimpleFaultParameterEditorPanel, StringParameterEditor, TranslatedWarningDoubleParameterEditor, TreeBranchWeightsParameterEditor, WeightedListParameterEditor

public interface ParameterEditor<E>

Title: ParameterEditorAPI

Description: Common interface functions that all implementing ParameterEditors must implement so that they can be plugged transparently into GUI frameworks.

This allows classes that use the ParameterEditors to deal with any Editor type equally. Using this interface they all look the same. This permits new editors to be added to the framework without changing the using classes.

Note that all editors edit a Parameter. Internally they maintain a reference to the particular parameter type they know how to handle.

Version:
1.0
Author:
Steven W. Rock

Method Summary
 JComponent getComponent()
           
 Parameter<E> getParameter()
          Returns the parameter that is stored internally that this GUI widget is editing
 E getValue()
          Returns the value of the parameter object.
 boolean isFocusEnabled()
          Returns the focusEnabled boolean indicating this is the GUI componet with the current focus
 boolean isVisible()
           
 void refreshParamEditor()
          Called when the parameter has changed independently from the editor.
 void setEditorBorder(Border b)
           
 void setEnabled(boolean isEnabled)
           
 void setFocusEnabled(boolean newFocusEnabled)
          Sets the focusEnabled boolean indicating this is the GUI componet with the current focus
 void setParameter(Parameter<E> model)
          Sets the parameter that is stored internally for this GUI widget to edit
 void setValue(E object)
          Set the value of the Parameter this editor is editing.
 void setVisible(boolean isVisible)
           
 void unableToSetValue(Object object)
          Needs to be called by subclasses when editable widget field change fails due to constraint problems.
 

Method Detail

setValue

void setValue(E object)
Set the value of the Parameter this editor is editing.


getValue

E getValue()
Returns the value of the parameter object.


unableToSetValue

void unableToSetValue(Object object)
Needs to be called by subclasses when editable widget field change fails due to constraint problems. Allows rollback to the previous good value.


refreshParamEditor

void refreshParamEditor()
Called when the parameter has changed independently from the editor. This function needs to be called to to update the GUI component ( text field, picklsit, etc. ) with the new parameter value.


getParameter

Parameter<E> getParameter()
Returns the parameter that is stored internally that this GUI widget is editing


setParameter

void setParameter(Parameter<E> model)
Sets the parameter that is stored internally for this GUI widget to edit


setFocusEnabled

void setFocusEnabled(boolean newFocusEnabled)
Sets the focusEnabled boolean indicating this is the GUI componet with the current focus


isFocusEnabled

boolean isFocusEnabled()
Returns the focusEnabled boolean indicating this is the GUI componet with the current focus


setEnabled

void setEnabled(boolean isEnabled)

setVisible

void setVisible(boolean isVisible)

isVisible

boolean isVisible()

getComponent

JComponent getComponent()

setEditorBorder

void setEditorBorder(Border b)