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.
javax.swing.JDesktopPane.AccessibleJDesktopPanejavax.swing.JLayeredPane.AccessibleJLayeredPanejavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
(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) javax.swing.border.EmptyBorder |
emptyBorder10 |
(package private) javax.swing.border.EmptyBorder |
emptyBorder10Right |
(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) static int |
maxDefaultHeight
The maximum default height for new internal windows.
|
(package private) static int |
maxDefaultWidth
The maximum default width for new internal windows.
|
(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) static int |
topLayer
Constant, the front-most layer in which newly created windows are
placed.
|
(package private) static TranslationService |
ts
TranslationService object for handling string localization in the
Ganymede client.
|
(package private) java.awt.Image |
waitImage
This is used as the wait image in other classes.
|
(package private) java.util.Hashtable<java.lang.Runnable,javax.swing.JInternalFrame> |
waitWindowHash
Used to keep track of multiple 'guy working' internal wait
windows if we have multiple threads waiting for query results
from the server.
|
private java.util.Hashtable<java.lang.String,javax.swing.JInternalFrame> |
windowList
Hashtable mapping window titles to JInternalFrames.
|
(package private) javax.swing.JMenu |
windowMenu |
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYERaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
windowPanel(gclient gc,
javax.swing.JMenu windowMenu)
windowPanel constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
addTableWindow(Session session,
Query query,
DumpResult results)
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(Invid invid,
db_object object,
boolean editable)
Create a new editable or view-only window in this windowPanel.
|
void |
addWindow(Invid invid,
db_object object,
boolean editable,
boolean isNewlyCreated,
framePanel originalWindow)
Create a new editable or view-only window in this windowPanel.
|
void |
addWindow(Invid invid,
db_object object,
boolean editable,
framePanel originalWindow)
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 |
closeInvidWindows(Invid invid)
Closes all windows that show a view onto the given Invid
This should be called by the parent when the transaction is
canceled, to get rid of windows viewing deleted objects.
|
void |
closeWindow(java.lang.String title)
This method attempts to close an internal window in the
client, as identified by title.
|
java.util.Vector<framePanel> |
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.lang.String |
getWindowTitle(boolean editable,
boolean newlyCreated,
boolean inactivated,
java.lang.String objectType,
java.lang.String object_label)
This method returns a localized string for a framePanel title,
according to the operation being performed on the object and its
type.
|
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 |
isApprovedForClosing(Invid invid)
Returns true if an editable window corresponding to the invid
exists and is ready to close.
|
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 |
refreshObjectWindows(Invid invid,
ReturnVal retVal)
|
void |
refreshTableWindows()
This method causes all query result windows to be refreshed,
with each query window's query re-issued to the Ganymede
server.
|
void |
relabelObject(Invid invid,
java.lang.String newLabel)
This method seeks through all open windows and relabels all
references to the given Invid.
|
void |
removeWaitWindow(java.lang.Runnable key)
Pops down the internal 'wait..' window.
|
void |
setSelectedWindow(javax.swing.JInternalFrame window)
Set focus on and bring to front 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 |
setStatus(java.lang.String s,
int seconds)
Convenience method, calls
gclient.setStatus to set some text in the client's status bar,
with a time-to-live of the specified number of seconds. |
java.lang.String |
setWindowTitle(javax.swing.JInternalFrame frame,
java.lang.String proposedTitle)
This method handles the generation and setting of a unique
window title for a window that we are displaying.
|
void |
showWindow(Invid objInvid)
Causes the editable object window for Invid objInvid to be
selected and brought to the front.
|
void |
showWindow(java.lang.String title)
Causes the window with the given title selected and brought to
the front.
|
void |
sizeWindow(javax.swing.JInternalFrame window)
Sizes an internal window before it gets placed.
|
javax.swing.JMenu |
updateWindowMenu() |
addImpl, getAccessibleContext, getAllFrames, getAllFramesInLayer, getDesktopManager, getDragMode, getSelectedFrame, getUI, getUIClassID, paramString, remove, removeAll, selectFrame, setComponentZOrder, setDesktopManager, setDragMode, setSelectedFrame, setUI, updateUIgetComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, setLayer, setLayer, setPositionaddAncestorListener, 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, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, 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, removeContainerListener, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, transferFocusBackward, transferFocusUpCyclestatic final TranslationService ts
static final int topLayer
static final int maxDefaultWidth
static final int maxDefaultHeight
boolean debug
gclient gc
java.util.Hashtable<java.lang.Runnable,javax.swing.JInternalFrame> 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.
private java.util.Hashtable<java.lang.String,javax.swing.JInternalFrame> 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.
java.awt.Image waitImage
javax.swing.JMenu windowMenu
javax.swing.ImageIcon openIcon
javax.swing.ImageIcon closeIcon
javax.swing.ImageIcon openPressedIcon
javax.swing.ImageIcon closePressedIcon
javax.swing.ImageIcon removeImageIcon
javax.swing.border.LineBorder blackLineB
javax.swing.border.EmptyBorder emptyBorder3
javax.swing.border.EmptyBorder emptyBorder5
javax.swing.border.EmptyBorder emptyBorder10
javax.swing.border.EmptyBorder emptyBorder10Right
javax.swing.border.EmptyBorder emptyBorder15
javax.swing.border.CompoundBorder eWrapperBorder
javax.swing.border.CompoundBorder eWrapperBorderInvalid
javax.swing.border.CompoundBorder lineEmptyBorder
javax.swing.JMenuItem removeAllMI
javax.swing.JMenuItem toggleToolBarMI
public windowPanel(gclient gc, javax.swing.JMenu windowMenu)
public gclient getgclient()
public java.awt.Image getWaitImage()
Returns an image used as a generic "wait" image.
Currently returns the men-at-work image.
public void addWindow(Invid invid, db_object object, boolean editable)
invid - The invid of the object to be viewed or editedobject - an individual object from the server to show
in this windoweditable - if true, the object will be presented as editablepublic void addWindow(Invid invid, db_object object, boolean editable, framePanel originalWindow)
invid - The invid of the object to be viewed or editedobject - an individual object from the server to show
in this windoweditable - if true, the object will be presented as editableoriginalWindow - If not null, a framePanel that we are going to be replacing
with a new window. Used to replace a view window with an edit window, or to refresh
a view window.public void addWindow(Invid invid, db_object object, boolean editable, boolean isNewlyCreated, framePanel originalWindow)
invid - The invid of the object to be viewed or editedobject - an individual object from the server to show
in this windoweditable - if true, the object will be presented as editableisNewlyCreated - if true, this window will be a 'create object' window.originalWindow - If not null, a framePanel that we are going to be replacing
with a new window. Used to replace a view window with an edit window, or to refresh
a view window.public java.lang.String getWindowTitle(boolean editable,
boolean newlyCreated,
boolean inactivated,
java.lang.String objectType,
java.lang.String object_label)
This method returns a localized string for a framePanel title, according to the operation being performed on the object and its type.
It is used in addWindow() to set a window's initial title, and by framePanel to handle relabeling an object whose label field has been altered.
public void sizeWindow(javax.swing.JInternalFrame window)
Sizes an internal window before it gets placed.
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.
public void setSelectedWindow(javax.swing.JInternalFrame window)
Set focus on and bring to front window.
public boolean isOpenForEdit(Invid invid)
Returns true if an edit window is open for this object.
public boolean isApprovedForClosing(Invid invid)
Returns true if an editable window corresponding to the invid exists and is ready to close.
public final void setStatus(java.lang.String s,
int seconds)
Convenience method, calls gclient.setStatus to set some text in the client's status bar,
with a time-to-live of the specified number of seconds.
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.
public void addTableWindow(Session session, Query query, DumpResult results)
Create and add an internal query result table window.
session - Reference to the server, used to refresh the query on commandquery - 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.public void addWaitWindow(java.lang.Runnable key)
public void removeWaitWindow(java.lang.Runnable key)
public java.util.Vector<framePanel> getEditables()
Returns a vector of framePanels of all the editable windows.
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.
public void closeInvidWindows(Invid invid)
Closes all windows that show a view onto the given Invid
This should be called by the parent when the transaction is canceled, to get rid of windows viewing deleted objects.
public void closeAll(boolean askNoQuestions)
Closes all internal frames, editable or no.
askNoQuestions - if true, closeAll() will inhibit the normal
dialogs brought up when create/editable windows are closed.public void closeWindow(java.lang.String title)
This method attempts to close an internal window in the client, as identified by title. This method will not close windows (as for newly created objects) that are not set to be closeable.
public java.lang.String setWindowTitle(javax.swing.JInternalFrame frame,
java.lang.String proposedTitle)
This method handles the generation and setting of a unique window title for a window that we are displaying. The titles for all windows are tracked in windowPanel's windowList, and this method takes care of updating windowList as necessary with the new title.
This method can also be used to change a pre-existing window's title, in which case the old title is removed from the windowList in favor of the new one.
public javax.swing.JMenu updateWindowMenu()
public void showWindow(java.lang.String title)
Causes the window with the given title selected and brought to the front.
public void showWindow(Invid objInvid)
Causes the editable object window for Invid objInvid to be selected and brought to the front.
public void refreshTableWindows()
This method causes all query result windows to be refreshed, with each query window's query re-issued to the Ganymede server.
public void refreshObjectWindows(Invid invid, ReturnVal retVal)
This method takes an Invid
and a ReturnVal that encode
field refresh information, and update any open windows with the
appropriate information.
If invid is set, the only windows which will be refreshed are those that are presenting that object for display or editing. If it is null, all object windows will be refreshed.
The retVal parameter can hold a list of fields that need to be refreshed, or an encoding that forces a refresh of all fields. If the retVal parameter is null, all fields on all windows that match the invid parameter will be refreshed.
If both invid and retVal are null, all fields in all object windows will be refreshed.
public void relabelObject(Invid invid, java.lang.String newLabel)
This method seeks through all open windows and relabels all references to the given Invid.
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void internalFrameClosed(javax.swing.event.InternalFrameEvent event)
internalFrameClosed in interface javax.swing.event.InternalFrameListenerpublic void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
internalFrameDeiconified in interface javax.swing.event.InternalFrameListenerpublic void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
internalFrameClosing in interface javax.swing.event.InternalFrameListenerpublic void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
internalFrameActivated in interface javax.swing.event.InternalFrameListenerpublic void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
internalFrameDeactivated in interface javax.swing.event.InternalFrameListenerpublic void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
internalFrameOpened in interface javax.swing.event.InternalFrameListenerpublic void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
internalFrameIconified in interface javax.swing.event.InternalFrameListener