org.opensha.sha.gui.beans
Class EqkRuptureFromERFSelectorPanel

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.sha.gui.beans.EqkRuptureFromERFSelectorPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ParameterChangeListener, EqkRupSelectorGuiBeanAPI

public class EqkRuptureFromERFSelectorPanel
extends javax.swing.JPanel
implements ParameterChangeListener, EqkRupSelectorGuiBeanAPI

Title: EqkRuptureFromERFSelectorPanel

Description: This class creates a JPanel to select the Earthquake Rupture from the list of already existing Earthquake Rupture Forecast model.

Version:
1.0
Author:
: Ned Field, Nitin Gupta and Vipin Gupta
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
          Name of the class
protected static boolean D
           
static java.lang.String ERF_PARAM_NAME
           
static java.lang.String RUPTURE_HYPOLOCATIONS_PARAM_NAME
           
static java.lang.String RUPTURE_PARAM_NAME
           
static java.lang.String SOURCE_PARAM_NAME
           
 
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
EqkRuptureFromERFSelectorPanel(BaseERF baseERF, java.util.List<ERF_Ref> erfRefs)
          If Application has already created the ERF Gui Bean then give that to this Gui Bean.
EqkRuptureFromERFSelectorPanel(java.util.List<ERF_Ref> erfRefs)
          Constructor : It accepts the classNames of the ERFs to be shown in the editor
 
Method Summary
 void addERFs_ToList(java.util.ArrayList erfList)
          Adds the ERF's to the existing ERF List in the gui bean to be displayed in the gui.
 EqkRupSelectorGuiBeanAPI getEqkRuptureSelectorPanel()
           
 ERF_GuiBean getERF_ParamEditor()
           
 Location getHypocenterLocation()
           
 void getHypocenterLocationsForSelectedRupture()
          First gets the rupture with given index from the source as selected in the GUI Bean, so that hypocenter parameter always shows the locations for the selected rupture index in the GUI.
 Parameter getParameter(java.lang.String param)
           
 ParameterEditor getParameterEditor(java.lang.String paramName)
           
 ParameterListEditor getParameterListEditor()
           
 java.lang.String getParameterListMetadataString()
          First gets the selected index rupture from the source, so that user gets the metadata for the rupture selected in this GUI bean.
 EqkRupture getRupture()
          We are getting the rupture with rupIndex from the source with sourceIndex, that user has input in GUI bean always.
 int getRuptureIndex()
           
 ERF getSelectedERF_Instance()
           
 ProbEqkSource getSource()
           
 int getSourceIndex()
           
 java.lang.String getTimespanMetadataString()
           
 ParameterList getVisibleParameterList()
           
 void parameterChange(ParameterChangeEvent event)
          This is the main function of this interface.
 void removeERFs_FromList(java.util.ArrayList erfList)
          Removes the ERF's from the existing ERF List in the gui bean to be displayed in the gui.
 void setEqkRupForecast(BaseERF erf)
          Sets the selected ERF in the ERF GuiBean
 void setRuptureForSelectedSource(int ruptureIndex)
          set the rupture, for the selected source, with ruptureIndex in the Rupture Index parameter
 void setSelectedERF()
          creates the selected ERF based on the selected ERF Name
 void setSourceFromSelectedERF(int sourceIndex)
          set the source, from selected ERF, with sourceIndex in the Source parameter
 void showAllParamsForForecast(boolean flag)
          see if we have to show all the Adjustable Params for the ERF in a seperate window when user selects different ERF.
 
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, setEnabled, 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

C

protected static final java.lang.String C
Name of the class

See Also:
Constant Field Values

D

protected static final boolean D
See Also:
Constant Field Values

ERF_PARAM_NAME

public static final java.lang.String ERF_PARAM_NAME
See Also:
Constant Field Values

SOURCE_PARAM_NAME

public static final java.lang.String SOURCE_PARAM_NAME
See Also:
Constant Field Values

RUPTURE_PARAM_NAME

public static final java.lang.String RUPTURE_PARAM_NAME
See Also:
Constant Field Values

RUPTURE_HYPOLOCATIONS_PARAM_NAME

public static final java.lang.String RUPTURE_HYPOLOCATIONS_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

EqkRuptureFromERFSelectorPanel

public EqkRuptureFromERFSelectorPanel(BaseERF baseERF,
                                      java.util.List<ERF_Ref> erfRefs)
If Application has already created the ERF Gui Bean then give that to this Gui Bean. This will allow it to extract the ERF from that GuiBean.

Parameters:
erfGuiBean - ERF_GuiBean

EqkRuptureFromERFSelectorPanel

public EqkRuptureFromERFSelectorPanel(java.util.List<ERF_Ref> erfRefs)
                               throws java.lang.reflect.InvocationTargetException
Constructor : It accepts the classNames of the ERFs to be shown in the editor

Parameters:
erfClassNames -
Throws:
java.lang.reflect.InvocationTargetException
Method Detail

setSelectedERF

public void setSelectedERF()
creates the selected ERF based on the selected ERF Name


setEqkRupForecast

public void setEqkRupForecast(BaseERF erf)
Sets the selected ERF in the ERF GuiBean

Parameters:
erf - EqkRupForecastAPI

setSourceFromSelectedERF

public void setSourceFromSelectedERF(int sourceIndex)
set the source, from selected ERF, with sourceIndex in the Source parameter

Parameters:
sourceIndex -

setRuptureForSelectedSource

public void setRuptureForSelectedSource(int ruptureIndex)
set the rupture, for the selected source, with ruptureIndex in the Rupture Index parameter

Parameters:
ruptureIndex -

getHypocenterLocationsForSelectedRupture

public void getHypocenterLocationsForSelectedRupture()
First gets the rupture with given index from the source as selected in the GUI Bean, so that hypocenter parameter always shows the locations for the selected rupture index in the GUI. gets the hypocenter locations for the selected rupture and adds those to the hypocenter location parameter.


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 -

showAllParamsForForecast

public void showAllParamsForForecast(boolean flag)
see if we have to show all the Adjustable Params for the ERF in a seperate window when user selects different ERF.

Parameters:
flag: - Based on the boolean flag the ERF adjuatable Param List is shown if user changes the selcetd ERF.

getERF_ParamEditor

public ERF_GuiBean getERF_ParamEditor()
Returns:
the instance of the ERF_GuiBean that holds all the Adjustable Params for the selecetd ERF.

getParameterListMetadataString

public java.lang.String getParameterListMetadataString()
First gets the selected index rupture from the source, so that user gets the metadata for the rupture selected in this GUI bean.

Specified by:
getParameterListMetadataString in interface EqkRupSelectorGuiBeanAPI
Returns:
the Metadata String of parameters that constitute the making of this ERF_RupSelectorGUI bean.

addERFs_ToList

public void addERFs_ToList(java.util.ArrayList erfList)
                    throws java.lang.reflect.InvocationTargetException
Adds the ERF's to the existing ERF List in the gui bean to be displayed in the gui. This function allows user to add the more ERF's names to the existing list from the application. This function allows user with the flexibility that he does not always have to specify the erfNames at time of instantiating this ERF gui bean.

Parameters:
erfList -
Throws:
java.lang.reflect.InvocationTargetException

removeERFs_FromList

public void removeERFs_FromList(java.util.ArrayList erfList)
                         throws java.lang.reflect.InvocationTargetException
Removes the ERF's from the existing ERF List in the gui bean to be displayed in the gui. This function allows user to remove ERF's names from the existing list from the application. This function allows user with the flexibility that he can always remove the erfNames later after instantiating this ERF gui bean.

Parameters:
erfList -
Throws:
java.lang.reflect.InvocationTargetException

getParameter

public Parameter getParameter(java.lang.String param)
Specified by:
getParameter in interface EqkRupSelectorGuiBeanAPI
Parameters:
: - Name of the Parameter
Returns:
the parameter with the name param

getParameterEditor

public ParameterEditor getParameterEditor(java.lang.String paramName)
Specified by:
getParameterEditor in interface EqkRupSelectorGuiBeanAPI
Parameters:
paramName -
Returns:
the ParameterEditor associated with paramName

getSelectedERF_Instance

public ERF getSelectedERF_Instance()
Returns:
the EqkRupforecast model

getRupture

public EqkRupture getRupture()
We are getting the rupture with rupIndex from the source with sourceIndex, that user has input in GUI bean always. This way if someone has got the handle to the source from outside then looped over all the rupture then also this GUI bean will return the rupture with ith index from the source as given in GUI bean.

Specified by:
getRupture in interface EqkRupSelectorGuiBeanAPI
Returns:
the ProbEqkRupture Object

getSource

public ProbEqkSource getSource()

getParameterListEditor

public ParameterListEditor getParameterListEditor()
Specified by:
getParameterListEditor in interface EqkRupSelectorGuiBeanAPI
Returns:
the parameterlist editor

getVisibleParameterList

public ParameterList getVisibleParameterList()
Specified by:
getVisibleParameterList in interface EqkRupSelectorGuiBeanAPI
Returns:
the visible parameters in the list

getSourceIndex

public int getSourceIndex()
Returns:
the selected source number for the EarthquakeRuptureForecast

getRuptureIndex

public int getRuptureIndex()
Returns:
the selected rupture number for the selected source.

getHypocenterLocation

public Location getHypocenterLocation()
Specified by:
getHypocenterLocation in interface EqkRupSelectorGuiBeanAPI
Returns:
the Hypocenter Location if selected else return null

getEqkRuptureSelectorPanel

public EqkRupSelectorGuiBeanAPI getEqkRuptureSelectorPanel()
Specified by:
getEqkRuptureSelectorPanel in interface EqkRupSelectorGuiBeanAPI
Returns:
the panel which allows user to select Eqk rupture from existing ERF models

getTimespanMetadataString

public java.lang.String getTimespanMetadataString()
Specified by:
getTimespanMetadataString in interface EqkRupSelectorGuiBeanAPI
Returns:
the timespan Metadata for the selected Rupture. If no timespan exists for the rupture then it returns the Message: "No Timespan exists for the selected Rupture".