com.altair.hwm.toolkit.page
Class HWMPage

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.toolkit.page.HWMPage
All Implemented Interfaces:
HWMToolkitEventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
HWMDsgnPage

public class HWMPage
extends javax.swing.JPanel
implements HWMToolkitEventListener

Title: HWMPage

Description: The class accepts beans dropped onto it and is the starting point for building a task in the workflow.

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
 java.lang.String PAGE_IMAGE_FILE
           
 java.lang.String PAGE_IMAGE_FILE_VISIBILITY
           
static java.lang.String PAGE_VERSION
          The version # for this class
static java.lang.String PROP_PAGE_ID
           
static java.lang.String PROP_PAGE_NAME
          Properties for which events are fired
 
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
HWMPage(HWMModelInstance hwmModelInstance)
          Constructor
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
          Add a property change listener
 void AddToolkitEventListener(HWMToolkitEventListener toolkitListener)
          Add a toolkit event listener
 void DeleteAllBeans()
          Deletes all beans from the vector of beans and clears the page.
 void DeleteBean(int beanId)
           
 void EventPerformed(HWMToolkitEvent evtToolkit)
          The toolkit event listener method
 void ExportTCL(java.io.BufferedWriter fwriter)
          Exports the current page.
 java.util.Vector GetAllBeanInstances()
          Get all the bean instances in this page
 java.util.Vector GetAllBeans()
          Get all the beans in this page
 HWMPageConstraints[] GetAllPageConstraints()
          Get the array of Page constraints (layout constraint of each bean in the page)
 HWMBeanInstance GetBeanInstance(int nBeanID)
          Finds the HWMBeanInstance object for a bean on this page by ID
 java.lang.Object GetBeanObject(int nBeanID)
          Finds a bean on the page by ID
 void GetBeanObjects(java.lang.String strInstanceName, java.util.Vector vectBeans)
          Get the bean object(s) with the given instance name
 java.lang.String GetImageOnPage()
           
 java.lang.String GetImageVisibilityOnPage()
          gives you the image visibility status on from page..
 int GetPageID()
          Returns the page id
 java.lang.String GetPageName()
          Returns the page name
 java.awt.Dimension getPreferredSize()
          Returns the preferred size
 void InitBeans(IHWMFrameWork iFrameWork)
          Initializes all the beans on this page.
 void InvokePlay()
          Inokes Play on all the IHWMControl beans on this page.
 void InvokeRun()
          Inokes Run on all the IHWMControl beans on this page.
 boolean IsBeanInPage(java.lang.Object objBean)
          Checks if the bean is in the page
 void LoadProject(HWMObjectInputStream inStream)
          Retrieve the project file.
 void OnMigrateProject(HWMPage hwmPgOldDefPrj, HWMPage hwmPgOldPrj)
          Migrates the prj to a new template.
 void paint(java.awt.Graphics graphics)
           
 void ReadVersion1_0(HWMObjectInputStream inStream)
          Retrieve the project file.
 void ReadVersion2_0(HWMObjectInputStream inStream)
          Retrieve the project file.
 void removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
          Remove a property change listener
 void RemoveToolkitEventListener(HWMToolkitEventListener toolkitListener)
          Remove a property change listener
 void SaveProject(java.io.ObjectOutputStream outStream)
          Save the project file.
 void SetImageOnPage(java.lang.String imageFilename)
          sets the image on page as background....
 void SetImageVisibilityOnPage(java.lang.String imageVisiblity)
          set the image visibility status on page....
 void SetPageID(int nPageID)
          Sets the page id
 void SetPageName(java.lang.String szPageName)
          Sets the page name
 java.lang.String toString()
          Returns the name of the page
 
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_PAGE_NAME

public static final java.lang.String PROP_PAGE_NAME
Properties for which events are fired

See Also:
Constant Field Values

PROP_PAGE_ID

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

PAGE_IMAGE_FILE

public java.lang.String PAGE_IMAGE_FILE

PAGE_IMAGE_FILE_VISIBILITY

public java.lang.String PAGE_IMAGE_FILE_VISIBILITY

PAGE_VERSION

public static final java.lang.String PAGE_VERSION
The version # for this class

See Also:
Constant Field Values
Constructor Detail

HWMPage

public HWMPage(HWMModelInstance hwmModelInstance)
Constructor

Method Detail

paint

public void paint(java.awt.Graphics graphics)
Overrides:
paint in class javax.swing.JComponent

InitBeans

public void InitBeans(IHWMFrameWork iFrameWork)
Initializes all the beans on this page. This will set the framework if the bean is of type IHWMControl and will call Start on applets

Parameters:
iFrameWork - The frame work interface

InvokeRun

public void InvokeRun()
Inokes Run on all the IHWMControl beans on this page.


InvokePlay

public void InvokePlay()
Inokes Play on all the IHWMControl beans on this page.


SetPageID

public void SetPageID(int nPageID)
Sets the page id

Parameters:
nPageID - The new page id

GetPageID

public int GetPageID()
Returns the page id

Returns:
int The page id

SetPageName

public void SetPageName(java.lang.String szPageName)
Sets the page name

Parameters:
szPageName - The new page new

GetPageName

public java.lang.String GetPageName()
Returns the page name

Returns:
String The page name

GetImageOnPage

public java.lang.String GetImageOnPage()

SetImageOnPage

public void SetImageOnPage(java.lang.String imageFilename)
sets the image on page as background....

Parameters:
imageFilename -

GetImageVisibilityOnPage

public java.lang.String GetImageVisibilityOnPage()
gives you the image visibility status on from page..

Returns:

SetImageVisibilityOnPage

public void SetImageVisibilityOnPage(java.lang.String imageVisiblity)
set the image visibility status on page....

Parameters:
imageVisiblity -

OnMigrateProject

public void OnMigrateProject(HWMPage hwmPgOldDefPrj,
                             HWMPage hwmPgOldPrj)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException,
                             java.beans.IntrospectionException,
                             java.lang.InstantiationException,
                             java.lang.IllegalAccessException
Migrates the prj to a new template. It will go thru each of the bean instance and call migrate on it if the bean instance is present in the new template. We use the bean instance id for this.

Parameters:
hwmPgOldDefPrj - The page that was loaded from the old template's default project
hwmPgOldPrj - The page that was loaded from the project that should migrate to the new template
Throws:
IntrospectionException, - InstantiationException, IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.beans.IntrospectionException
java.lang.InstantiationException
java.lang.IllegalAccessException

GetBeanObject

public java.lang.Object GetBeanObject(int nBeanID)
Finds a bean on the page by ID

Parameters:
nBeanID - The id of the bean

GetAllBeans

public java.util.Vector GetAllBeans()
Get all the beans in this page

Returns:
Vector of Objects. A vector of all the beans

IsBeanInPage

public boolean IsBeanInPage(java.lang.Object objBean)
Checks if the bean is in the page

Parameters:
objBean - The bean object
Returns:
boolean true if the page contains the bean else false

GetAllBeanInstances

public java.util.Vector GetAllBeanInstances()
Get all the bean instances in this page

Returns:
Vector of Objects. A vector of all the beans

GetBeanInstance

public HWMBeanInstance GetBeanInstance(int nBeanID)
Finds the HWMBeanInstance object for a bean on this page by ID

Parameters:
nBeanID - The id of the bean

GetBeanObjects

public void GetBeanObjects(java.lang.String strInstanceName,
                           java.util.Vector vectBeans)
Get the bean object(s) with the given instance name

Parameters:
strInstanceName - The bean instance name
vectBeans - (Return) The vector to which the bean objects (with the given instance name) will be added

DeleteAllBeans

public void DeleteAllBeans()
Deletes all beans from the vector of beans and clears the page. If any applet was added... it will stop the applet.


DeleteBean

public void DeleteBean(int beanId)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
Dimension The preferred size

GetAllPageConstraints

public HWMPageConstraints[] GetAllPageConstraints()
Get the array of Page constraints (layout constraint of each bean in the page)


toString

public java.lang.String toString()
Returns the name of the page

Overrides:
toString in class java.awt.Component
Returns:
String

ExportTCL

public void ExportTCL(java.io.BufferedWriter fwriter)
               throws java.lang.Exception
Exports the current page. The exported file save the page and also gives each bean in that page a shot at saving whatever it needs

Parameters:
outStream - -- The stream to "export" to
Throws:
java.lang.Exception

SaveProject

public void SaveProject(java.io.ObjectOutputStream outStream)
                 throws java.io.IOException
Save the project file. The project file has all the information regarding the properties of the individual beans.

Parameters:
outStream - -- The stream to "serialize" to
Throws:
java.io.IOException

LoadProject

public void LoadProject(HWMObjectInputStream inStream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException,
                        java.beans.IntrospectionException,
                        java.lang.InstantiationException,
                        java.lang.IllegalAccessException
Retrieve the project file. The project file has all the information regarding the properties of the individual beans.

Parameters:
inStream - -- The stream to read from
Throws:
IOException, - ClassNotFoundException, IntrospectionException, InstantiationException, IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.beans.IntrospectionException
java.lang.InstantiationException
java.lang.IllegalAccessException

ReadVersion2_0

public void ReadVersion2_0(HWMObjectInputStream inStream)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException,
                           java.beans.IntrospectionException,
                           java.lang.InstantiationException,
                           java.lang.IllegalAccessException
Retrieve the project file. The project file has all the information regarding the properties of the individual beans.

Parameters:
inStream - -- The stream to read from
Throws:
IOException, - ClassNotFoundException, IntrospectionException, InstantiationException, IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.beans.IntrospectionException
java.lang.InstantiationException
java.lang.IllegalAccessException

ReadVersion1_0

public void ReadVersion1_0(HWMObjectInputStream inStream)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException,
                           java.beans.IntrospectionException,
                           java.lang.InstantiationException,
                           java.lang.IllegalAccessException
Retrieve the project file. The project file has all the information regarding the properties of the individual beans.

Parameters:
inStream - -- The stream to read from
Throws:
IOException, - ClassNotFoundException, IntrospectionException, InstantiationException, IllegalAccessException
java.io.IOException
java.lang.ClassNotFoundException
java.beans.IntrospectionException
java.lang.InstantiationException
java.lang.IllegalAccessException

EventPerformed

public void EventPerformed(HWMToolkitEvent evtToolkit)
The toolkit event listener method

Specified by:
EventPerformed in interface HWMToolkitEventListener
Parameters:
evtToolkit -

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
Add a property change listener

Overrides:
addPropertyChangeListener in class java.awt.Container
Parameters:
propListener - The property change listener object

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
Remove a property change listener

Overrides:
removePropertyChangeListener in class java.awt.Component
Parameters:
propListener - The property change listener object

AddToolkitEventListener

public void AddToolkitEventListener(HWMToolkitEventListener toolkitListener)
Add a toolkit event listener

Parameters:
The - toolkit event listener object

RemoveToolkitEventListener

public void RemoveToolkitEventListener(HWMToolkitEventListener toolkitListener)
Remove a property change listener

Parameters:
The - toolkit event listener object