org.peace_tools.views
Class JobListView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.peace_tools.views.JobListView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class JobListView
extends javax.swing.JPanel

This class provides a tabular view of the list of jobs that are currently configured in this work space. This table uses the JobListTableModel class that provides the Job data from the work space in a form that is easily displayed in a table.

See Also:
Serialized Form

Nested Class Summary
private  class JobListView.JobNameStatusRenderer
          A simple renderer that uses a JLabel to render JobName and icon indicating job status.
private  class JobListView.JobStatusRenderer
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  JobListView.JobNameStatusRenderer JobNameRenderer
          An instance of the cell renderer that is used to render the first column in the table with a suitable status icon.
private static javax.swing.Icon[] JobStatusIcons
          The list of icons that are used by job name status table cell renderer to provide visual cues about the current status of a job.
private  javax.swing.JTable jobTable
          The actual JTable that provides a graphical view of the list of jobs currently configured on this workspace.
private  MainFrame mainFrame
          The main frame that logically owns this job list view.
private  JobListTableModel model
          The model that we are using to render the information in the tabular view of jobs.
private  javax.swing.JPopupMenu popupMenu
          The pop up menu that is displayed when the user left-clicks on an item in the job list view.
private static long serialVersionUID
          A generated serial version ID for serialization (more realistically to keep the compiler happy).
private  JobListView.JobStatusRenderer StatusRenderer
          An instance of the cell renderer that is used to render the second column in the table to display status or progress information.
private  javax.swing.JToolBar toolbar
          The toolbar that contains some commonly used tools with the jobs.
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JobListView(MainFrame mainFrame)
          The default constructor.
 
Method Summary
private  void addMouseAdapter(javax.swing.JComponent list)
          A refactored helper method to add a mouse adapter.
private  void createPopupMenu()
          This is a helper method to create the pop-up menu.
private  void handleDoubleClick(java.awt.event.MouseEvent me)
          Helper method to handle double click of the mouse on a list item.
 void handlePopup(java.awt.event.MouseEvent me)
          Helper method to left mouse click on a table item.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, 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, isOptimizedDrawingEnabled, isPaintingForPrint, 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
add, add, add, add, add, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JobStatusIcons

private static final javax.swing.Icon[] JobStatusIcons
The list of icons that are used by job name status table cell renderer to provide visual cues about the current status of a job. The entries are listed in the same order as they are enumerated in the JobBase.JobListType enumeration. The order is important to ensure that the icons match up with the status information correctly.


model

private final JobListTableModel model
The model that we are using to render the information in the tabular view of jobs.


toolbar

private javax.swing.JToolBar toolbar
The toolbar that contains some commonly used tools with the jobs.


jobTable

private javax.swing.JTable jobTable
The actual JTable that provides a graphical view of the list of jobs currently configured on this workspace.


popupMenu

private javax.swing.JPopupMenu popupMenu
The pop up menu that is displayed when the user left-clicks on an item in the job list view.


JobNameRenderer

private final JobListView.JobNameStatusRenderer JobNameRenderer
An instance of the cell renderer that is used to render the first column in the table with a suitable status icon.


StatusRenderer

private final JobListView.JobStatusRenderer StatusRenderer
An instance of the cell renderer that is used to render the second column in the table to display status or progress information.


mainFrame

private final MainFrame mainFrame
The main frame that logically owns this job list view. The main frame is primarily used as the job listener which receives notifications on job completion.


serialVersionUID

private static final long serialVersionUID
A generated serial version ID for serialization (more realistically to keep the compiler happy).

See Also:
Constant Field Values
Constructor Detail

JobListView

public JobListView(MainFrame mainFrame)
The default constructor. The default constructor sets up the job list table and configures the table to the default configuration.

Parameters:
mainFrame - The main frame that logically owns this job list view. The main frame is primarily used as the job listener which receives notifications on job completion.
Method Detail

createPopupMenu

private void createPopupMenu()
This is a helper method to create the pop-up menu. This is a helper method that was introduced to streamline the code in the constructor. This method creates a popup menu that provides options for monitoring and controlling jobs and outputs.


addMouseAdapter

private void addMouseAdapter(javax.swing.JComponent list)
A refactored helper method to add a mouse adapter. This method adds a mouse adapter to intercept certain mouse events occurring on the data set tree to trigger various operations. The mouse adapter simply delegates the actual operations to other methods in this class.

Parameters:
list - The list object to which the mouse adapter is to be added.

handlePopup

public void handlePopup(java.awt.event.MouseEvent me)
Helper method to left mouse click on a table item. This method is invoked whenever the user clicks on the left mouse button on a item in the job table. This method checks to see if the entry is valid and if so, pops up a menu with valid operations for the selected job entry.

Parameters:
me - The mouse event associated with the mouse click.

handleDoubleClick

private void handleDoubleClick(java.awt.event.MouseEvent me)
Helper method to handle double click of the mouse on a list item. This method is invoked whenever the user double clicks on a row in the job list. This method checks to see if the entry is valid and if so, opens a tab with information about the job running on the server.

Parameters:
me - The mouse event associated with the double click.