com.altair.hwm.beans.utils
Class HWMBasePanel

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 com.altair.hwm.beans.utils.HWMBasePanel
All Implemented Interfaces:
HWMEventListener, IHWMControl, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Externalizable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible
Direct Known Subclasses:
FEPreSelect, HMCreateLine, HMCreatePoint, HMEvalTCL, HMImport, HMMesh, HMReflect, HMScale, HMSelect, HMView, HWMMessageLogPane, HWMSlider, HWMSpinner

public class HWMBasePanel
extends javax.swing.JPanel
implements IHWMControl, HWMEventListener, java.io.Externalizable

Title: HWMBasePanel

Description: A basic panel class that all other panel beans can derive from. Functionality such as enabling/disabling, making UI visible/invisible, foreground/background colors are implemented in this class, and hence need not be reimplemented in the derived panel bean

Company: Altair Engineering, Inc.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static java.lang.String BASE_VERSION
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
HWMBasePanel()
          Constructor
 
Method Summary
 void addHWMCmdEventListener(HWMCmdEventListener hwmCmdEventListener)
          Adds the listener to the vector of listeners
 void Disable()
          Providing "Disable" method rather than overriding java's "disable" method because of the following reasons: 1> disable is deprecated 2> It does nothing visually for some controls like button 3> setEnabled calls enable/disable in the base class once it changes the UI.
 void Enable()
          Providing "Enable" method rather than overriding java's "enable" method because of the following reasons: 1> enable is deprecated 2> It does nothing visually for some controls like button 3> setEnabled calls enable/disable in the base class once it changes the UI.
 java.lang.String GetBeanName()
          Get the name of this bean (the name was assigned by the EPIC framework)
 IHWMFrameWork GetFrameWork()
          Returns the interface using which a bean can communicate directly with the HWM application.
 void HWMEventCallback(HWMEvent hwmEvent)
          This method is called when the execution of a method succeeds
 void OnExit()
          Invoked by the HWM application when the bean is being destroyed.
 void Play()
          The play method needs to execute the functionaliy.
 void readExternal(java.io.ObjectInput objInput)
          Read the data back again and update the UI too
 void ReadProperties()
          Get the required properties from the datamodel and initialize self
 void removeHWMCmdEventListener(HWMCmdEventListener hwmCmdEventListener)
          Removes the listener from the vector of listeners
 void Run()
          Invoked by the HWM application when all the beans are loaded and the application can run.
 void SaveProperties()
          Save the required properties in the datamodel (so that they persist)
 void setBackground(java.awt.Color colBckGround)
          Sets the background color for all the controls except combo box, textfield and text area) in the panel
 void SetBeanName(java.lang.String strBeanName)
          Set the name of the bean
 void setFont(java.awt.Font font)
          Sets the font for all the controls in the panel
 void setForeground(java.awt.Color colForeGround)
          Sets the foreground color for all the controls except combo box, textfield and text area) in the panel
 void SetFrameWork(IHWMFrameWork hwmFrameWork)
          This method is called by the HWM Application to set the interface with which a bean can communicate directly with the HWM application.
 void writeExternal(java.io.ObjectOutput objOutput)
          Save the data
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASE_VERSION

public static final java.lang.String BASE_VERSION
See Also:
Constant Field Values
Constructor Detail

HWMBasePanel

public HWMBasePanel()
Constructor

Method Detail

Enable

public void Enable()
Providing "Enable" method rather than overriding java's "enable" method because of the following reasons: 1> enable is deprecated 2> It does nothing visually for some controls like button 3> setEnabled calls enable/disable in the base class once it changes the UI. So overriding enable or disable and then invoking setEnabled will lead to a loop where this class's enable/disable will call setEnabled on the super class and that would in turn call enable/disable in this class.


Disable

public void Disable()
Providing "Disable" method rather than overriding java's "disable" method because of the following reasons: 1> disable is deprecated 2> It does nothing visually for some controls like button 3> setEnabled calls enable/disable in the base class once it changes the UI. So overriding enable or disable and then invoking setEnabled will lead to a loop where this class's enable/disable will call setEnabled on the super class and that would in turn call enable/disable in this class.


removeHWMCmdEventListener

public void removeHWMCmdEventListener(HWMCmdEventListener hwmCmdEventListener)
Removes the listener from the vector of listeners

Parameters:
hwmCmdEventListener - The listener object to remove

addHWMCmdEventListener

public void addHWMCmdEventListener(HWMCmdEventListener hwmCmdEventListener)
Adds the listener to the vector of listeners

Parameters:
hwmCmdEventListener - The listener object to add

setFont

public void setFont(java.awt.Font font)
Sets the font for all the controls in the panel

Overrides:
setFont in class javax.swing.JComponent
Parameters:
font - The new font for the panel

setBackground

public void setBackground(java.awt.Color colBckGround)
Sets the background color for all the controls except combo box, textfield and text area) in the panel

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
colBckGround - background color

setForeground

public void setForeground(java.awt.Color colForeGround)
Sets the foreground color for all the controls except combo box, textfield and text area) in the panel

Overrides:
setForeground in class javax.swing.JComponent
Parameters:
colForeGround - foreground color

writeExternal

public void writeExternal(java.io.ObjectOutput objOutput)
                   throws java.io.IOException
Save the data

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput objInput)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read the data back again and update the UI too

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

HWMEventCallback

public void HWMEventCallback(HWMEvent hwmEvent)
This method is called when the execution of a method succeeds

Specified by:
HWMEventCallback in interface HWMEventListener
Parameters:
hwmEvent - The event object that contains the event information

SetFrameWork

public void SetFrameWork(IHWMFrameWork hwmFrameWork)
This method is called by the HWM Application to set the interface with which a bean can communicate directly with the HWM application.

Specified by:
SetFrameWork in interface IHWMControl
Parameters:
hwmFrameWork - The interface with which a bean can communicate with the HWM application.

GetFrameWork

public IHWMFrameWork GetFrameWork()
Returns the interface using which a bean can communicate directly with the HWM application.

Returns:
IHWMFrameWork The interface with which a bean can communicate with the HWM application.

SetBeanName

public void SetBeanName(java.lang.String strBeanName)
Set the name of the bean

Specified by:
SetBeanName in interface IHWMControl
Parameters:
strBeanName - The name of this bean as the framework knows it to be. Will be useful, if the bean chooses to scope its data in the datamodel - especially if multiple instances of the same bean appear in the process

GetBeanName

public java.lang.String GetBeanName()
Get the name of this bean (the name was assigned by the EPIC framework)

Returns:
String The bean name

OnExit

public void OnExit()
Invoked by the HWM application when the bean is being destroyed. Any uninitializations to be done, can be done here by overriding this method.

Specified by:
OnExit in interface IHWMControl

Run

public void Run()
Invoked by the HWM application when all the beans are loaded and the application can run. Beans that need to perform some action once all the beans are loaded can do it here. The container will call 'Run' on all the beans that have implemented the IHWMControl. The order will be: a> First call "Run" on all the beans in pages associated with a task. Begin with the first task. b> Call 'Run' on rest of the pages (which are not associated with a task). The pages are selected based on their order of creation. c> Within a page, the beans are invoked depending on the order of their creation.

Specified by:
Run in interface IHWMControl

Play

public void Play()
The play method needs to execute the functionaliy. This may be invoked in the replay mode.

Specified by:
Play in interface IHWMControl

SaveProperties

public void SaveProperties()
Save the required properties in the datamodel (so that they persist)


ReadProperties

public void ReadProperties()
Get the required properties from the datamodel and initialize self