|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensha.commons.gui.LabeledBorderPanel
org.opensha.commons.param.editor.AbstractParameterEditor<E>
public abstract class AbstractParameterEditor<E>
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected static Border |
CONST_BORDER
|
static Font |
DEFAULT_FONT
|
protected static Border |
ETCHED
|
protected static Border |
FOCUS_BORDER
|
protected static Dimension |
LABEL_DIM
|
protected static Dimension |
LABEL_PANEL_DIM
|
protected static Dimension |
WIGET_PANEL_DIM
|
| Fields inherited from class org.opensha.commons.gui.LabeledBorderPanel |
|---|
addDefault, borderColor, C, D, editorPanel, GBL, jScrollPane1, mainPanel, PARAMETER_LABEL_FONT, PARAMTER_FORE_COLOR, title |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AbstractParameterEditor()
Default Constructor. |
|
AbstractParameterEditor(Parameter<E> param)
Create the parameter editor and set the parameter to the given parameter. |
|
| Method Summary | |
|---|---|
protected abstract JComponent |
buildWidget()
This will be called by refreshParamEditor to initially build the widget component. |
JComponent |
getComponent()
|
protected String |
getLabelToolTipText()
|
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. |
protected JComponent |
getWidget()
|
protected String |
getWidgetToolTipText()
|
boolean |
isFocusEnabled()
Returns the focusEnabled boolean indicating this is the GUI componet with the current focus |
abstract boolean |
isParameterSupported(Parameter<E> param)
Abstract method that allows subclasses to define if a specific parameter is valid. |
static JLabel |
makeSingleConstraintValueLabel(String label)
|
void |
refreshParamEditor()
Called when the parameter has changed independently from the editor. |
protected void |
removeWidget()
|
void |
setEditorBorder(Border border)
|
abstract void |
setEnabled(boolean enabled)
|
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 value)
Set the value in the parameter. |
void |
unableToSetValue(Object value)
Needs to be called by subclasses when editable widget field change fails due to constraint problems. |
protected void |
updateTitle()
|
protected abstract JComponent |
updateWidget()
This is called by refreshParamEditor when the parameters value is changed externally
and the widget needs to be updated to reflect the new value. |
| Methods inherited from class org.opensha.commons.gui.LabeledBorderPanel |
|---|
add, add, add, add, add, getBorderColor, getTitle, initParameterLookAndFeel, jbInit, remove, remove, removeAll, setBorderColor, setLayout, setTitle, setTitleFont, setTitleJustification, setTitlePosition |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opensha.commons.param.editor.ParameterEditor |
|---|
isVisible, setVisible |
| Field Detail |
|---|
protected static final Dimension LABEL_DIM
protected static final Dimension LABEL_PANEL_DIM
protected static final Dimension WIGET_PANEL_DIM
public static Font DEFAULT_FONT
protected static final Border CONST_BORDER
protected static final Border FOCUS_BORDER
protected static final Border ETCHED
| Constructor Detail |
|---|
public AbstractParameterEditor()
public AbstractParameterEditor(Parameter<E> param)
param - | Method Detail |
|---|
public final void setValue(E value)
throws NullPointerException
refreshParamEditor, and should be
used to externally both set the parameter value and refresh the parameter.
setValue in interface ParameterEditor<E>value - the value to set in the current parameter
NullPointerException - if the current parameter is null
public final E getValue()
throws NullPointerException
ParameterEditor
getValue in interface ParameterEditor<E>NullPointerExceptionpublic void unableToSetValue(Object value)
ParameterEditor
unableToSetValue in interface ParameterEditor<E>public final Parameter<E> getParameter()
ParameterEditor
getParameter in interface ParameterEditor<E>public final void setParameter(Parameter<E> model)
ParameterEditor
setParameter in interface ParameterEditor<E>public abstract boolean isParameterSupported(Parameter<E> param)
setParameter is called.
param -
protected void updateTitle()
public final void setFocusEnabled(boolean newFocusEnabled)
ParameterEditor
setFocusEnabled in interface ParameterEditor<E>public final boolean isFocusEnabled()
ParameterEditor
isFocusEnabled in interface ParameterEditor<E>public final JComponent getComponent()
getComponent in interface ParameterEditor<E>public final void refreshParamEditor()
ParameterEditor
refreshParamEditor in interface ParameterEditor<E>public abstract void setEnabled(boolean enabled)
setEnabled in interface ParameterEditor<E>setEnabled in class JComponentprotected abstract JComponent buildWidget()
refreshParamEditor to initially build the widget component.
protected abstract JComponent updateWidget()
refreshParamEditor when the parameters value is changed externally
and the widget needs to be updated to reflect the new value. If the widget can be simply updated
to display/edit the new value, it should do so.
buildWidget), or return the new
component.
protected String getLabelToolTipText()
protected String getWidgetToolTipText()
protected void removeWidget()
protected final JComponent getWidget()
public void setEditorBorder(Border border)
setEditorBorder in interface ParameterEditor<E>public static JLabel makeSingleConstraintValueLabel(String label)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||