org.opensha.commons.param.editor.impl
Class TranslatedWarningDoubleParameterEditor
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensha.commons.gui.LabeledBorderPanel
org.opensha.commons.param.editor.AbstractParameterEditor<Double>
org.opensha.commons.param.editor.impl.DoubleParameterEditor
org.opensha.commons.param.editor.impl.ConstrainedDoubleParameterEditor
org.opensha.commons.param.editor.impl.TranslatedWarningDoubleParameterEditor
- All Implemented Interfaces:
- FocusListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ParameterEditor<Double>
public class TranslatedWarningDoubleParameterEditor
- extends ConstrainedDoubleParameterEditor
Title: TranslatedWarningDoubleParameterEditor
Description: Special ParameterEditor for editing
TranslatedWarningDoubleParameter. The widget is a NumericTextField
so that only numbers can be typed in. When hitting or moving the
mouse away from the NumericField, the value will change back to the
original if the new number is outside the constraints range. The constraints
also appear as a tool tip when you hold the mouse cursor over
the NumericTextField.
This type of editor is unique in that the parameter model contains two types
of constraints, warning and absolute. So this class actually will fire
warning events when exceeded and all listeners registered with the referenced
parameter will be notified. Other than that there is nothing more unique about
this editor from the ConstrainedDoubleParameterEditor.
- Version:
- 1.0
- Author:
- Steven W. Rock
- See Also:
AbstractParameterEditorOld,
Serialized Form
|
Field Summary |
protected static String |
C
Class name for debugging. |
protected static boolean |
D
If true print out debug statements. |
|
Method Summary |
void |
unableToSetValue(Object value)
Needs to be called by subclasses when editable widget field change fails
due to constraint problems. |
| Methods inherited from class org.opensha.commons.param.editor.AbstractParameterEditor |
getComponent, getLabelToolTipText, getParameter, getValue, getWidget, isFocusEnabled, makeSingleConstraintValueLabel, refreshParamEditor, removeWidget, setEditorBorder, setFocusEnabled, setParameter, setValue, updateTitle |
| 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.JComponent |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
C
protected static final String C
- Class name for debugging.
- See Also:
- Constant Field Values
D
protected static final boolean D
- If true print out debug statements.
- See Also:
- Constant Field Values
TranslatedWarningDoubleParameterEditor
public TranslatedWarningDoubleParameterEditor()
- No-Arg constructor calls parent constructtor
TranslatedWarningDoubleParameterEditor
public TranslatedWarningDoubleParameterEditor(Parameter model)
throws Exception
- Constructor that sets the parameter that it edits. An
Exception is thrown if the model is not an DoubleParameter.
This function only calls the super constructor.
Note: When calling the super() constuctor addWidget() is called
which configures the IntegerTextField as the editor widget.
- Throws:
Exception
unableToSetValue
public void unableToSetValue(Object value)
throws ConstraintException
- Needs to be called by subclasses when editable widget field change fails
due to constraint problems. This class implements this by
translating the TranslatedWarningDOubleParameters using it's
translator before firing the ParameterChangeFailEvent and notifying
listeners.
- Specified by:
unableToSetValue in interface ParameterEditor<Double>- Overrides:
unableToSetValue in class AbstractParameterEditor<Double>
- Parameters:
value - The value object the parameter rejected
- Throws:
ConstraintException