WIDAR Classes

ca.nrc.widar.mccc.crmGui
Class CrmGuiTab

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 edu.nrao.widar.gui.widget.BlankPanel
                      extended by ca.nrc.widar.mccc.crmGui.CrmGuiTab
All Implemented Interfaces:
DataReadyListener, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
CrmGuiTabBlbHst, CrmGuiTabCsd, CrmGuiTabStbHst, CrmGuiTabSystem, CrmGuiTabTest

public class CrmGuiTab
extends BlankPanel
implements java.awt.event.ActionListener, DataReadyListener

WIDAR/EVLA - CRM GUI: CrmGuiTab Class

This class extends the BlankPanel, and acts as a super class for defining tabs that appear on the CrmGUI front panel.

Copyright: National Research Council of Canada and Associated Universities Inc., 2010, 2011, 2012

Since:
1.0
Author:
Dave Del Rizzo (Dave.DelRizzo@nrc.gc.ca)
See Also:
Serialized Form
 

Nested Class Summary
 class CrmGuiTab.ColumnHeaderListener
          A custom Column Header Listener class that listens for mouse action on the column header elements of the active process table
 
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
protected  javax.swing.JScrollPane activeScroll
           
protected  javax.swing.JButton analyzeAllButton
           
static java.lang.String CLASSNAME
           
protected  javax.swing.JButton clearAllButton
           
protected  javax.swing.JButton clearGoodButton
           
protected  BlankPanel controlPanel
           
protected  javax.xml.bind.Marshaller crmM
           
protected  ca.nrc.widar.jaxb.crm.ObjectFactory crmOF
           
protected  javax.xml.bind.Unmarshaller crmU
           
protected  boolean enabled
           
protected  javax.swing.JButton executeButton
           
protected  javax.swing.JButton haltActiveButton
           
protected  javax.swing.JButton haltAllButton
           
protected  BlankPanel indicatorPanel
           
protected  int indWidth
           
protected  javax.swing.table.JTableHeader processHeader
           
protected  CrmGuiDiagTableModel processModel
           
protected  CrmGuiTable processTable
           
protected  int tabType
           
protected  java.lang.String title
           
 
Fields inherited from class edu.nrao.widar.gui.widget.BlankPanel
bigLabelFont, defaultFont, fieldFont, LABEL_POS_BOTTOM, LABEL_POS_LEFT, LABEL_POS_RIGHT, LABEL_POS_TOP
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
CrmGuiTab(java.lang.String value, int width, int height)
          Constructor for the CrmGuiTab class
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          Receives an ActionEvent, determines the source and performs instructions accordingly.
 void addActionListener(java.awt.event.ActionListener listener)
          Adds a listener to the action listener list within this class.
 void addDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagXml)
          Calls a CrmGuiDiagTableModel method which adds a Diagnostic XML object to the current tab active processes table
 void dataIsReady(DataReadyEvent event)
          The DataReadyEvent handler for this tab
protected  void fireActionEvent(java.awt.event.ActionEvent event)
          Generates an action event for each class listed in the listener list, and calls the actionPerformed method in that class.
protected  void fireActionEvent(java.lang.String text)
          Generates an action event for each class listed in the listener list, and calls the actionPerformed method in that class.
 double getCcErrorThreshold()
           
 java.lang.String getConfigPath()
           
 java.util.ArrayList<ca.nrc.widar.jaxb.crm.CrmFile> getCrmFileList()
           
 java.lang.String getDataProcPath()
           
 java.lang.String getDestIp()
           
 java.lang.String getDestMac()
           
protected  java.util.Vector<ca.nrc.widar.jaxb.crm.Diagnostic> getDiagnosticXml()
          Abstract method.
 java.lang.String getFrameTitle(ca.nrc.widar.jaxb.crm.Diagnostic dXml)
           
 int getLagCollectionDuration()
           
 int getRxpSyncTimeout()
           
 java.lang.Object getSettings()
           
 int getStationId()
           
 int getSyncCheck()
           
 java.lang.String getTitle()
          Returns the current tab title
protected  void handleModelAction(ca.nrc.widar.jaxb.crm.Diagnostic diagXml, ca.nrc.widar.jaxb.crm.DiagStateType state)
          This method is called from the CrmGuiDiagTableModel upon registering an event in the CrmGuiDiagTableModel that is within the tab.
 void initIndicator()
          Method to initialize the indicator panel.
 boolean isEnabled()
          Returns the enabled status of the execute button to the caller
 boolean isSetDestIpDefault()
           
 boolean isSetDestMacDefault()
           
 boolean isSystemWide()
           
 void loadSettings(java.lang.Object xml)
           
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes a listener from the action listener list within this class.
 void removeAllDiagnostics()
           
 void removeAllDiagnosticsOnClose()
          Calls a CrmGuiDiagTableModel method which is run just prior to the CrmGui exiting.
 void removeDiagnostic(java.lang.String id)
          Calls a CrmGuiDiagTableModel method which removes a Diagnostic XML object from the current tab active processes table
 void setBlankingDuration(int value)
           
 void setCcErrorThreshold(double value)
           
 void setConfigPath(java.lang.String value)
           
 void setCrmFileList(java.util.List<ca.nrc.widar.jaxb.crm.CrmFile> value)
           
 void setDataProcPath(java.lang.String value)
           
 void setDestIp(java.lang.String value)
           
 void setDestMac(java.lang.String value)
           
 void setEnabled(boolean state)
          Affects the enabled button on the tab, setting its enabled state to the provided boolean value
 void setLagCollectionDuration(int value)
           
 void setRxpSyncTimeout(int value)
           
 void setStationId(int value)
           
 void setSyncCheck(int value)
           
 void setSystemWide(boolean value)
           
 void updateBlbHstConfigFileList(java.util.ArrayList<ca.nrc.widar.jaxb.crm.CrmFile> list)
           
 void updateControl()
          Method used to update the LED values for common LED objects within the CrmGuiTab
 void updateDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagXml)
          Calls a CrmGuiDiagTableModel method which replaces the existing Diagnostic XML stored within the tab with the provided Diagnostic XML
 void updateDiagnosticStatus(ca.nrc.widar.jaxb.crm.DiagStatus dsXml)
          Calls a CrmGuiDiagTableModel method which replaces the DiagStatus child of the Diagnostic XML within the tab with the supplied DiagStatus XML object.
 void updateSelector()
           
 void updateTotalDuration()
           
 
Methods inherited from class edu.nrao.widar.gui.widget.BlankPanel
add, add, add, add, add, add, add, add, add, add, add, add, add, add, addButton, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addLabel, addPanel, drawGrid, drawGrid, fixMarginsAndGetDimension, getComponent, getField, getFieldText, getValue, setAndAlarm, setField
 
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, 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, 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, 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

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values

enabled

protected boolean enabled

indWidth

protected int indWidth

tabType

protected int tabType

title

protected java.lang.String title

indicatorPanel

protected BlankPanel indicatorPanel

controlPanel

protected BlankPanel controlPanel

executeButton

protected javax.swing.JButton executeButton

clearGoodButton

protected javax.swing.JButton clearGoodButton

clearAllButton

protected javax.swing.JButton clearAllButton

haltActiveButton

protected javax.swing.JButton haltActiveButton

haltAllButton

protected javax.swing.JButton haltAllButton

analyzeAllButton

protected javax.swing.JButton analyzeAllButton

processModel

protected CrmGuiDiagTableModel processModel

processTable

protected CrmGuiTable processTable

processHeader

protected javax.swing.table.JTableHeader processHeader

activeScroll

protected javax.swing.JScrollPane activeScroll

crmOF

protected ca.nrc.widar.jaxb.crm.ObjectFactory crmOF

crmM

protected javax.xml.bind.Marshaller crmM

crmU

protected javax.xml.bind.Unmarshaller crmU
Constructor Detail

CrmGuiTab

public CrmGuiTab(java.lang.String value,
                 int width,
                 int height)
Constructor for the CrmGuiTab class

Parameters:
value - The String value for the tab title
width - The width in pixels for the tab panel
height - The height in pixels for the tab panel
Method Detail

initIndicator

public void initIndicator()
Method to initialize the indicator panel. This is called from the sub-class and is used to insert elements into the panel that are common to all tabs.


getDiagnosticXml

protected java.util.Vector<ca.nrc.widar.jaxb.crm.Diagnostic> getDiagnosticXml()
Abstract method. This instance returns null (method must be overridden)


getSettings

public java.lang.Object getSettings()

loadSettings

public void loadSettings(java.lang.Object xml)

updateTotalDuration

public void updateTotalDuration()

isSetDestIpDefault

public boolean isSetDestIpDefault()

getDestIp

public java.lang.String getDestIp()

setDestIp

public void setDestIp(java.lang.String value)

isSetDestMacDefault

public boolean isSetDestMacDefault()

getDestMac

public java.lang.String getDestMac()

setDestMac

public void setDestMac(java.lang.String value)

getConfigPath

public java.lang.String getConfigPath()

setConfigPath

public void setConfigPath(java.lang.String value)

getDataProcPath

public java.lang.String getDataProcPath()

setDataProcPath

public void setDataProcPath(java.lang.String value)

getCrmFileList

public java.util.ArrayList<ca.nrc.widar.jaxb.crm.CrmFile> getCrmFileList()

setCrmFileList

public void setCrmFileList(java.util.List<ca.nrc.widar.jaxb.crm.CrmFile> value)

getLagCollectionDuration

public int getLagCollectionDuration()

setLagCollectionDuration

public void setLagCollectionDuration(int value)

getCcErrorThreshold

public double getCcErrorThreshold()

setCcErrorThreshold

public void setCcErrorThreshold(double value)

setBlankingDuration

public void setBlankingDuration(int value)

getRxpSyncTimeout

public int getRxpSyncTimeout()

setRxpSyncTimeout

public void setRxpSyncTimeout(int value)

getSyncCheck

public int getSyncCheck()

setSyncCheck

public void setSyncCheck(int value)

getStationId

public int getStationId()

setStationId

public void setStationId(int value)

isSystemWide

public boolean isSystemWide()

setSystemWide

public void setSystemWide(boolean value)

updateControl

public void updateControl()
Method used to update the LED values for common LED objects within the CrmGuiTab


updateSelector

public void updateSelector()

updateBlbHstConfigFileList

public void updateBlbHstConfigFileList(java.util.ArrayList<ca.nrc.widar.jaxb.crm.CrmFile> list)

getTitle

public java.lang.String getTitle()
Returns the current tab title

Returns:
A String with the current tab title

getFrameTitle

public java.lang.String getFrameTitle(ca.nrc.widar.jaxb.crm.Diagnostic dXml)

setEnabled

public void setEnabled(boolean state)
Affects the enabled button on the tab, setting its enabled state to the provided boolean value

Overrides:
setEnabled in class javax.swing.JComponent
Parameters:
state - The new enabled state of the execute button (true=enabled)

isEnabled

public boolean isEnabled()
Returns the enabled status of the execute button to the caller

Overrides:
isEnabled in class java.awt.Component
Returns:
A boolean indicating the enabled state (true=enabled)

addDiagnostic

public void addDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagXml)
Calls a CrmGuiDiagTableModel method which adds a Diagnostic XML object to the current tab active processes table

Parameters:
diagXml - A Diagnostic XML object representing a new Diagnostic

removeDiagnostic

public void removeDiagnostic(java.lang.String id)
Calls a CrmGuiDiagTableModel method which removes a Diagnostic XML object from the current tab active processes table

Parameters:
id - The unique String ID of the Diagnostic to be removed from this tab

removeAllDiagnostics

public void removeAllDiagnostics()

removeAllDiagnosticsOnClose

public void removeAllDiagnosticsOnClose()
Calls a CrmGuiDiagTableModel method which is run just prior to the CrmGui exiting. The intent is to remove all currently 'finished' diagnostics from the tab prior to the application exiting.


updateDiagnostic

public void updateDiagnostic(ca.nrc.widar.jaxb.crm.Diagnostic diagXml)
Calls a CrmGuiDiagTableModel method which replaces the existing Diagnostic XML stored within the tab with the provided Diagnostic XML

Parameters:
diagXml - A Diagnostic XMl object

updateDiagnosticStatus

public void updateDiagnosticStatus(ca.nrc.widar.jaxb.crm.DiagStatus dsXml)
Calls a CrmGuiDiagTableModel method which replaces the DiagStatus child of the Diagnostic XML within the tab with the supplied DiagStatus XML object. This occurs when an update to the status of a diagnostic is received from the CRM.

Parameters:
dsXml - A DiagStatus XML object

handleModelAction

protected void handleModelAction(ca.nrc.widar.jaxb.crm.Diagnostic diagXml,
                                 ca.nrc.widar.jaxb.crm.DiagStateType state)
This method is called from the CrmGuiDiagTableModel upon registering an event in the CrmGuiDiagTableModel that is within the tab. The action is initiated by the user pressing the button in the first 'button' column (the second to last column) of the active processes table. The functionality of the button depends upon the state of the diagnostic.

Parameters:
diagXml - The Diagnostic XML object to which the action is associated
state - The current diagnostic state of the object to which the action is associated

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds a listener to the action listener list within this class.

Parameters:
listener - The class being added to the listener list.

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes a listener from the action listener list within this class.

Parameters:
listener - The class being removed from the listener list.

fireActionEvent

protected void fireActionEvent(java.awt.event.ActionEvent event)
Generates an action event for each class listed in the listener list, and calls the actionPerformed method in that class.

Parameters:
event - The event being fired.

fireActionEvent

protected void fireActionEvent(java.lang.String text)
Generates an action event for each class listed in the listener list, and calls the actionPerformed method in that class.

Parameters:
text - A string containing the content to be added to the event being fired

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Receives an ActionEvent, determines the source and performs instructions accordingly. This is the action event handling method.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
event - The incoming action event.

dataIsReady

public void dataIsReady(DataReadyEvent event)
The DataReadyEvent handler for this tab

Specified by:
dataIsReady in interface DataReadyListener
Parameters:
event - A DataReadyEvent object

NRAO/DRAO

National Radio Astronomy Observatory