arlut.csd.ganymede.client
Class containerPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--arlut.csd.ganymede.client.containerPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, JsetValueCallback, java.awt.MenuContainer, java.io.Serializable

public class containerPanel
extends javax.swing.JPanel
implements java.awt.event.ActionListener, JsetValueCallback, java.awt.event.ItemListener

One of the basic building blocks of the ganymede client, a containerPanel is a GUI panel which allows the user to view and/or edit all the custom fields for an object in the Ganymede database.

Each containerPanel displays a single db_object, and allows the user to edit or view each db_field in the object. On loading, containerPanel loops through the fields of the object, adding the appropriate type of input for each field. This includes text fields, number fields, boolean fields, and string selector fields(fields that can have multiple values).

containerPanel handles the connection between GUI components and server fields, translating GUI activity to attempted changes to server fields. Any attempted change that the server refuses will cause a dialog to be popped up via gclient's handleReturnVal() method, and the GUI component that caused the change will be reverted to its pre-change status.

The gclient's handleReturnVal() method also supports extracting a list of objects and fields that need to be refreshed when one change on the server is reflected across more than one object. This is handled by containerPanel's update() method.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent, javax.swing.JComponent.ActionStandin, javax.swing.JComponent.IntVector, javax.swing.JComponent.KeyboardState
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  javax.swing.JComponent currentlyChangingComponent
          To help avoid recursive problems, we keep track of any arlut.csd.JDataComponent GUI components that are currently having their change notification messages handled, and refuse to try to refresh them reentrantly.
(package private)  boolean debug
           
(package private) static boolean debug_persona
           
(package private)  boolean editable
           
(package private) static int FIELDWIDTH
           
protected  framePanel frame
          The window we are contained in, may be null if we are embedded in a vectorPanel.
(package private)  java.awt.GridBagConstraints gbc
           
(package private)  java.awt.GridBagLayout gbl
           
(package private)  gclient gc
          Reference to the client's main class, used for some utility functions.
(package private)  java.util.Vector infoVector
          Vector of FieldInfo objects holding the values for fields in this object.
private  Invid invid
          Database id for the object we are viewing or editing
(package private)  java.util.Hashtable invidChooserHash
          Hashtable mapping the combo boxes contained within JInvidChooser GUI components to their associated db_field's.
(package private)  boolean isCreating
           
(package private)  boolean isEmbedded
           
(package private)  boolean isPersonaPanel
          If true, this containerPanel is being displayed in a persona pane in a frame panel, and we'll hide the associated user field, which is implicit when we embedded a persona panel in a framePanel showing a user object.
private  boolean keepLoading
          Used to tell the load() method to stop populating a panel if the window we are in is closed.
(package private)  boolean loaded
           
(package private)  boolean loading
           
private  db_object object
          Remote reference to the server-side object we are viewing or editing.
(package private)  java.util.Hashtable objectHash
          Hashtable mapping GUI components to their associated db_field's.
(package private)  javax.swing.JProgressBar progressBar
          If progressBar is not null, the load() method for containerPanel will update this progressBar as the panel is loaded from the server.
(package private)  java.util.Hashtable rowHash
          Hashtable mapping the active GUI components to their labels.
(package private)  java.util.Hashtable shortToComponentHash
          Hashtable mapping Short field id's to the AWT/Swing GUI component managing that database field.
(package private)  java.util.Vector templates
          Vector of FieldTemplate objects holding the constant field type information for fields in this object.
(package private)  short type
          Object type id for this object..
(package private)  java.util.Vector updatesWhileLoading
          Vector of Short field id's used to track fields for which we receive update requests while we are still loading.
(package private)  int vectorElementsAdded
           
(package private)  java.util.Vector vectorPanelList
          Vector used to list vectorPanels embedded in this object window.
(package private)  windowPanel winP
          Reference to the desktop pane containing the client's internal windows.
 
Fields inherited from class javax.swing.JPanel
defaultLayout, uiClassID
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, actionMap, ACTIONMAP_CREATED, alignmentX, alignmentY, ANCESTOR_INPUTMAP_CREATED, ANCESTOR_USING_BUFFER, ancestorInputMap, ancestorNotifier, autoscroller, border, changeSupport, clientProperties, CREATED_DOUBLE_BUFFER, flags, FOCUS_INPUTMAP_CREATED, focusInputMap, HAS_FOCUS, htmlKey, htmlView, inputVerifier, IS_DOUBLE_BUFFERED, IS_OPAQUE, IS_PAINTING_TILE, IS_PRINTING, IS_PRINTING_ALL, KEY_EVENTS_ENABLED, KEYBOARD_BINDINGS_KEY, listenerList, maximumSize, minimumSize, NEXT_FOCUS, paintImmediatelyClip, paintingChild, preferredSize, readObjectCallbacks, REQUEST_FOCUS_DISABLED, tmpRect, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, verifyInputWhenFocusTarget, vetoableChangeSupport, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, WHEN_IN_FOCUSED_WINDOW_BINDINGS, WIF_INPUTMAP_CREATED, windowInputMap
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dbg, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
containerPanel(db_object object, boolean editable, gclient gc, windowPanel window, framePanel frame, javax.swing.JProgressBar progressBar, boolean loadNow, boolean isCreating, java.lang.Object context)
          Primary constructor for containerPanel
containerPanel(db_object object, boolean editable, gclient gc, windowPanel window, framePanel frame, javax.swing.JProgressBar progressBar, boolean loadNow, java.lang.Object context)
          Constructor with default value for isCreating set to false.
containerPanel(db_object object, boolean editable, gclient gc, windowPanel window, framePanel frame, javax.swing.JProgressBar progressBar, java.lang.Object context)
          Constructor with default values for loadNow set to true, and isCreating set to false.
containerPanel(db_object object, boolean editable, gclient gc, windowPanel window, framePanel frame, java.lang.Object context)
          Constructor with default values for progressBar set to false, loadNow set to true, and isCreating set to false.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Some of our components, most notably the checkboxes, don't go through JDataComponent.setValuePerformed(), but instead give us direct feedback.
private  void addBooleanField(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a boolean field in this container panel
private  void addDateField(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a date field in this container panel
private  void addFieldComponent(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          Helper method to add a component during constructor operation.
private  void addFloatField(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a numeric field in this container panel
private  void addInvidField(invid_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a scalar invid field in this container panel
private  void addInvidVector(invid_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate an invid vector in this container panel
private  void addIPField(ip_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate an ip address field in this container panel
private  void addNumericField(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a numeric field in this container panel
private  void addPasswordField(pass_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a password field in this container panel
private  void addPermissionField(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a permission matrix field in this container panel
private  void addRow(java.awt.Component comp, int row, java.lang.String label, boolean visible)
          All the other addXXX methods used to add GUI components of a particular type call this to actually register the GUI component in this containerPanel for display.
private  void addStringField(string_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a scalar string field in this container panel
private  void addStringVector(string_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a string vector in this container panel
private  void addVectorPanel(db_field field, FieldInfo fieldInfo, FieldTemplate fieldTemplate)
          private helper method to instantiate a vector panel in this container panel
private  void addVectorRow(java.awt.Component comp, int row, java.lang.String label, boolean visible)
          This private helper method is used to insert a vectorPanel into the containerPanel
 void cleanUp()
          This method provides a handy way to null out data structures held in relationship to this containerPanel, particularly network reference resources.
private  FieldTemplate findtemplate(short type)
          Helper method to keep the load() method clean.
 gclient getgclient()
          This is a convenience method for other client classes to access our gclient reference.
 db_object getObject()
          Get the object contained in this containerPanel.
 Invid getObjectInvid()
          Get the invid for the object in this containerPanel.
 boolean isLoaded()
          This method returns true if this containerPanel has already been loaded.
 void itemStateChanged(java.awt.event.ItemEvent e)
          Some of our components, most notably the JComboBoxes, don't go through JDataComponent.setValuePerformed(), but instead give us direct feedback.
 boolean keepLoading()
          This method returns false when the containerPanel loading has been interupted.
 void load()
          Downloads all necessary information from the server about the object being viewed or edited.
private  void printErr(java.lang.String s)
           
private  void println(java.lang.String s)
          Use this to print stuff out, so we know it is from the containerPanel
private  void setProgressBar(int count)
          Helper method to keep the load() method clean.
private  void setRowVisible(java.awt.Component comp, boolean b)
          This private method toggles the visibility of a field component and its label in this containerPanel.
private  void setStatus(java.lang.String s)
          Convenience method.
 boolean setValuePerformed(JValueObject v)
          This method comprises the JsetValueCallback interface, and is how the customized data-carrying components in this containerPanel notify us when something changes.
 void stopLoading()
          This method allows the gclient that contains us to set a flag that will interrupt the load() method.
 void update(java.util.Vector fields)
          Updates a subset of the fields in this containerPanel.
 void updateAll()
          Goes through all the components and checks to see if they should be visible, and updates their contents.
private  void updateComponent(java.awt.Component comp)
          Updates the contents and visibility status of a component in this containerPanel.
 void updateInvidStringSelector(StringSelector ss, invid_field field)
          Updates the contents of a vector invid_field value selector against the current contents of the field on the server.
 void updateStringStringSelector(StringSelector ss, string_field field, FieldInfo currentInfo)
          Updates the contents of a vector string_field value selector against the current contents of the field on the server.
 void vectorElementAdded()
          If we contain any vectorPanels, they will call this method during loading to let us update our progress bar if we have it still up.
 
Methods inherited from class javax.swing.JPanel
, getAccessibleContext, getUIClassID, paramString, updateUI, writeObject
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, adjustPaintFlags, alwaysOnTop, checkIfChildObscuredBySibling, clearFocusOwners, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperties, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getFlag, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paintWithBuffer, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, readObject, rectangleIsObscured, rectangleIsObscuredBySibling, registerKeyboardAction, registerKeyboardAction, registerWithKeyboardManager, registerWithKeyboardManager, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFlag, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, unregisterWithKeyboardManager, unregisterWithKeyboardManager, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, adjustListeningChildren, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventImpl, dispatchEventToSelf, doLayout, eventEnabled, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getLayout, getMouseEventTarget, getWindow, initIDs, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, nextFocus, numListening, paintComponents, paintHeavyweightComponents, postProcessKeyEvent, postsOldMouseEvents, preferredSize, preProcessKeyEvent, printComponents, printHeavyweightComponents, processContainerEvent, processEvent, proxyEnableEvents, proxyRequestFocus, remove, remove, removeAll, removeContainerListener, setFocusOwner, setLayout, transferFocus, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, constructComponentName, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getToolkit, getToolkitImpl, getTreeLock, getWindowForObject, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isEnabledImpl, isLightweight, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resetGC, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

debug

boolean debug

debug_persona

static final boolean debug_persona

FIELDWIDTH

static final int FIELDWIDTH

keepLoading

private boolean keepLoading
Used to tell the load() method to stop populating a panel if the window we are in is closed.

gc

gclient gc
Reference to the client's main class, used for some utility functions.

object

private db_object object
Remote reference to the server-side object we are viewing or editing.

invid

private Invid invid
Database id for the object we are viewing or editing

winP

windowPanel winP
Reference to the desktop pane containing the client's internal windows. Used to access some GUI resources.

frame

protected framePanel frame
The window we are contained in, may be null if we are embedded in a vectorPanel.

updatesWhileLoading

java.util.Vector updatesWhileLoading

Vector of Short field id's used to track fields for which we receive update requests while we are still loading. After we finish loading this panel, we'll go back and refresh any fields whose field id's are listed in this vector.


vectorPanelList

java.util.Vector vectorPanelList

Vector used to list vectorPanels embedded in this object window. This variable is used by vectorPanel.expandAllLevels() to do recursive expansion of embedded objects.


currentlyChangingComponent

javax.swing.JComponent currentlyChangingComponent

To help avoid recursive problems, we keep track of any arlut.csd.JDataComponent GUI components that are currently having their change notification messages handled, and refuse to try to refresh them reentrantly.


shortToComponentHash

java.util.Hashtable shortToComponentHash

Hashtable mapping Short field id's to the AWT/Swing GUI component managing that database field.


rowHash

java.util.Hashtable rowHash

Hashtable mapping the active GUI components to their labels. This is used so that when the containerPanel update() method decides to hide a field, the associated label can be hid too.


objectHash

java.util.Hashtable objectHash

Hashtable mapping GUI components to their associated db_field's.


invidChooserHash

java.util.Hashtable invidChooserHash

Hashtable mapping the combo boxes contained within JInvidChooser GUI components to their associated db_field's.

This is required because while we want to hide or reveal the JInvidChooser as a whole, we'll get itemStateChanged() calls from the combo box within the JInvidChooser.


infoVector

java.util.Vector infoVector

Vector of FieldInfo objects holding the values for fields in this object. Used during loading and update.


templates

java.util.Vector templates

Vector of FieldTemplate objects holding the constant field type information for fields in this object.


isCreating

boolean isCreating

editable

boolean editable

isEmbedded

boolean isEmbedded

loading

boolean loading

loaded

boolean loaded

progressBar

javax.swing.JProgressBar progressBar
If progressBar is not null, the load() method for containerPanel will update this progressBar as the panel is loaded from the server.

vectorElementsAdded

int vectorElementsAdded

type

short type
Object type id for this object.. should be equal to invid.getType().

isPersonaPanel

boolean isPersonaPanel

If true, this containerPanel is being displayed in a persona pane in a frame panel, and we'll hide the associated user field, which is implicit when we embedded a persona panel in a framePanel showing a user object.

This is a dirty hack to make the client a little extra smart about one particular kind of mandatory Ganymede server object.


gbl

java.awt.GridBagLayout gbl

gbc

java.awt.GridBagConstraints gbc
Constructor Detail

containerPanel

public containerPanel(db_object object,
                      boolean editable,
                      gclient gc,
                      windowPanel window,
                      framePanel frame,
                      java.lang.Object context)

Constructor with default values for progressBar set to false, loadNow set to true, and isCreating set to false.

Parameters:
object - The object to be displayed
editable - If true, the fields presented will be enabled for editing
parent - Parent gclient of this container
window - windowPanel containing this containerPanel
frame - framePanel holding this containerPanel(although this cp is not necessarily in the "General" tab)
context - An object that can be provided to identify the context in which this containerPanel is being created.

containerPanel

public containerPanel(db_object object,
                      boolean editable,
                      gclient gc,
                      windowPanel window,
                      framePanel frame,
                      javax.swing.JProgressBar progressBar,
                      java.lang.Object context)

Constructor with default values for loadNow set to true, and isCreating set to false.

The <progressBar> parameter is used so that containerpanel can increment an external JProgressBar as information on the fields for this object are loaded from the server. progressBar should be null if this containerPanel is not serving as the main panel for a framePanel.

Parameters:
object - The object to be displayed
editable - If true, the fields presented will be enabled for editing
parent - Parent gclient of this container
window - windowPanel containing this containerPanel
frame - framePanel holding this containerPanel
progressBar - JProgressBar to be updated, can be null
context - An object that can be provided to identify the context in which this containerPanel is being created.

containerPanel

public containerPanel(db_object object,
                      boolean editable,
                      gclient gc,
                      windowPanel window,
                      framePanel frame,
                      javax.swing.JProgressBar progressBar,
                      boolean loadNow,
                      java.lang.Object context)

Constructor with default value for isCreating set to false.

The <progressBar> parameter is used so that containerpanel can increment an external JProgressBar as information on the fields for this object are loaded from the server.

Parameters:
object - The object to be displayed
editable - If true, the fields presented will be enabled for editing
parent - Parent gclient of this container
window - windowPanel containing this containerPanel
progressBar - JProgressBar to be updated, can be null
loadNow - If true, container panel will be loaded immediately
context - An object that can be provided to identify the context in which this containerPanel is being created.

containerPanel

public containerPanel(db_object object,
                      boolean editable,
                      gclient gc,
                      windowPanel window,
                      framePanel frame,
                      javax.swing.JProgressBar progressBar,
                      boolean loadNow,
                      boolean isCreating,
                      java.lang.Object context)

Primary constructor for containerPanel

The <progressBar> parameter is used so that containerpanel can increment an external JProgressBar as information on the fields for this object are loaded from the server. progressBar should be null if this containerPanel is not serving as the main panel for a framePanel.

Parameters:
object - The object to be displayed
editable - If true, the fields presented will be enabled for editing
parent - Parent gclient of this container
window - windowPanel containing this containerPanel
progressBar - JProgressBar to be updated, can be null
loadNow - If true, container panel will be loaded immediately
isCreating -  
context - An object that can be provided to identify the context in which this containerPanel is being created.
Method Detail

load

public void load()
Downloads all necessary information from the server about the object being viewed or edited. Typically this is called when the containerPanel is initialized by the containerPanel constructor, but we defer loading when we are placed in a vector panel hierarchy.

setProgressBar

private final void setProgressBar(int count)
Helper method to keep the load() method clean.

findtemplate

private final FieldTemplate findtemplate(short type)
Helper method to keep the load() method clean.

getgclient

public final gclient getgclient()
This is a convenience method for other client classes to access our gclient reference.

println

private final void println(java.lang.String s)
Use this to print stuff out, so we know it is from the containerPanel

printErr

private final void printErr(java.lang.String s)

getObject

public db_object getObject()
Get the object contained in this containerPanel.

getObjectInvid

public Invid getObjectInvid()
Get the invid for the object in this containerPanel.

isLoaded

public boolean isLoaded()
This method returns true if this containerPanel has already been loaded.

stopLoading

public void stopLoading()

This method allows the gclient that contains us to set a flag that will interrupt the load() method.

Note that this method must not be synchronized.


keepLoading

public boolean keepLoading()
This method returns false when the containerPanel loading has been interupted. The vectorPanel checks this.

updateAll

public void updateAll()

Goes through all the components and checks to see if they should be visible, and updates their contents.

If this containerPanel is attached to an object that is not being edited, this method will return without doing anything.


update

public void update(java.util.Vector fields)

Updates a subset of the fields in this containerPanel.

Parameters:
fields - Vector of Shorts, field ID's

updateComponent

private void updateComponent(java.awt.Component comp)

Updates the contents and visibility status of a component in this containerPanel.

Parameters:
comp - An AWT/Swing component that we need to refresh

updateStringStringSelector

public void updateStringStringSelector(StringSelector ss,
                                       string_field field,
                                       FieldInfo currentInfo)
                                throws java.rmi.RemoteException

Updates the contents of a vector string_field value selector against the current contents of the field on the server.

Parameters:
ss - The StringSelector GUI component being updated
field - The server-side string_field attached to the StringSelector to be updated
currentInfo - A download of the string_field's current value

updateInvidStringSelector

public void updateInvidStringSelector(StringSelector ss,
                                      invid_field field)
                               throws java.rmi.RemoteException

Updates the contents of a vector invid_field value selector against the current contents of the field on the server.

Parameters:
ss - The StringSelector GUI component being updated
field - The server-side invid_field attached to the StringSelector to be updated

setValuePerformed

public boolean setValuePerformed(JValueObject v)

This method comprises the JsetValueCallback interface, and is how the customized data-carrying components in this containerPanel notify us when something changes.

Note that we don't use this method for checkboxes, or comboboxes.

Specified by:
setValuePerformed in interface JsetValueCallback
Returns:
false if the JDataComponent that is calling us should reject the value change operation and revert back to the prior value.
See Also:
JsetValueCallback, JValueObject

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

Some of our components, most notably the checkboxes, don't go through JDataComponent.setValuePerformed(), but instead give us direct feedback. Those we take care of here.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
See Also:
ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)

Some of our components, most notably the JComboBoxes, don't go through JDataComponent.setValuePerformed(), but instead give us direct feedback. Those we take care of here.

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
See Also:
ItemListener

addRow

private void addRow(java.awt.Component comp,
                    int row,
                    java.lang.String label,
                    boolean visible)

All the other addXXX methods used to add GUI components of a particular type call this to actually register the GUI component in this containerPanel for display.


setRowVisible

private void setRowVisible(java.awt.Component comp,
                           boolean b)

This private method toggles the visibility of a field component and its label in this containerPanel.


addFieldComponent

private void addFieldComponent(db_field field,
                               FieldInfo fieldInfo,
                               FieldTemplate fieldTemplate)
                        throws java.rmi.RemoteException

Helper method to add a component during constructor operation. This is the top-level field component adding method.


addStringVector

private void addStringVector(string_field field,
                             FieldInfo fieldInfo,
                             FieldTemplate fieldTemplate)
                      throws java.rmi.RemoteException
private helper method to instantiate a string vector in this container panel

addInvidVector

private void addInvidVector(invid_field field,
                            FieldInfo fieldInfo,
                            FieldTemplate fieldTemplate)
                     throws java.rmi.RemoteException

private helper method to instantiate an invid vector in this container panel


addVectorPanel

private void addVectorPanel(db_field field,
                            FieldInfo fieldInfo,
                            FieldTemplate fieldTemplate)
                     throws java.rmi.RemoteException

private helper method to instantiate a vector panel in this container panel


addVectorRow

private void addVectorRow(java.awt.Component comp,
                          int row,
                          java.lang.String label,
                          boolean visible)

This private helper method is used to insert a vectorPanel into the containerPanel


vectorElementAdded

public void vectorElementAdded()

If we contain any vectorPanels, they will call this method during loading to let us update our progress bar if we have it still up. This is used to let us include the time it will take to get vector panels loaded in the progress bar time estimate.


addStringField

private void addStringField(string_field field,
                            FieldInfo fieldInfo,
                            FieldTemplate fieldTemplate)
                     throws java.rmi.RemoteException

private helper method to instantiate a scalar string field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addPasswordField

private void addPasswordField(pass_field field,
                              FieldInfo fieldInfo,
                              FieldTemplate fieldTemplate)
                       throws java.rmi.RemoteException

private helper method to instantiate a password field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addNumericField

private void addNumericField(db_field field,
                             FieldInfo fieldInfo,
                             FieldTemplate fieldTemplate)
                      throws java.rmi.RemoteException

private helper method to instantiate a numeric field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addFloatField

private void addFloatField(db_field field,
                           FieldInfo fieldInfo,
                           FieldTemplate fieldTemplate)
                    throws java.rmi.RemoteException

private helper method to instantiate a numeric field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addDateField

private void addDateField(db_field field,
                          FieldInfo fieldInfo,
                          FieldTemplate fieldTemplate)
                   throws java.rmi.RemoteException

private helper method to instantiate a date field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addBooleanField

private void addBooleanField(db_field field,
                             FieldInfo fieldInfo,
                             FieldTemplate fieldTemplate)
                      throws java.rmi.RemoteException

private helper method to instantiate a boolean field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addPermissionField

private void addPermissionField(db_field field,
                                FieldInfo fieldInfo,
                                FieldTemplate fieldTemplate)
                         throws java.rmi.RemoteException

private helper method to instantiate a permission matrix field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addInvidField

private void addInvidField(invid_field field,
                           FieldInfo fieldInfo,
                           FieldTemplate fieldTemplate)
                    throws java.rmi.RemoteException

private helper method to instantiate a scalar invid field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

addIPField

private void addIPField(ip_field field,
                        FieldInfo fieldInfo,
                        FieldTemplate fieldTemplate)
                 throws java.rmi.RemoteException

private helper method to instantiate an ip address field in this container panel

Parameters:
field - Remote reference to database field to be associated with a gui component
fieldInfo - Downloaded value and status information for this field
fieldTemplate - Downloaded static field type information for this field

cleanUp

public final void cleanUp()

This method provides a handy way to null out data structures held in relationship to this containerPanel, particularly network reference resources.

It is essential that this method be called from the client's GUI thread.


setStatus

private final void setStatus(java.lang.String s)

Convenience method.