edu.iris.dmc.pdcc.gui
Class PdccEditPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.iris.dmc.isis.EditPanel
                      extended byedu.iris.dmc.pdcc.gui.PdccEditPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.event.InputMethodListener, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
PdccGroupPanel, PdccTreeNodePanel

public class PdccEditPanel
extends edu.iris.dmc.isis.EditPanel
implements java.awt.event.FocusListener

Main class for editable views of objects in PDCC.

Version:
5/19/2006
Author:
Robert Casey, IRIS DMC
Linus Kamb, IRIS DMC
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean allowEdits
           
protected  java.awt.Font boldFont
           
protected  javax.swing.Action closeAction
           
protected  javax.swing.JButton closeButton
           
protected  java.awt.Font defaultFont
           
protected  int endField
           
protected  int fieldIndex
           
protected  boolean isGroupPanel
           
protected  edu.iris.dmc.isis.EditPanel parentPanel
           
protected  int parentSourceField
           
protected  javax.swing.Action restoreAction
           
protected  boolean restoreActive
           
protected  javax.swing.JButton restoreButton
           
protected  int startField
           
protected static int validateKeyStroke
           
 
Fields inherited from class edu.iris.dmc.isis.EditPanel
errorMsg, isDirty, object
 
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
PdccEditPanel(PdccObject pdccObj)
          Create an instance of PdccEditPanel, showing all fields.
PdccEditPanel(PdccObject pdccObj, int startField, int endField)
          Create an instance of PdccEditPanel
PdccEditPanel(PdccObject pdccObj, int startField, int endField, int fieldIndex)
          Create an instance of PdccEditPanel
 
Method Summary
protected  void displayButtons()
           
protected  void displayEditFields()
           
protected  void displayEditFields(int from, int to)
           
protected  void displayTitle()
           
 void focusGained(java.awt.event.FocusEvent e)
          FocusListener interface implementation.
 void focusLost(java.awt.event.FocusEvent e)
          FocusListener interface implementation.
protected  java.lang.Object getBackupBoundObject(java.lang.Object boundObject)
           
protected  javax.swing.Action getCloseAction()
           
protected  javax.swing.JComboBox getDictionarySelectionBox()
           
protected  javax.swing.Action getDictionaryViewAction(javax.swing.JFrame dictFrame, int sourceField)
           
protected  javax.swing.Action getDictionaryViewAction(javax.swing.JFrame dictFrame, int sourceField, int fieldIndex, int listIndex)
           
protected  javax.swing.Action getDictSelectAction(PdccObject parentObject, int sourceField)
           
protected  javax.swing.Action getDictSelectAction(PdccObject parentObject, int sourceField, int fieldIndex, int listIndex)
           
protected  javax.swing.Action getGroupViewAction(PdccObject sourceObj, int sourceField, javax.swing.JFrame groupFrame, int startField, int endField)
           
protected  javax.swing.Action getGroupViewAction(PdccObject sourceObj, int sourceField, javax.swing.JFrame groupFrame, int startField, int endField, int fieldIndex)
           
protected  int getOriginalDictionaryIndex()
           
protected  java.awt.LayoutManager getPanelLayoutManager()
           
protected  javax.swing.Action getRestoreAction(PdccObject pdccObj)
           
protected  javax.swing.Action getTextValidateAction(PdccObject pdccObj, int fieldNum, int fieldIndex)
           
 java.lang.String getTitle()
          return the title of this edit panel
protected  boolean isValidText()
           
protected  void refreshDictionary(PdccObject startingObject)
           
protected  void restoreNotify()
          A popup to notify the user of the restore action having taken place.
 void setAllowEdits(boolean allowEdits)
          Set the flag for allowing edits to these fields.
 void setDirty(boolean flag)
          toggle the edit panel to being in 'dirty' condition, where values have been changed from the original, or 'non-dirty', where values are unaltered since last commit.
 void setEndField(int value)
          Set the end field number for this display.
 void setFocus()
          not implemented
 void setParentPanel(edu.iris.dmc.isis.EditPanel parent)
          give this edit panel a hook to the parent edit panel that launched it.
 void setPopUpFrame(javax.swing.JFrame frame)
          save a reference to the popup window frame.
 void setSourceField(int fieldNum)
          indicate to this edit panel that we were launched from a parent source field.
 void setStartField(int value)
          Set the start field number for this display.
protected  javax.swing.JComboBox setupDictionaryComboBox(javax.swing.JPanel fieldPanel, int fieldNum, PdccObject pdccObj)
           
protected  javax.swing.JComboBox setupDictionaryComboBox(javax.swing.JPanel fieldPanel, int fieldNum, PdccObject pdccObj, int fieldIndex, int listIndex)
           
protected  void setValidText(boolean validFlag)
           
 java.lang.String toString()
          this is a method that allows the panel to describe itself
protected  void truncateNotify(java.lang.String origString, int newLen)
           
 void updateObject()
          trigger validation on current field to force an update
 void updatePanel()
          update this panel with the existing object data
 void updatePanel(edu.iris.dmc.isis.Editable fromObject)
          update this panel with the provided object data
 boolean validateEntry()
          always returns true, does nothing else.
protected  void validateNotify(java.lang.String notifyString)
           
 
Methods inherited from class edu.iris.dmc.isis.EditPanel
cancel, caretPositionChanged, fillInComboBox, fillInComboBox, getContextMenu, getErrorMsg, getObject, inputMethodTextChanged, isDirty, save, setErrorMsg, setFocusOutTo, setObject
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parentPanel

protected edu.iris.dmc.isis.EditPanel parentPanel

parentSourceField

protected int parentSourceField

restoreAction

protected javax.swing.Action restoreAction

restoreButton

protected javax.swing.JButton restoreButton

closeButton

protected javax.swing.JButton closeButton

closeAction

protected javax.swing.Action closeAction

allowEdits

protected boolean allowEdits

defaultFont

protected java.awt.Font defaultFont

boldFont

protected java.awt.Font boldFont

startField

protected int startField

endField

protected int endField

fieldIndex

protected int fieldIndex

validateKeyStroke

protected static final int validateKeyStroke
See Also:
Constant Field Values

isGroupPanel

protected boolean isGroupPanel

restoreActive

protected boolean restoreActive
Constructor Detail

PdccEditPanel

public PdccEditPanel(PdccObject pdccObj,
                     int startField,
                     int endField,
                     int fieldIndex)
Create an instance of PdccEditPanel

Parameters:
pdccObj - the object to be displayed
startField - the start field to show
endField - the end field to show
fieldIndex - the field index to show

PdccEditPanel

public PdccEditPanel(PdccObject pdccObj,
                     int startField,
                     int endField)
Create an instance of PdccEditPanel

Parameters:
pdccObj - the object to be displayed
startField - the start field to show
endField - the end field to show

PdccEditPanel

public PdccEditPanel(PdccObject pdccObj)
Create an instance of PdccEditPanel, showing all fields.

Parameters:
pdccObj - the object to be displayed
Method Detail

toString

public java.lang.String toString()
this is a method that allows the panel to describe itself


getTitle

public java.lang.String getTitle()
return the title of this edit panel


setFocus

public void setFocus()
not implemented


updateObject

public void updateObject()
trigger validation on current field to force an update


updatePanel

public void updatePanel(edu.iris.dmc.isis.Editable fromObject)
update this panel with the provided object data


updatePanel

public void updatePanel()
update this panel with the existing object data


validateEntry

public boolean validateEntry()
always returns true, does nothing else.


setDirty

public void setDirty(boolean flag)
toggle the edit panel to being in 'dirty' condition, where values have been changed from the original, or 'non-dirty', where values are unaltered since last commit. This is an extension from EditPanel that defines isDirty and the method isDirty().


setAllowEdits

public void setAllowEdits(boolean allowEdits)
Set the flag for allowing edits to these fields. Not sure if this implementation works correctly.

Parameters:
allowEdits - true to allow edits

setStartField

public void setStartField(int value)
Set the start field number for this display.

Parameters:
value - the start field number as a value greater than zero.

setEndField

public void setEndField(int value)
Set the end field number for this display.

Parameters:
value - the end field number as a value greater than zero.

setPopUpFrame

public void setPopUpFrame(javax.swing.JFrame frame)
save a reference to the popup window frame. because this is a popup window, provide a close button


setParentPanel

public void setParentPanel(edu.iris.dmc.isis.EditPanel parent)
give this edit panel a hook to the parent edit panel that launched it. this is helpful for performing updates back to the parent.


setSourceField

public void setSourceField(int fieldNum)
indicate to this edit panel that we were launched from a parent source field. we may need to refer back to that field later.

Parameters:
fieldNum - referencing field number (source field) to an abbreviation dictionary

focusGained

public void focusGained(java.awt.event.FocusEvent e)
FocusListener interface implementation. Handles failed validation situations by highlighting the offending field.

Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
FocusListener interface implementation. triggers the validation of edited fields.

Specified by:
focusLost in interface java.awt.event.FocusListener

getPanelLayoutManager

protected java.awt.LayoutManager getPanelLayoutManager()
                                                throws java.lang.Exception
Throws:
java.lang.Exception

displayTitle

protected void displayTitle()

displayEditFields

protected void displayEditFields()

displayEditFields

protected void displayEditFields(int from,
                                 int to)

restoreNotify

protected void restoreNotify()
A popup to notify the user of the restore action having taken place.


validateNotify

protected void validateNotify(java.lang.String notifyString)

truncateNotify

protected void truncateNotify(java.lang.String origString,
                              int newLen)

displayButtons

protected void displayButtons()

getRestoreAction

protected javax.swing.Action getRestoreAction(PdccObject pdccObj)

getCloseAction

protected javax.swing.Action getCloseAction()

getDictionaryViewAction

protected javax.swing.Action getDictionaryViewAction(javax.swing.JFrame dictFrame,
                                                     int sourceField)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getDictionaryViewAction

protected javax.swing.Action getDictionaryViewAction(javax.swing.JFrame dictFrame,
                                                     int sourceField,
                                                     int fieldIndex,
                                                     int listIndex)
                                              throws java.lang.Exception
Throws:
java.lang.Exception

getGroupViewAction

protected javax.swing.Action getGroupViewAction(PdccObject sourceObj,
                                                int sourceField,
                                                javax.swing.JFrame groupFrame,
                                                int startField,
                                                int endField)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getGroupViewAction

protected javax.swing.Action getGroupViewAction(PdccObject sourceObj,
                                                int sourceField,
                                                javax.swing.JFrame groupFrame,
                                                int startField,
                                                int endField,
                                                int fieldIndex)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

getTextValidateAction

protected javax.swing.Action getTextValidateAction(PdccObject pdccObj,
                                                   int fieldNum,
                                                   int fieldIndex)
                                            throws java.lang.Exception
Throws:
java.lang.Exception

getDictSelectAction

protected javax.swing.Action getDictSelectAction(PdccObject parentObject,
                                                 int sourceField)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getDictSelectAction

protected javax.swing.Action getDictSelectAction(PdccObject parentObject,
                                                 int sourceField,
                                                 int fieldIndex,
                                                 int listIndex)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

setupDictionaryComboBox

protected javax.swing.JComboBox setupDictionaryComboBox(javax.swing.JPanel fieldPanel,
                                                        int fieldNum,
                                                        PdccObject pdccObj)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

setupDictionaryComboBox

protected javax.swing.JComboBox setupDictionaryComboBox(javax.swing.JPanel fieldPanel,
                                                        int fieldNum,
                                                        PdccObject pdccObj,
                                                        int fieldIndex,
                                                        int listIndex)
                                                 throws java.lang.Exception
Throws:
java.lang.Exception

getDictionarySelectionBox

protected javax.swing.JComboBox getDictionarySelectionBox()

getOriginalDictionaryIndex

protected int getOriginalDictionaryIndex()

refreshDictionary

protected void refreshDictionary(PdccObject startingObject)
                          throws java.lang.Exception
Throws:
java.lang.Exception

getBackupBoundObject

protected java.lang.Object getBackupBoundObject(java.lang.Object boundObject)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

setValidText

protected void setValidText(boolean validFlag)

isValidText

protected boolean isValidText()


brought to you by Incorporated Research Institutions for Seismology
June 29 2006