com.altair.hwm.beans.database
Class HWMStartDB

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.AbstractButton
                  extended by javax.swing.JButton
                      extended by com.altair.hwm.beans.utils.HWMButton
                          extended by com.altair.hwm.beans.database.HWMStartDB
All Implemented Interfaces:
HWMEventListener, IHWMControl, ITCLCodeCreator, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Externalizable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants

public class HWMStartDB
extends HWMButton
implements java.io.Externalizable, java.awt.event.ActionListener

Title: HWMStartDB

Description: This bean will initialize the cxn with the server

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 DB_PWD
          The property name in the config file for the password
static java.lang.String DB_SERVER_ADDR
          The property name in the config file for the Database server's IP
static java.lang.String DB_SERVER_PORT
          The property name in the config file for the Database server's port #.
static java.lang.String DB_TYPE
          The property name in the config file for the type of DB
static java.lang.String DB_URL
          The property name in the config file for the DB URL The name of the database
static java.lang.String DB_USER
          The property name in the config file for the user name
static int METH_START_DB
          List of Method IDs that will fire HWMCmdEvent
static java.lang.String PROP_CFG_FILE
          The property name for the config file
static java.lang.String PROP_MANUAL_MODE
          The property name for the manual mode.
static java.lang.String PROP_PRJ_DESC
          The property name for the prj desc
static java.lang.String PROP_PRJ_NAME
          The property name for the prj name
static java.lang.String PROP_SESSION_NAME
          The property name for the session name used to communicate with DB server
static java.lang.String VERSION
          The version ID for this component
 
Fields inherited from class com.altair.hwm.beans.utils.HWMButton
BTNTYPE_APPLY, BTNTYPE_APPLY_AND_NEXT, BTNTYPE_CANCEL, BTNTYPE_GENERIC, BTNTYPE_NEXT, BTNTYPE_PREV
 
Fields inherited from class javax.swing.AbstractButton
BORDER_PAINTED_CHANGED_PROPERTY, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
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 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
HWMStartDB()
          Constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actEvt)
           
 java.lang.String GetConfigFile()
          Gets the config file name
 java.lang.String GetProjectDescription()
          Get the prj description
 java.lang.String GetProjectName()
          Get the prj name
 java.lang.String GetSessionName()
          Gets the session name
 boolean IsManualMode()
          Gets the manual mode flag
 void OnExit()
          Invoked by the HWM application when the bean is being destroyed.
 void readExternal(java.io.ObjectInput objInput)
          Loads the version and then calls the appropriate read function for the version
 void ReadProperties()
          Get the required properties from the datamodel and initialize self
 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 SetConfigFile(java.lang.String strCfgFile)
          Sets the config file name
 void SetFrameWork(IHWMFrameWork hwmFrameWork)
          Overrides the IHWMControl's SetHWMFrameWork to create all the necessary hm bean's comm classes
 void SetManualMode(boolean bManualMode)
          Sets the manual mode.
 void SetProjectDescription(java.lang.String strPrjDesc)
          Set the prj description
 void SetProjectName(java.lang.String strPrjName)
          Set the prj name
 void SetSessionName(java.lang.String strSessionName)
          Sets the session name
 void StartDBClient()
          This method will read the config file and establish connection to the server.
 void writeExternal(java.io.ObjectOutput objOutput)
          Save the persistent properties
 
Methods inherited from class com.altair.hwm.beans.utils.HWMButton
addHWMCmdEventListener, Disable, Enable, GetActionScript, GetBeanName, GetButtonType, GetFrameWork, GetImageAlignment, GetImageFilename, GetImageVisibilityStatus, getToolTipText, HWMEventCallback, OnAction, Play, propertyChange, removeHWMCmdEventListener, SetActionScript, SetBeanName, SetButtonType, SetButtonType, setEnabled, SetIconOnButton, SetImageAlignment, SetImageFilename, SetImageFilename, SetImageVisibilityStatus, setPreferredSize, setSize, setText, setToolTipText, setVisible, TCLCreateAdditionalEventProcs, TCLCreateExec, TCLCreateGetDataFromDataModel, TCLCreateMemberVariables, TCLCreateOnDataModelChanged, TCLCreateSetDataInDataModel, TCLCreateUI
 
Methods inherited from class javax.swing.JButton
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, removeNotify, setDefaultCapable, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, doClick, doClick, getAction, getActionCommand, getActionListeners, getChangeListeners, getDisabledIcon, getDisabledSelectedIcon, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getItemListeners, getLabel, getMargin, getMnemonic, getModel, getMultiClickThreshhold, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, imageUpdate, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setAction, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setDisplayedMnemonicIndex, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabel, setLayout, setMargin, setMnemonic, setMnemonic, setModel, setMultiClickThreshhold, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setUI, setVerticalAlignment, setVerticalTextPosition
 
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, 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, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, 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, 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, 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, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
The version ID for this component

See Also:
Constant Field Values

DB_SERVER_ADDR

public static final java.lang.String DB_SERVER_ADDR
The property name in the config file for the Database server's IP

See Also:
Constant Field Values

DB_SERVER_PORT

public static final java.lang.String DB_SERVER_PORT
The property name in the config file for the Database server's port #. Not mandatory

See Also:
Constant Field Values

DB_URL

public static final java.lang.String DB_URL
The property name in the config file for the DB URL The name of the database

See Also:
Constant Field Values

DB_USER

public static final java.lang.String DB_USER
The property name in the config file for the user name

See Also:
Constant Field Values

DB_PWD

public static final java.lang.String DB_PWD
The property name in the config file for the password

See Also:
Constant Field Values

DB_TYPE

public static final java.lang.String DB_TYPE
The property name in the config file for the type of DB

See Also:
Constant Field Values

PROP_SESSION_NAME

public static final java.lang.String PROP_SESSION_NAME
The property name for the session name used to communicate with DB server

See Also:
Constant Field Values

PROP_MANUAL_MODE

public static final java.lang.String PROP_MANUAL_MODE
The property name for the manual mode. If the property is set to true, then the bean will automatically establish the connection when the framework calls the Run method. Else, user will have to click on the button to establish connection

See Also:
Constant Field Values

PROP_CFG_FILE

public static final java.lang.String PROP_CFG_FILE
The property name for the config file

See Also:
Constant Field Values

PROP_PRJ_DESC

public static final java.lang.String PROP_PRJ_DESC
The property name for the prj desc

See Also:
Constant Field Values

PROP_PRJ_NAME

public static final java.lang.String PROP_PRJ_NAME
The property name for the prj name

See Also:
Constant Field Values

METH_START_DB

public static final int METH_START_DB
List of Method IDs that will fire HWMCmdEvent

See Also:
Constant Field Values
Constructor Detail

HWMStartDB

public HWMStartDB()
Constructor

Method Detail

SetConfigFile

public void SetConfigFile(java.lang.String strCfgFile)
Sets the config file name

Parameters:
strCfgFile - The name of the config file

GetConfigFile

public java.lang.String GetConfigFile()
Gets the config file name

Returns:
String The name of the config file

SetSessionName

public void SetSessionName(java.lang.String strSessionName)
Sets the session name

Parameters:
strSessionName - The name for the session

GetSessionName

public java.lang.String GetSessionName()
Gets the session name

Returns:
String The name for the session

SetManualMode

public void SetManualMode(boolean bManualMode)
Sets the manual mode. If the property is set to true, then the bean will automatically establish the connection when the framework calls the Run method. Else, user will have to click on the button to establish connection


IsManualMode

public boolean IsManualMode()
Gets the manual mode flag

Returns:
boolean The manual mode flag

SetProjectDescription

public void SetProjectDescription(java.lang.String strPrjDesc)
Set the prj description

Parameters:
strPrjDesc - The prj description

GetProjectDescription

public java.lang.String GetProjectDescription()
Get the prj description

Returns:
String The prj description

SetProjectName

public void SetProjectName(java.lang.String strPrjName)
Set the prj name

Parameters:
strPrjName - The prj name

GetProjectName

public java.lang.String GetProjectName()
Get the prj name

Returns:
String The prj name

StartDBClient

public void StartDBClient()
This method will read the config file and establish connection to the server. Once the DB is opened on the server end... the prj info is either retrieved or created depending on the current prj id This method will fire a OnCmdSuccess event if its successful else OnCmdFailed


actionPerformed

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

SetFrameWork

public void SetFrameWork(IHWMFrameWork hwmFrameWork)
Overrides the IHWMControl's SetHWMFrameWork to create all the necessary hm bean's comm classes

Specified by:
SetFrameWork in interface IHWMControl
Overrides:
SetFrameWork in class HWMButton
Parameters:
hwmFrameWork - The interface which allows the communication between beans and the container frame

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. Out here - check if the client should connect to server

Specified by:
Run in interface IHWMControl
Overrides:
Run in class HWMButton

OnExit

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

Specified by:
OnExit in interface IHWMControl
Overrides:
OnExit in class HWMButton

SaveProperties

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

Overrides:
SaveProperties in class HWMButton

ReadProperties

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

Overrides:
ReadProperties in class HWMButton

writeExternal

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

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class HWMButton
Parameters:
objOutput - The stream to which data will be written
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput objInput)
                  throws java.lang.ClassNotFoundException,
                         java.io.IOException
Loads the version and then calls the appropriate read function for the version

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class HWMButton
Parameters:
objInput - The stream from which data will be read
Throws:
IOException, - ClassNotFoundException
java.lang.ClassNotFoundException
java.io.IOException