arlut.csd.ganymede
Class GASHSchema

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--arlut.csd.ganymede.GASHSchema
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, treeCallback, treeDragDropCallback, javax.swing.WindowConstants

public class GASHSchema
extends javax.swing.JFrame
implements treeCallback, treeDragDropCallback, java.awt.event.ActionListener

GUI Schema Editor, part of the Ganymede admin console.

GASHSchema talks to the server by way of the SchemaEdit remote interface.

See Also:
Serialized Form

Field Summary
(package private)  javax.swing.JPanel attribCardPane
           
(package private)  javax.swing.JPanel attribPane
           
(package private)  javax.swing.JScrollPane baseEditPane
           
(package private)  arlut.csd.JTree.treeMenu baseMenu
           
(package private)  arlut.csd.ganymede.BaseEditor be
           
(package private)  java.awt.Color bgColor
           
(package private)  javax.swing.JPanel buttonPane
           
(package private)  javax.swing.JButton cancelButton
           
(package private)  java.awt.CardLayout card
           
(package private)  javax.swing.JPanel categoryEditPane
           
(package private)  arlut.csd.JTree.treeMenu categoryMenu
           
(package private)  arlut.csd.ganymede.CategoryEditor ce
           
(package private)  javax.swing.JMenuItem createCategoryMI
           
(package private)  javax.swing.JMenuItem createFieldMI
           
(package private)  javax.swing.JMenuItem createInternalObjectMI
           
(package private)  javax.swing.JMenuItem createNameMI
           
(package private)  javax.swing.JMenuItem createObjectMI
           
static boolean debug
           
(package private)  javax.swing.JMenuItem deleteCategoryMI
           
(package private)  javax.swing.JMenuItem deleteFieldMI
           
(package private)  javax.swing.JMenuItem deleteNameMI
           
(package private)  javax.swing.JMenuItem deleteObjectMI
           
(package private)  arlut.csd.ganymede.SchemaEdit editor
           
 javax.swing.border.EmptyBorder emptyBorder10
           
 javax.swing.border.EmptyBorder emptyBorder5
           
(package private)  javax.swing.JPanel emptyPane
           
(package private)  arlut.csd.ganymede.BaseFieldEditor fe
           
(package private)  javax.swing.JScrollPane fieldEditPane
           
(package private)  arlut.csd.JTree.treeMenu fieldMenu
           
 javax.swing.border.LineBorder lineBorder
           
 javax.swing.border.BevelBorder loweredBorder
           
(package private)  javax.swing.JScrollPane namespaceEditPane
           
(package private)  arlut.csd.JTree.treeMenu nameSpaceMenu
           
(package private)  arlut.csd.JTree.treeMenu nameSpaceObjectMenu
           
(package private)  arlut.csd.JTree.treeNode namespaces
           
(package private)  arlut.csd.ganymede.NameSpaceEditor ne
           
(package private)  arlut.csd.JTree.treeNode nodeAfterCategories
           
(package private)  arlut.csd.ganymede.CatTreeNode objects
           
(package private)  javax.swing.JButton okButton
           
(package private)  java.awt.Image questionImage
           
 javax.swing.border.BevelBorder raisedBorder
           
(package private)  arlut.csd.ganymede.Category rootCategory
           
(package private)  javax.swing.JMenuItem schemaMI
           
(package private)  boolean showingBase
           
(package private)  boolean showingField
           
 javax.swing.border.CompoundBorder statusBorder
           
 javax.swing.border.CompoundBorder statusBorderRaised
           
(package private)  arlut.csd.JTree.treeControl tree
           
(package private)  java.awt.Image[] treeImages
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GASHSchema(java.lang.String title, arlut.csd.ganymede.SchemaEdit editor, javax.swing.JMenuItem schemaMI)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
private  void cleanup()
          GC-aiding dissolution method.
 void dragLineRelease(arlut.csd.JTree.treeNode dragNode, arlut.csd.JTree.treeNode aboveNode, arlut.csd.JTree.treeNode belowNode)
          This method is called when a drag and drop operation in the Schema Editor's tree is completed.
 boolean dragLineTween(arlut.csd.JTree.treeNode dragNode, arlut.csd.JTree.treeNode aboveNode, arlut.csd.JTree.treeNode belowNode)
          Method to control whether the drag line may be moved between a pair of given nodes.
(package private)  void editBase(arlut.csd.ganymede.BaseNode node)
           
(package private)  void editCategory(arlut.csd.ganymede.CatTreeNode node)
           
(package private)  void editField(arlut.csd.ganymede.FieldNode node)
           
(package private)  void editNameSpace(arlut.csd.ganymede.SpaceNode node)
           
 arlut.csd.ganymede.SchemaEdit getSchemaEdit()
           
 arlut.csd.ganymede.ReturnVal handleReturnVal(arlut.csd.ganymede.ReturnVal retVal)
          This method takes a ReturnVal object from the server and, if necessary, runs through a wizard interaction sequence, possibly displaying several dialogs before finally returning a final result code.
 void iconDragDrop(arlut.csd.JTree.treeNode dragNode, arlut.csd.JTree.treeNode targetNode)
          This method provides intelligence to the tree, determining what action is to be taken if a node is dropped on another node.
 boolean iconDragOver(arlut.csd.JTree.treeNode dragNode, arlut.csd.JTree.treeNode targetNode)
          This method provides intelligence to the tree, determining which nodes the dragNode may be dropped on.
(package private)  void initializeDisplayTree()
           
(package private)  arlut.csd.JTree.treeNode insertCategoryNode(arlut.csd.ganymede.CategoryNode node, arlut.csd.JTree.treeNode prevNode, arlut.csd.JTree.treeNode parentNode)
          Local helper method to place a new CategoryNode (either a Base or a Category) into the schema editor's display tree.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
          Make sure that we clean up and get rid of our remote references to the server's schema editing objects if our window is closed on us.
(package private)  void recurseDownCategories(arlut.csd.ganymede.CatTreeNode node)
           
(package private)  void refreshFields(arlut.csd.ganymede.BaseNode node, boolean doRefresh)
          This method generates the per-field children of the specified baseNode.
(package private)  void refreshNamespaces()
           
 void setNormalCursor()
           
 void setWaitCursor()
           
 boolean startDrag(arlut.csd.JTree.treeNode dragNode)
          This method determines which nodes may be dragged.
 void treeNodeContracted(arlut.csd.JTree.treeNode node)
          Called when a node is closed.
 void treeNodeDoubleClicked(arlut.csd.JTree.treeNode node)
          Called when an item in the tree is double-clicked.
 void treeNodeExpanded(arlut.csd.JTree.treeNode node)
          Called when a node is expanded, to allow the user of the tree to dynamically load the information at that time.
 void treeNodeMenuPerformed(arlut.csd.JTree.treeNode node, java.awt.event.ActionEvent event)
          Called when a popup menu item is selected on a treeNode
 void treeNodeSelected(arlut.csd.JTree.treeNode node)
          Called when an item in the tree is selected
 void treeNodeUnSelected(arlut.csd.JTree.treeNode node, boolean otherNode)
          Called when an item in the tree is unselected
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

debug

public static final boolean debug
See Also:
Constant Field Values

schemaMI

javax.swing.JMenuItem schemaMI

editor

arlut.csd.ganymede.SchemaEdit editor

questionImage

java.awt.Image questionImage

treeImages

java.awt.Image[] treeImages

tree

arlut.csd.JTree.treeControl tree

rootCategory

arlut.csd.ganymede.Category rootCategory

objects

arlut.csd.ganymede.CatTreeNode objects

nodeAfterCategories

arlut.csd.JTree.treeNode nodeAfterCategories

namespaces

arlut.csd.JTree.treeNode namespaces

createCategoryMI

javax.swing.JMenuItem createCategoryMI

deleteCategoryMI

javax.swing.JMenuItem deleteCategoryMI

createObjectMI

javax.swing.JMenuItem createObjectMI

createInternalObjectMI

javax.swing.JMenuItem createInternalObjectMI

deleteObjectMI

javax.swing.JMenuItem deleteObjectMI

createNameMI

javax.swing.JMenuItem createNameMI

deleteNameMI

javax.swing.JMenuItem deleteNameMI

createFieldMI

javax.swing.JMenuItem createFieldMI

deleteFieldMI

javax.swing.JMenuItem deleteFieldMI

categoryMenu

arlut.csd.JTree.treeMenu categoryMenu

baseMenu

arlut.csd.JTree.treeMenu baseMenu

fieldMenu

arlut.csd.JTree.treeMenu fieldMenu

nameSpaceMenu

arlut.csd.JTree.treeMenu nameSpaceMenu

nameSpaceObjectMenu

arlut.csd.JTree.treeMenu nameSpaceObjectMenu

card

java.awt.CardLayout card

buttonPane

javax.swing.JPanel buttonPane

attribPane

javax.swing.JPanel attribPane

attribCardPane

javax.swing.JPanel attribCardPane

emptyPane

javax.swing.JPanel emptyPane

categoryEditPane

javax.swing.JPanel categoryEditPane

fieldEditPane

javax.swing.JScrollPane fieldEditPane

namespaceEditPane

javax.swing.JScrollPane namespaceEditPane

baseEditPane

javax.swing.JScrollPane baseEditPane

be

arlut.csd.ganymede.BaseEditor be

fe

arlut.csd.ganymede.BaseFieldEditor fe

ne

arlut.csd.ganymede.NameSpaceEditor ne

ce

arlut.csd.ganymede.CategoryEditor ce

showingBase

boolean showingBase

showingField

boolean showingField

okButton

javax.swing.JButton okButton

cancelButton

javax.swing.JButton cancelButton

bgColor

java.awt.Color bgColor

emptyBorder5

public javax.swing.border.EmptyBorder emptyBorder5

emptyBorder10

public javax.swing.border.EmptyBorder emptyBorder10

raisedBorder

public javax.swing.border.BevelBorder raisedBorder

loweredBorder

public javax.swing.border.BevelBorder loweredBorder

lineBorder

public javax.swing.border.LineBorder lineBorder

statusBorder

public javax.swing.border.CompoundBorder statusBorder

statusBorderRaised

public javax.swing.border.CompoundBorder statusBorderRaised
Constructor Detail

GASHSchema

public GASHSchema(java.lang.String title,
                  arlut.csd.ganymede.SchemaEdit editor,
                  javax.swing.JMenuItem schemaMI)
Method Detail

getSchemaEdit

public arlut.csd.ganymede.SchemaEdit getSchemaEdit()

initializeDisplayTree

void initializeDisplayTree()

recurseDownCategories

void recurseDownCategories(arlut.csd.ganymede.CatTreeNode node)
                     throws java.rmi.RemoteException
java.rmi.RemoteException

insertCategoryNode

arlut.csd.JTree.treeNode insertCategoryNode(arlut.csd.ganymede.CategoryNode node,
                                            arlut.csd.JTree.treeNode prevNode,
                                            arlut.csd.JTree.treeNode parentNode)
                                      throws java.rmi.RemoteException
Local helper method to place a new CategoryNode (either a Base or a Category) into the schema editor's display tree.

java.rmi.RemoteException

refreshFields

void refreshFields(arlut.csd.ganymede.BaseNode node,
                   boolean doRefresh)
             throws java.rmi.RemoteException
This method generates the per-field children of the specified baseNode.

java.rmi.RemoteException

refreshNamespaces

void refreshNamespaces()

editBase

void editBase(arlut.csd.ganymede.BaseNode node)

editField

void editField(arlut.csd.ganymede.FieldNode node)

editNameSpace

void editNameSpace(arlut.csd.ganymede.SpaceNode node)

editCategory

void editCategory(arlut.csd.ganymede.CatTreeNode node)

setWaitCursor

public void setWaitCursor()

setNormalCursor

public void setNormalCursor()

treeNodeExpanded

public void treeNodeExpanded(arlut.csd.JTree.treeNode node)
Description copied from interface: treeCallback
Called when a node is expanded, to allow the user of the tree to dynamically load the information at that time.

Specified by:
treeNodeExpanded in interface treeCallback

treeNodeContracted

public void treeNodeContracted(arlut.csd.JTree.treeNode node)
Description copied from interface: treeCallback
Called when a node is closed.

Specified by:
treeNodeContracted in interface treeCallback

treeNodeSelected

public void treeNodeSelected(arlut.csd.JTree.treeNode node)
Description copied from interface: treeCallback
Called when an item in the tree is selected

Specified by:
treeNodeSelected in interface treeCallback
Parameters:
node - The node selected in the tree.
See Also:
treeCanvas

treeNodeUnSelected

public void treeNodeUnSelected(arlut.csd.JTree.treeNode node,
                               boolean otherNode)
Description copied from interface: treeCallback
Called when an item in the tree is unselected

Specified by:
treeNodeUnSelected in interface treeCallback
Parameters:
node - The node selected in the tree.
otherNode - If true, this node is being unselected by the selection of another node.
See Also:
treeCanvas

treeNodeDoubleClicked

public void treeNodeDoubleClicked(arlut.csd.JTree.treeNode node)
Called when an item in the tree is double-clicked.

Specified by:
treeNodeDoubleClicked in interface treeCallback
Parameters:
node - The node selected in the tree.
See Also:
treeCallback

treeNodeMenuPerformed

public void treeNodeMenuPerformed(arlut.csd.JTree.treeNode node,
                                  java.awt.event.ActionEvent event)
Description copied from interface: treeCallback
Called when a popup menu item is selected on a treeNode

Specified by:
treeNodeMenuPerformed in interface treeCallback
Parameters:
node - The node selected in the tree.
See Also:
treeCanvas

actionPerformed

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

processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)

Make sure that we clean up and get rid of our remote references to the server's schema editing objects if our window is closed on us.

Overrides:
processWindowEvent in class javax.swing.JFrame

cleanup

private void cleanup()

GC-aiding dissolution method. Should be called after the schema editor window has been removed from view, on the GUI thread.


startDrag

public boolean startDrag(arlut.csd.JTree.treeNode dragNode)
This method determines which nodes may be dragged.

Specified by:
startDrag in interface treeDragDropCallback
Parameters:
dragNode - The node in the tree that the user is attempting to drag.
See Also:
treeDragDropCallback

iconDragOver

public boolean iconDragOver(arlut.csd.JTree.treeNode dragNode,
                            arlut.csd.JTree.treeNode targetNode)
This method provides intelligence to the tree, determining which nodes the dragNode may be dropped on.

Specified by:
iconDragOver in interface treeDragDropCallback
Parameters:
dragNode - The node in the tree that the user is attempting to drag.
targetNode - The node in the tree that the dragNode is being moved onto.
See Also:
treeDragDropCallback

iconDragDrop

public void iconDragDrop(arlut.csd.JTree.treeNode dragNode,
                         arlut.csd.JTree.treeNode targetNode)
This method provides intelligence to the tree, determining what action is to be taken if a node is dropped on another node.

Specified by:
iconDragDrop in interface treeDragDropCallback
Parameters:
dragNode - The node in the tree that the user is attempting to drag.
targetNode - The node in the tree that the dragNode is being dropped onto.
See Also:
treeDragDropCallback

dragLineTween

public boolean dragLineTween(arlut.csd.JTree.treeNode dragNode,
                             arlut.csd.JTree.treeNode aboveNode,
                             arlut.csd.JTree.treeNode belowNode)
Method to control whether the drag line may be moved between a pair of given nodes.

Specified by:
dragLineTween in interface treeDragDropCallback
Parameters:
dragNode - The node in the tree that the user is attempting to drag.
aboveNode - The node in the tree below which the line is being dragged to.
belowNode - The node in the tree above which the line is being dragged to.
See Also:
treeDragDropCallback

dragLineRelease

public void dragLineRelease(arlut.csd.JTree.treeNode dragNode,
                            arlut.csd.JTree.treeNode aboveNode,
                            arlut.csd.JTree.treeNode belowNode)
This method is called when a drag and drop operation in the Schema Editor's tree is completed.

Specified by:
dragLineRelease in interface treeDragDropCallback
Parameters:
dragNode - The node in the tree that the user is attempting to drag.
aboveNode - The node in the tree below which the line is being released.
belowNode - The node in the tree above which the line is being released.
See Also:
treeDragDropCallback

handleReturnVal

public arlut.csd.ganymede.ReturnVal handleReturnVal(arlut.csd.ganymede.ReturnVal retVal)

This method takes a ReturnVal object from the server and, if necessary, runs through a wizard interaction sequence, possibly displaying several dialogs before finally returning a final result code.

Use the ReturnVal returned from this function after this function is called to determine the ultimate success or failure of any operation which returns ReturnVal, because a wizard sequence may determine the ultimate result.

This method should not be synchronized, since handleReturnVal may pop up modal (thread-blocking) dialogs, and if we we synchronize this, some Swing or AWT code seems to block on our synchronization when we do pop-up dialogs. It's not any of my code, so I assume that AWT tries to synchronize on the frame when parenting a new dialog.