edu.sdsc.inca
Class incat

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTabbedPane
                  extended by edu.sdsc.inca.incat
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.SwingConstants

public class incat
extends javax.swing.JTabbedPane
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.WindowListener

See Also:
Serialized Form

Nested Class Summary
static class incat.IncatAgentClient
           
 
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JDialog aboutDialog
           
protected  edu.sdsc.inca.AgentClient ac
           
protected  IncatEditMenu editMenu
           
protected  IncatHelpBrowser helpBrowser
           
protected  WrapConfig lastCommittedConfig
           
protected  WrapConfig lastSavedConfig
           
protected  java.lang.String path
           
protected  IncatRepositoryTab repositoryTab
           
protected  IncatResourceTab resourceTab
           
protected  IncatSuiteTab suiteTab
           
protected  java.awt.Frame waitDialog
           
protected  java.awt.Label waitMessage
           
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
incat(edu.sdsc.inca.AgentClient ac, java.lang.String path)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          Responds to user GUI actions.
protected  void addOrEditListElement(boolean add)
          An event method: either adds a new element to the selected list or edits the currently-selected element.
protected  void cloneListElement()
          An event method: clones the currently-selected list element.
protected static void createAndShowGUI(edu.sdsc.inca.AgentClient ac, java.lang.String path)
          Create the GUI and show it.
protected  void deleteListElement()
          An event method: deletes the currently-selected list element.
 java.util.Properties[] getCatalog(java.lang.String repositoryUrl)
          Retrieves a repository catalog from the agent.
protected  WrapConfig getConfig()
          Gets the Inca configuration from the display.
 java.util.ArrayList getDescendants(WrapResource resource, boolean includeSelf, boolean leavesOnly)
          Returns an ArrayList of resources included, recursively, in the member pattern of a resource.
 IncatEditMenu getEditMenu()
          Returns the edit menu associcated with this incat GUI.
 WrapReporter[] getReporters()
          Returns an array of all reporters defined in any repository.
 WrapResource getResource(java.lang.String name)
          Returns the resource with a specified name, null if none.
 WrapResource[] getResources(boolean addHosts)
          Returns an array of the resources shown in the resource tab.
static void main(java.lang.String[] args)
           
protected  void readFromAgent(boolean prompt)
          Get configuration from the Agent and store it in lastCommittedConfig.
protected  boolean readFromFile(boolean prompt)
          Get configuration from an XML file and store it in lastSavedConfig.
 void runSeries(WrapSeries s, java.lang.String resource)
          Ask the agent to run a series immediately.
protected  void setConfig(WrapConfig config)
          Sets the display to represent a specified Inca configuration.
 void setEditMenu(IncatEditMenu menu)
          Sets the edit menu associcated with this incat GUI.
 void setHelpSection(java.lang.String section)
          Sets the help dialog to show a specified section.
 void showErrorMessage(java.lang.String message)
          Informs the user of an error.
protected  void showWaitMessage(java.lang.String message)
          Set the message in the incat wait dialog.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Invoked when the user clicks a tab.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
          Transforms window closing into an action event.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
protected  void writeToAgent()
          Sends the current configuration to the connected Agent.
protected  void writeToFile(boolean prompt)
          Writes the current configuration to a file.
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, update
 
Methods inherited from class java.awt.Container
addContainerListener, addImpl, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aboutDialog

protected javax.swing.JDialog aboutDialog

ac

protected edu.sdsc.inca.AgentClient ac

editMenu

protected IncatEditMenu editMenu

helpBrowser

protected IncatHelpBrowser helpBrowser

lastSavedConfig

protected WrapConfig lastSavedConfig

lastCommittedConfig

protected WrapConfig lastCommittedConfig

path

protected java.lang.String path

repositoryTab

protected IncatRepositoryTab repositoryTab

resourceTab

protected IncatResourceTab resourceTab

suiteTab

protected IncatSuiteTab suiteTab

waitDialog

protected java.awt.Frame waitDialog

waitMessage

protected java.awt.Label waitMessage
Constructor Detail

incat

public incat(edu.sdsc.inca.AgentClient ac,
             java.lang.String path)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Responds to user GUI actions.

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

addOrEditListElement

protected void addOrEditListElement(boolean add)
An event method: either adds a new element to the selected list or edits the currently-selected element.

Parameters:
add - whether to add a new element

cloneListElement

protected void cloneListElement()
An event method: clones the currently-selected list element.


deleteListElement

protected void deleteListElement()
An event method: deletes the currently-selected list element.


getCatalog

public java.util.Properties[] getCatalog(java.lang.String repositoryUrl)
Retrieves a repository catalog from the agent.

Parameters:
repositoryUrl - the URL of the repository
Returns:
the repository catalog, null if not connected to an agent

getConfig

protected WrapConfig getConfig()
Gets the Inca configuration from the display.

Returns:
the Inca configuration, as specified on the incat display

getDescendants

public java.util.ArrayList getDescendants(WrapResource resource,
                                          boolean includeSelf,
                                          boolean leavesOnly)
Returns an ArrayList of resources included, recursively, in the member pattern of a resource.

Parameters:
resource - the resource to search
includeSelf - include the resource itself as a descendant?
leavesOnly - whether to return all descendants, or only those that refer to hosts
Returns:
an ArrayList of descendants of the specified resource

getEditMenu

public IncatEditMenu getEditMenu()
Returns the edit menu associcated with this incat GUI.

Returns:
the GUI edit menu

getReporters

public WrapReporter[] getReporters()
Returns an array of all reporters defined in any repository.

Returns:
an array of all reporters

getResource

public WrapResource getResource(java.lang.String name)
Returns the resource with a specified name, null if none.

Parameters:
name - the resource name
Returns:
the resource with the specified name, null if none

getResources

public WrapResource[] getResources(boolean addHosts)
Returns an array of the resources shown in the resource tab.

Parameters:
addHosts - whether to include in the returned value resources for the member hosts of the resources shown
Returns:
an array of all resources

readFromAgent

protected void readFromAgent(boolean prompt)
Get configuration from the Agent and store it in lastCommittedConfig.

Parameters:
prompt - indicates whether to prompt the user for an agent spec

readFromFile

protected boolean readFromFile(boolean prompt)
Get configuration from an XML file and store it in lastSavedConfig.

Parameters:
prompt - indicates whether to prompt the user for a file path
Returns:
true if file loaded into lastSavedConfig, else false

runSeries

public void runSeries(WrapSeries s,
                      java.lang.String resource)
Ask the agent to run a series immediately.

Parameters:
s - the series to run
resource - the name of the resource to run the series on

setConfig

protected void setConfig(WrapConfig config)
Sets the display to represent a specified Inca configuration.

Parameters:
config - the Inca configuration

setEditMenu

public void setEditMenu(IncatEditMenu menu)
Sets the edit menu associcated with this incat GUI.

Parameters:
menu - the GUI edit menu

setHelpSection

public void setHelpSection(java.lang.String section)
Sets the help dialog to show a specified section.

Parameters:
section - the help section to show

showErrorMessage

public void showErrorMessage(java.lang.String message)
Informs the user of an error.

Parameters:
message - the error message

showWaitMessage

protected void showWaitMessage(java.lang.String message)
Set the message in the incat wait dialog. Closes the dialog if the message is null.

Parameters:
message - the message to display, null for none

writeToAgent

protected void writeToAgent()
Sends the current configuration to the connected Agent.


writeToFile

protected void writeToFile(boolean prompt)
Writes the current configuration to a file.

Parameters:
prompt - indicates whether to prompt the user for a file path

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Invoked when the user clicks a tab.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Transforms window closing into an action event.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

createAndShowGUI

protected static void createAndShowGUI(edu.sdsc.inca.AgentClient ac,
                                       java.lang.String path)
Create the GUI and show it. For thread safety, this method should be invoked from the event-dispatching thread.

Parameters:
ac - client for Inca agent we should communicate with
path - path to config file we should read/write

main

public static void main(java.lang.String[] args)