org.opensha.sha.param.editor.gui
Class SimpleFaultParameterEditorPanel

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.gui.SimpleFaultParameterEditorPanel
All Implemented Interfaces:
ActionListener, FocusListener, KeyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ParameterEditor, ParameterChangeFailListener, ParameterChangeListener

public class SimpleFaultParameterEditorPanel
extends AbstractParameterEditorOld
implements ParameterChangeListener, ParameterChangeFailListener, ActionListener

Title: SimpleFaultParameterEditorPanel

Description: It is a more general parameter than just a Simple Fault Parameter Editor because actually inside it creates an object of the EvenlyGriddedSurface1EvenlyGriddedSurface1.

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

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 String C
          Class name for debugging.
protected static boolean D
          If true print out debug statements.
static String SIMPLE_FAULT_EDITOR_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
SimpleFaultParameterEditorPanel()
           
SimpleFaultParameterEditorPanel(Parameter model)
           
 
Method Summary
 void actionPerformed(ActionEvent ae)
          This function is called when Update Surface button is pressed
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 setAll(double gridSpacing, ArrayList lats, ArrayList lons, ArrayList dips, ArrayList depths, String faultType)
          This sets all the fault data needed to make a evenly discretized fault
 void setAll(String name, double gridSpacing, ArrayList lats, ArrayList lons, ArrayList dips, ArrayList depths, String faultType)
          This sets all the fault data needed to make a evenly discretized fault
 void setDipDirection(double value)
          Sets the Average Dip Direction for the evenly discritized fault.
 void setEvenlyGriddedSurfaceFromParams()
          creates the evenly gridded surface from the fault parameter.
 void setFaultNameVisible(boolean flag)
          Sets the visibility for the fault name param
 void setParameter(Parameter param)
          Set the values in the Parameters for the EvenlyGridded Surface
 
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, 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
 
Methods inherited from interface org.opensha.commons.param.editor.ParameterEditor
isVisible, setVisible
 

Field Detail

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

SIMPLE_FAULT_EDITOR_TITLE

public static final String SIMPLE_FAULT_EDITOR_TITLE
Constructor Detail

SimpleFaultParameterEditorPanel

public SimpleFaultParameterEditorPanel()

SimpleFaultParameterEditorPanel

public SimpleFaultParameterEditorPanel(Parameter model)
Method Detail

setParameter

public void setParameter(Parameter param)
Set the values in the Parameters for the EvenlyGridded Surface

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

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
Overrides:
refreshParamEditor in class AbstractParameterEditorOld

setAll

public void setAll(String name,
                   double gridSpacing,
                   ArrayList lats,
                   ArrayList lons,
                   ArrayList dips,
                   ArrayList depths,
                   String faultType)
This sets all the fault data needed to make a evenly discretized fault

Parameters:
name - : Name of the fault
gridSpacing -
lats - : ArrayList of Latitudes for the discretized fault
lons - : ArrayList of Longitudes for the discretized fault
dips - : ArrayList of Dips
depths - : ArrayList of Depths, which are one more then the number of dips
faultType - : STIRLING or FRANKEL fault

setAll

public void setAll(double gridSpacing,
                   ArrayList lats,
                   ArrayList lons,
                   ArrayList dips,
                   ArrayList depths,
                   String faultType)
This sets all the fault data needed to make a evenly discretized fault

Parameters:
gridSpacing -
lats - : ArrayList of Latitudes for the discretized fault
lons - : ArrayList of Longitudes for the discretized fault
dips - : ArrayList of Dips
depths - : ArrayList of Depths, which are one more then the number of dips
faultType - : STIRLING or FRANKEL fault

setDipDirection

public void setDipDirection(double value)
Sets the Average Dip Direction for the evenly discritized fault. By Default its value is NaN and its value can only be set if one has selected the Fault type to be Stirling


jbInit

protected void jbInit()
               throws 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:
Exception

setFaultNameVisible

public void setFaultNameVisible(boolean flag)
Sets the visibility for the fault name param

Parameters:
flag -

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 -

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

setEvenlyGriddedSurfaceFromParams

public void setEvenlyGriddedSurfaceFromParams()
                                       throws RuntimeException
creates the evenly gridded surface from the fault parameter. This function has to be called explicitly in order to Create/Update or it can updated when the user press the "Update Surface" button the gridded surface.

Throws:
RuntimeException

actionPerformed

public void actionPerformed(ActionEvent ae)
This function is called when Update Surface button is pressed

Specified by:
actionPerformed in interface ActionListener
Parameters:
ae -