org.opensha.sha.gui.beans
Class ERF_GuiBean

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.ERF_GuiBean
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ParameterChangeFailListener, ParameterChangeListener

public class ERF_GuiBean
extends javax.swing.JPanel
implements ParameterChangeFailListener, ParameterChangeListener

Title: ERF_GuiBean

Description: It displays ERFs and parameters supported by them

Copyright: Copyright (c) 2002

Company:

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
static java.lang.String ERF_EDITOR_TITLE
           
static java.lang.String ERF_PARAM_NAME
           
protected  java.util.ArrayList<java.lang.String> erfNamesVector
           
 
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
ERF_GuiBean(ERF_Ref... erfRefs)
           
ERF_GuiBean(java.util.List<ERF_Ref> erfRefs)
          Constructor : It accepts the classNames of the ERFs to be shown in the editor
ERF_GuiBean(java.util.Set<ERF_Ref> erfRefs)
           
 
Method Summary
 void addERFs_ToList(java.util.ArrayList<ERF_Ref> newRefs)
          Adds the ERF's to the existing ERF List in the gui bean to be displayed in the gui.
protected static java.util.List<ERF_Ref> asList(java.util.Set<ERF_Ref> erfRefSet)
           
 void closeProgressBar()
          This function closes the progress bar window which shows forcast updation, if user has choosen to see the progress of updation, in the first place.
 ParameterList getERFParameterList()
           
 ParameterListEditor getERFParameterListEditor()
           
 MagFreqDistParameterEditor getMagDistEditor()
          gets the lists of all the parameters that exists in the ERF parameter Editor then checks if the magFreqDistParameter exists inside it , if so then returns the MagEditor else return null.
 Parameter getParameter(java.lang.String paramName)
           
 BaseERF getSelectedERF_Instance()
          get the selected ERF instance It returns the forecast without updating the forecast
 java.lang.String getSelectedERF_Name()
          returns the name of selected ERF
 BaseERF getSelectedERF()
          get the selected ERF instance.
 TimeSpanGuiBean getSelectedERFTimespanGuiBean()
           
 SimpleFaultParameterEditor getSimpleFaultParamEditor()
          gets the lists of all the parameters that exists in the ERF parameter Editor then checks if the simpleFaultParameter exists inside it , if so then returns the SimpleFaultParameterEditor else return null.
protected  void init_erf_IndParamListAndEditor()
          init erf_IndParamList.
 boolean isEpistemicList()
          It sees whether selected ERF is a Epistemic list.
 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 refreshGUI()
           
 void removeERFs_FromList(java.util.ArrayList<ERF_Ref> removed)
          Removes the ERF's from the existing ERF List in the gui bean to be displayed in the gui.
 java.lang.String saveSelectedERF()
          Save the selected forecast into a file
 void setERF(BaseERF eqkRupForecast)
          Sets the EqkRupForecast in the ERF_GuiBean
 void showProgressBar(boolean show)
          This allows tuning on or off the showing of a progress bar
protected  void updateFaultParam()
          checks if the Fault Parameter Editor exists inside it , if so then gets its Editor and calls the method to update the faultParams.
protected  void updateMagDistParam()
          checks if the magFreqDistParameter exists inside it , if so then gets its Editor and calls the method to update the magDistParams.
 
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

erfNamesVector

protected java.util.ArrayList<java.lang.String> erfNamesVector

ERF_PARAM_NAME

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

ERF_EDITOR_TITLE

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

ERF_GuiBean

public ERF_GuiBean(ERF_Ref... erfRefs)
            throws java.lang.reflect.InvocationTargetException
Throws:
java.lang.reflect.InvocationTargetException

ERF_GuiBean

public ERF_GuiBean(java.util.Set<ERF_Ref> erfRefs)
            throws java.lang.reflect.InvocationTargetException
Throws:
java.lang.reflect.InvocationTargetException

ERF_GuiBean

public ERF_GuiBean(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

asList

protected static java.util.List<ERF_Ref> asList(java.util.Set<ERF_Ref> erfRefSet)

init_erf_IndParamListAndEditor

protected void init_erf_IndParamListAndEditor()
                                       throws java.lang.reflect.InvocationTargetException
init erf_IndParamList. List of all available forecasts at this time

Throws:
java.lang.reflect.InvocationTargetException

getMagDistEditor

public MagFreqDistParameterEditor getMagDistEditor()
gets the lists of all the parameters that exists in the ERF parameter Editor then checks if the magFreqDistParameter exists inside it , if so then returns the MagEditor else return null. The only reason this is public is because at least one control panel (for the PEER test cases) needs access.

Returns:
MagFreDistParameterEditor

getSimpleFaultParamEditor

public SimpleFaultParameterEditor getSimpleFaultParamEditor()
gets the lists of all the parameters that exists in the ERF parameter Editor then checks if the simpleFaultParameter exists inside it , if so then returns the SimpleFaultParameterEditor else return null. The only reason this is public is because at least one control panel (for the PEER test cases) needs access.

Returns:
SimpleFaultParameterEditor

getSelectedERF_Name

public java.lang.String getSelectedERF_Name()
returns the name of selected ERF

Returns:

getSelectedERF_Instance

public BaseERF getSelectedERF_Instance()
                                throws java.lang.reflect.InvocationTargetException
get the selected ERF instance It returns the forecast without updating the forecast

Returns:
Throws:
java.lang.reflect.InvocationTargetException

getSelectedERF

public BaseERF getSelectedERF()
                       throws java.lang.reflect.InvocationTargetException
get the selected ERF instance. It returns the ERF after updating its forecast

Returns:
Throws:
java.lang.reflect.InvocationTargetException

saveSelectedERF

public java.lang.String saveSelectedERF()
                                 throws java.lang.reflect.InvocationTargetException
Save the selected forecast into a file

Returns:
Throws:
java.lang.reflect.InvocationTargetException

isEpistemicList

public boolean isEpistemicList()
It sees whether selected ERF is a Epistemic list.

Returns:
: true if selected ERF is a epistemic list, else false

updateMagDistParam

protected void updateMagDistParam()
checks if the magFreqDistParameter exists inside it , if so then gets its Editor and calls the method to update the magDistParams.


updateFaultParam

protected void updateFaultParam()
checks if the Fault Parameter Editor exists inside it , if so then gets its Editor and calls the method to update the faultParams.


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

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 -

refreshGUI

public void refreshGUI()

showProgressBar

public void showProgressBar(boolean show)
This allows tuning on or off the showing of a progress bar

Parameters:
show - - set as true to show it, or false to not show it

addERFs_ToList

public void addERFs_ToList(java.util.ArrayList<ERF_Ref> newRefs)
                    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

closeProgressBar

public void closeProgressBar()
This function closes the progress bar window which shows forcast updation, if user has choosen to see the progress of updation, in the first place.


removeERFs_FromList

public void removeERFs_FromList(java.util.ArrayList<ERF_Ref> removed)
                         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

getERFParameterList

public ParameterList getERFParameterList()
Returns:
the List of ERF parameters

getERFParameterListEditor

public ParameterListEditor getERFParameterListEditor()
Returns:
the parameter list editor for ERF parameters

setERF

public void setERF(BaseERF eqkRupForecast)
Sets the EqkRupForecast in the ERF_GuiBean


getSelectedERFTimespanGuiBean

public TimeSpanGuiBean getSelectedERFTimespanGuiBean()
Returns:
the selected ERF timespan gui bean object

getParameter

public Parameter getParameter(java.lang.String paramName)
Parameters:
paramName -
Returns:
the parameter with the ParamName