arlut.csd.ganymede.client
Class windowPanel

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

public class windowPanel
extends javax.swing.JDesktopPane
implements javax.swing.event.InternalFrameListener, java.awt.event.ActionListener

windowPanel is the top level panel containing and controlling the internal framePanel and gResultTable windows that are displayed in reaction to actions taken by the user. windowPanel is responsible for adding these windows, and maintaining the window list in the menubar.

windowPanel is also responsible for displaying and removing the internal 'guy working' status window that lets the user know the client hasn't frozen up when it is processing a query request.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDesktopPane
javax.swing.JDesktopPane.AccessibleJDesktopPane
 
Inner classes inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
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.border.LineBorder blackLineB
           
(package private)  javax.swing.ImageIcon closeIcon
           
(package private)  javax.swing.ImageIcon closePressedIcon
           
(package private)  boolean debug
           
(package private)  boolean debugProperty
           
(package private)  javax.swing.border.EmptyBorder emptyBorder10
           
(package private)  javax.swing.border.EmptyBorder emptyBorder15
           
(package private)  javax.swing.border.EmptyBorder emptyBorder3
           
(package private)  javax.swing.border.EmptyBorder emptyBorder5
           
(package private)  javax.swing.border.CompoundBorder eWrapperBorder
           
(package private)  javax.swing.border.CompoundBorder eWrapperBorderInvalid
           
(package private)  gclient gc
          Reference to the client's main class, used for some utility functions.
(package private)  javax.swing.border.CompoundBorder lineEmptyBorder
           
(package private)  javax.swing.ImageIcon openIcon
           
(package private)  javax.swing.ImageIcon openPressedIcon
           
(package private)  javax.swing.JMenuItem removeAllMI
           
(package private)  javax.swing.ImageIcon removeImageIcon
           
(package private)  javax.swing.JMenuItem toggleToolBarMI
           
(package private)  int topLayer
          Constant, the front-most layer in which newly created windows are placed.
(package private)  java.awt.Image waitImage
          This is used as the wait image in other classes.
(package private)  java.util.Hashtable waitWindowHash
          Used to keep track of multiple 'guy working' internal wait windows if we have multiple threads waiting for query results from the server.
(package private)  java.util.Hashtable windowList
          Hashtable mapping window titles to JInternalFrames.
(package private)  javax.swing.JMenu windowMenu
           
 
Fields inherited from class javax.swing.JDesktopPane
desktopManager, dragMode, LIVE_DRAG_MODE, OUTLINE_DRAG_MODE, selectedFrame, uiClassID
 
Fields inherited from class javax.swing.JLayeredPane
componentToLayer, DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, optimizedDrawingPossible, PALETTE_LAYER, POPUP_LAYER
 
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
windowPanel(gclient gc, javax.swing.JMenu windowMenu)
          windowPanel constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addTableWindow(Session session, Query query, DumpResult results, java.lang.String title)
          Create and add an internal query result table window.
 void addWaitWindow(java.lang.Runnable key)
          Pops up an internal 'wait..' window, showing an animated icon of a guy working.
 void addWindow(db_object object)
          Create a new view-only window in this windowPanel.
 void addWindow(db_object object, boolean editable)
          Create a new window in this windowPanel.
 void addWindow(db_object object, boolean editable, java.lang.String objectType)
          Create a new editable or view-only window in this windowPanel.
 void addWindow(db_object object, boolean editable, java.lang.String objectType, boolean isNewlyCreated)
          Create a new editable or view-only window in this windowPanel.
 void closeAll(boolean askNoQuestions)
          Closes all internal frames, editable or no.
 void closeEditables()
          Closes all windows that are open for editing.
 void closeWindow(java.lang.String title)
          This method attempts to close an internal window in the client.
 java.util.Vector getEditables()
          Returns a vector of framePanels of all the editable windows.
 gclient getgclient()
          Get the parent gclient
 java.awt.Image getWaitImage()
          Returns an image used as a generic "wait" image.
 java.util.Enumeration getWindows()
          Returns an Enumeration of all the internal windows currently being shown in the client.
 void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameClosed(javax.swing.event.InternalFrameEvent event)
           
 void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
           
 boolean isOpenForEdit(Invid invid)
          Returns true if an edit window is open for this object.
 void placeWindow(javax.swing.JInternalFrame window)
          This method is responsible for setting the bounds for a new window so that windows are staggered somewhat.
 void refreshTableWindows()
           
 void removeWaitWindow(java.lang.Runnable key)
          Pops down the internal 'wait..' window.
 void setSelectedWindow(javax.swing.JInternalFrame window)
           
 void setStatus(java.lang.String s)
          Convenience method, calls gclient.setStatus to set some text in the client's status bar, with a time-to-live of the default 5 seconds.
 void showWindow(java.lang.String title)
           
 javax.swing.JMenu updateMenu()
           
 
Methods inherited from class javax.swing.JDesktopPane
, getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, isOpaque, paramString, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUI, writeObject
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition, validateOptimizedDrawing
 
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, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, 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, 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, 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

debugProperty

final boolean debugProperty

gc

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

topLayer

final int topLayer
Constant, the front-most layer in which newly created windows are placed.

waitWindowHash

java.util.Hashtable waitWindowHash

Used to keep track of multiple 'guy working' internal wait windows if we have multiple threads waiting for query results from the server.

This hashtable maps Runnable objects (objects downloading query results in their own threads) to JInternalFrame's.


windowList

java.util.Hashtable windowList

Hashtable mapping window titles to JInternalFrames. Used to make sure that we have unique titles for all of our internal windows, so that we can properly maintain a Windows menu to let the user select an active window from the menu bar.


waitImage

java.awt.Image waitImage
This is used as the wait image in other classes. Currently, it returns the men at work animated gif. Keep it here so each subsequent pane doesn't have to load it.

windowMenu

javax.swing.JMenu windowMenu

openIcon

javax.swing.ImageIcon openIcon

closeIcon

javax.swing.ImageIcon closeIcon

openPressedIcon

javax.swing.ImageIcon openPressedIcon

closePressedIcon

javax.swing.ImageIcon closePressedIcon

removeImageIcon

javax.swing.ImageIcon removeImageIcon

blackLineB

javax.swing.border.LineBorder blackLineB

emptyBorder3

javax.swing.border.EmptyBorder emptyBorder3

emptyBorder5

javax.swing.border.EmptyBorder emptyBorder5

emptyBorder10

javax.swing.border.EmptyBorder emptyBorder10

emptyBorder15

javax.swing.border.EmptyBorder emptyBorder15

eWrapperBorder

javax.swing.border.CompoundBorder eWrapperBorder

eWrapperBorderInvalid

javax.swing.border.CompoundBorder eWrapperBorderInvalid

lineEmptyBorder

javax.swing.border.CompoundBorder lineEmptyBorder

removeAllMI

javax.swing.JMenuItem removeAllMI

toggleToolBarMI

javax.swing.JMenuItem toggleToolBarMI
Constructor Detail

windowPanel

public windowPanel(gclient gc,
                   javax.swing.JMenu windowMenu)
windowPanel constructor
Method Detail

getgclient

public gclient getgclient()
Get the parent gclient

getWaitImage

public java.awt.Image getWaitImage()
Returns an image used as a generic "wait" image. Currently returns the men-at-work image.

addWindow

public void addWindow(db_object object)
Create a new view-only window in this windowPanel.
Parameters:
object - an individual object from the server to show in this window

addWindow

public void addWindow(db_object object,
                      boolean editable)
Create a new window in this windowPanel.
Parameters:
object - an individual object from the server to show in this window
editable - If true, the new window will be editable

addWindow

public void addWindow(db_object object,
                      boolean editable,
                      java.lang.String objectType)
Create a new editable or view-only window in this windowPanel.
Parameters:
object - an individual object from the server to show in this window
editable - if true, the object will be presented as editable
objectType - Used for the title of the new window

addWindow

public void addWindow(db_object object,
                      boolean editable,
                      java.lang.String objectType,
                      boolean isNewlyCreated)
Create a new editable or view-only window in this windowPanel.
Parameters:
object - an individual object from the server to show in this window
editable - if true, the object will be presented as editable
objectType - Used for the title of the new window
isNewlyCreated - if true, this window will be a 'create object' window.

placeWindow

public void placeWindow(javax.swing.JInternalFrame window)

This method is responsible for setting the bounds for a new window so that windows are staggered somewhat.


setSelectedWindow

public void setSelectedWindow(javax.swing.JInternalFrame window)

isOpenForEdit

public boolean isOpenForEdit(Invid invid)
Returns true if an edit window is open for this object.

setStatus

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

Convenience method, calls gclient.setStatus to set some text in the client's status bar, with a time-to-live of the default 5 seconds.


addTableWindow

public void addTableWindow(Session session,
                           Query query,
                           DumpResult results,
                           java.lang.String title)

Create and add an internal query result table window.

Parameters:
session - Reference to the server, used to refresh the query on command
query - The Query whose results are being shown in this window, used to refresh the query on command.
results - The results of the query that is being shown in this window.
title - The title to be placed on the window when created.

addWaitWindow

public void addWaitWindow(java.lang.Runnable key)

Pops up an internal 'wait..' window, showing an animated icon of a guy working. Used to show the client is still working while a query is being processed.


removeWaitWindow

public void removeWaitWindow(java.lang.Runnable key)

Pops down the internal 'wait..' window.


getWindows

public java.util.Enumeration getWindows()

Returns an Enumeration of all the internal windows currently being shown in the client.


getEditables

public java.util.Vector getEditables()
Returns a vector of framePanels of all the editable windows.

closeEditables

public void closeEditables()

Closes all windows that are open for editing.

This should be called by the parent when the transaction is canceled, to get rid of windows that might confuse the user.


closeAll

public void closeAll(boolean askNoQuestions)

Closes all internal frames, editable or no.

Parameters:
askNoQuestions - if true, closeAll() will inhibit the normal dialogs brought up when create/editable windows are closed.

closeWindow

public void closeWindow(java.lang.String title)
This method attempts to close an internal window in the client. This method will not close windows (as for newly created objects) that are not set to be closeable.

updateMenu

public javax.swing.JMenu updateMenu()

showWindow

public void showWindow(java.lang.String title)

refreshTableWindows

public void refreshTableWindows()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent event)
Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener