org.opensha.sha.param.editor
Class MagPDF_ParameterEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.opensha.commons.param.editor.AbstractParameterEditorOld
                      extended by org.opensha.sha.param.editor.MagPDF_ParameterEditor
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ParameterEditor, ParameterChangeFailListener, ParameterChangeListener, MagDistParameterEditorAPI

public class MagPDF_ParameterEditor
extends AbstractParameterEditorOld
implements ParameterChangeListener, ParameterChangeFailListener, java.awt.event.ActionListener, MagDistParameterEditorAPI

Title: MagPDF_ParameterEditor

b>Description: This is a MagFreqDistParameter editor. All parameters listed in the constraint of the MagFreqDistParameter are listed as choices, and below are shown the associated independent parameters than need to be filled in to make the desired distribution.

Version:
1.0
Author:
Nitin & Vipin Gupta, and Ned Field
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static java.lang.String C
          Class name for debugging.
protected static boolean D
          If true print out debug statements.
static java.lang.String MAG_DIST_TITLE
           
 
Fields inherited from class org.opensha.commons.param.editor.AbstractParameterEditorOld
border1, catchConstraint, COMBO_WIDGET_GBC, CONST_BORDER, DATA_TEXT, DEFAULT_FONT, DEFAULT_LABEL_FONT, EMPTY, ETCHED, FIVE_FIVE_INSETS, FIVE_INSETS, FOCUS_BORDER, focusEnabled, focusLostProcessing, FORE_COLOR, GBL, JCOMBO_DIM, JCOMBO_FONT, JLIST_DIM, keyTypeProcessing, LABEL_DIM, LABEL_PANEL_DIM, LABEL_TEXT, labelPanel, model, nameLabel, OUTER_PANEL_GBC, outerPanel, STRING_BACK_COLOR, titledBorder1, valueEditor, WIDGET_GBC, WIDGET_PANEL_GBC, widgetPanel, WIGET_PANEL_DIM, ZERO_INSETS
 
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
MagPDF_ParameterEditor()
          Constructor
MagPDF_ParameterEditor(Parameter model)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          This function is called when the user click for the ParameterListParameterEditor Button
 ParameterListEditor createMagFreqDistParameterEditor()
          Clones the Mag ParamList and the makes the parameters visible based on the selected Distribution.
 java.lang.String getMagDistName()
          returns the MagDistName
 ParameterListEditor getMagFreqDistParameterEditor()
          Function that returns the magFreDist Param as a parameterListeditor so that user can display it as the panel in window rather then button.
 double getMax()
          returns the Max of the magnitude for thr distribution
 double getMin()
          returns the Min of the magnitude for the distribution
 java.lang.String getName()
          Gets the name attribute of the MagDistGuiBean object
 int getNum()
          returns the Number of magnitudes for the Distribution
 Parameter getParameter(java.lang.String name)
          Returns each parameter for the MagFreqDist
 ParameterList getParameterList()
          returns the parameterlist
 ParameterList getParamterList()
          returns the ParamterList for the MagfreqDistParameter
protected  void initParamList()
           
protected  void jbInit()
          Main GUI Initialization point.
 void parameterChange(ParameterChangeEvent event)
          This is the main function of this interface.
 void parameterChangeFailed(ParameterChangeFailEvent e)
          Shown when a Constraint error is thrown on a ParameterEditor
 void refreshParamEditor()
          Called when the parameter has changed independently from the editor, such as with the ParameterWarningListener.
 void setMagDistFromParams()
          Controller function.
 void setMagDistFromParams(SummedMagFreqDist summedDist, java.lang.String metadata)
          Sets the MagDistParam to be SummedMagFreqDist
 void setMagFreqDistParamButtonVisible(boolean visible)
          Checks whether you want to show the Mag Freq Dist Param Editor as button or a panel This function mostly come in handy if instead of displaying this parameter as the button user wants to show it as the Parameterlist in the panel.
 void setParameter(Parameter param)
          Returns the parameter that is stored internally that this GUI widget is editing
 void setSummedDistPlotted(boolean sumDistPlotted)
          Sets the Summed Dist plotted to be false or true based on
protected  void synchRequiredVisibleParameters()
          Description of the Method
 
Methods inherited from class org.opensha.commons.param.editor.AbstractParameterEditorOld
addWidget, focusGained, focusLost, getComponent, getOuterPanel, getParameter, getValue, getValueEditor, isFocusEnabled, keyPressed, keyReleased, keyTyped, makeConstantEditor, removeWidget, setEditorBorder, setEnabled, setFocusEnabled, setNameLabelToolTip, setParameterInEditor, setValue, setWidgetBorder, setWidgetObject, unableToSetValue, updateNameLabel
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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
add, add, add, add, add, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opensha.sha.param.editor.MagDistParameterEditorAPI
getParameter
 
Methods inherited from interface org.opensha.commons.param.editor.ParameterEditor
isVisible, setVisible
 

Field Detail

C

protected static final java.lang.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

MAG_DIST_TITLE

public static final java.lang.String MAG_DIST_TITLE
Constructor Detail

MagPDF_ParameterEditor

public MagPDF_ParameterEditor()
Constructor


MagPDF_ParameterEditor

public MagPDF_ParameterEditor(Parameter model)
Method Detail

setParameter

public void setParameter(Parameter param)
Returns the parameter that is stored internally that this GUI widget is editing

Specified by:
setParameter in interface ParameterEditor
Specified by:
setParameter in interface MagDistParameterEditorAPI
Overrides:
setParameter in class AbstractParameterEditorOld

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
This function is called when the user click for the ParameterListParameterEditor Button

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
ae -

setMagFreqDistParamButtonVisible

public void setMagFreqDistParamButtonVisible(boolean visible)
Checks whether you want to show the Mag Freq Dist Param Editor as button or a panel This function mostly come in handy if instead of displaying this parameter as the button user wants to show it as the Parameterlist in the panel.

Specified by:
setMagFreqDistParamButtonVisible in interface MagDistParameterEditorAPI
Parameters:
visible - : If it it true, button is visible else not visible By default it is visible

createMagFreqDistParameterEditor

public ParameterListEditor createMagFreqDistParameterEditor()
Clones the Mag ParamList and the makes the parameters visible based on the selected Distribution.

Specified by:
createMagFreqDistParameterEditor in interface MagDistParameterEditorAPI
Returns:

getMagFreqDistParameterEditor

public ParameterListEditor getMagFreqDistParameterEditor()
Function that returns the magFreDist Param as a parameterListeditor so that user can display it as the panel in window rather then button.

Specified by:
getMagFreqDistParameterEditor in interface MagDistParameterEditorAPI
Returns:

jbInit

protected void jbInit()
               throws java.lang.Exception
Main GUI Initialization point. This block of code is updated by JBuilder when using it's GUI Editor.

Overrides:
jbInit in class AbstractParameterEditorOld
Throws:
java.lang.Exception

refreshParamEditor

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

Specified by:
refreshParamEditor in interface ParameterEditor
Specified by:
refreshParamEditor in interface MagDistParameterEditorAPI
Overrides:
refreshParamEditor in class AbstractParameterEditorOld

initParamList

protected void initParamList()

synchRequiredVisibleParameters

protected void synchRequiredVisibleParameters()
                                       throws ParameterException
Description of the Method

Throws:
ParameterException - Description of the Exception

getName

public java.lang.String getName()
Gets the name attribute of the MagDistGuiBean object

Overrides:
getName in class java.awt.Component
Returns:
The name value

parameterChange

public void parameterChange(ParameterChangeEvent event)
This is the main function of this interface. Any time a control paramater or independent paramater is changed by the user in a GUI this function is called, and a paramater change event is passed in. This function then determines what to do with the information ie. show some paramaters, set some as invisible, basically control the paramater lists.

Specified by:
parameterChange in interface ParameterChangeListener
Parameters:
event -

setMagDistFromParams

public void setMagDistFromParams()
                          throws ConstraintException
Controller function. Dispacter function. Based on which Mag Dist was choosen, and which parameters are set. determines which dependent variable discretized function to return.

Specified by:
setMagDistFromParams in interface MagDistParameterEditorAPI
Throws:
ConstraintException - Description of the Exception

setMagDistFromParams

public void setMagDistFromParams(SummedMagFreqDist summedDist,
                                 java.lang.String metadata)
                          throws java.lang.UnsupportedOperationException
Sets the MagDistParam to be SummedMagFreqDist

Specified by:
setMagDistFromParams in interface MagDistParameterEditorAPI
Throws:
ConstraintException - Description of the Exception
java.lang.UnsupportedOperationException

setSummedDistPlotted

public void setSummedDistPlotted(boolean sumDistPlotted)
                          throws java.lang.UnsupportedOperationException
Sets the Summed Dist plotted to be false or true based on

Specified by:
setSummedDistPlotted in interface MagDistParameterEditorAPI
Parameters:
sumDistPlotted - boolean
Throws:
java.lang.UnsupportedOperationException

parameterChangeFailed

public void parameterChangeFailed(ParameterChangeFailEvent e)
Shown when a Constraint error is thrown on a ParameterEditor

Specified by:
parameterChangeFailed in interface ParameterChangeFailListener
Parameters:
e - Description of the Parameter

getMagDistName

public java.lang.String getMagDistName()
returns the MagDistName

Specified by:
getMagDistName in interface MagDistParameterEditorAPI
Returns:

getMin

public double getMin()
returns the Min of the magnitude for the distribution

Specified by:
getMin in interface MagDistParameterEditorAPI
Returns:

getMax

public double getMax()
returns the Max of the magnitude for thr distribution

Specified by:
getMax in interface MagDistParameterEditorAPI
Returns:

getNum

public int getNum()
returns the Number of magnitudes for the Distribution

Specified by:
getNum in interface MagDistParameterEditorAPI
Returns:

getParamterList

public ParameterList getParamterList()
returns the ParamterList for the MagfreqDistParameter

Specified by:
getParamterList in interface MagDistParameterEditorAPI
Returns:

getParameter

public Parameter getParameter(java.lang.String name)
                       throws ParameterException
Returns each parameter for the MagFreqDist

Specified by:
getParameter in interface MagDistParameterEditorAPI
Throws:
ParameterException

getParameterList

public ParameterList getParameterList()
returns the parameterlist

Specified by:
getParameterList in interface MagDistParameterEditorAPI