|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opensha.commons.param.editor.AbstractParameterEditorConverter<E,F>
E - F - public abstract class AbstractParameterEditorConverter<E,F>
This class is used to quickly create an editor of one type which uses a parameter editor of another type. For example, a LocationParameter might need to be edited with a StringParameterEditor or a ParameterListEditor. This makes it really easy to wrap parameter editors.
| Constructor Summary | |
|---|---|
AbstractParameterEditorConverter()
|
|
AbstractParameterEditorConverter(Parameter<E> nativeParam)
|
|
| Method Summary | |
|---|---|
protected abstract Parameter<F> |
buildParameter(Parameter<E> myParam)
This will be called to build a parameter of the editor type from the parameter type |
protected abstract F |
convertFromNative(E value)
Converts a native value to a converted value |
protected abstract E |
convertToNative(F value)
Converts a converted value back to a native value. |
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 |
parameterChange(ParameterChangeEvent event)
Function that must be implemented by all Listeners for ParameterChangeEvents. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractParameterEditorConverter()
public AbstractParameterEditorConverter(Parameter<E> nativeParam)
| Method Detail |
|---|
protected abstract Parameter<F> buildParameter(Parameter<E> myParam)
myParam -
protected abstract F convertFromNative(E value)
value -
protected abstract E convertToNative(F value)
value -
public void setValue(E object)
ParameterEditor
setValue in interface ParameterEditor<E>public E getValue()
ParameterEditor
getValue in interface ParameterEditor<E>public void unableToSetValue(Object object)
ParameterEditor
unableToSetValue in interface ParameterEditor<E>public void refreshParamEditor()
ParameterEditor
refreshParamEditor in interface ParameterEditor<E>public Parameter<E> getParameter()
ParameterEditor
getParameter in interface ParameterEditor<E>public void setParameter(Parameter<E> model)
ParameterEditor
setParameter in interface ParameterEditor<E>public void parameterChange(ParameterChangeEvent event)
ParameterChangeListener
parameterChange in interface ParameterChangeListenerevent - The Event which triggered this function callpublic void setFocusEnabled(boolean newFocusEnabled)
ParameterEditor
setFocusEnabled in interface ParameterEditor<E>public boolean isFocusEnabled()
ParameterEditor
isFocusEnabled in interface ParameterEditor<E>public void setEnabled(boolean isEnabled)
setEnabled in interface ParameterEditor<E>public void setVisible(boolean isVisible)
setVisible in interface ParameterEditor<E>public boolean isVisible()
isVisible in interface ParameterEditor<E>public JComponent getComponent()
getComponent in interface ParameterEditor<E>public void setEditorBorder(Border b)
setEditorBorder in interface ParameterEditor<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||