com.altair.hwm.toolkit.page
Class HWMPageMgrModel

java.lang.Object
  extended by com.altair.hwm.toolkit.page.HWMPageMgrModel
Direct Known Subclasses:
HWMDsgnPageMgrModel

public class HWMPageMgrModel
extends java.lang.Object

Title: HWMPageMgrModel

Description: The page mgr model handles the various pages in the pmt

Company: Altair Engineering, Inc.


Field Summary
static java.lang.String PROP_PGMGR_CURRPG
          Properties for which prop change evt are fired
static java.lang.String VERSION_PRJ
          The prj version # for this class
 
Constructor Summary
HWMPageMgrModel(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 ClearAll()
          When a new template/project is loaded, or the existing project/template closed, we need to clear all the contents of this panel.
 void copyControl(HWMBeanInstance hmwBeanInstance)
          copy bean from page to clipBaord
 void copyControl(HWMBeanInstance hmwBeanInstance, boolean mulitpleSelection)
           
 void cutControl(HWMBeanInstance hmwBeanInstance)
          cut the bean from page and store it in the clipboard
 void deleteAllBean()
          delete all beans on current page...
 void deleteBean()
          deleteBean...
 void deselectAllContorls()
          deselect All Controls on click of mouse on page - all selected bean components shold be deselected...
 void ExportPageTCL(java.io.BufferedWriter fwriter)
          Export the current page onto the given filename as TCL.
 HWMBeanClipBoardMgr getBeanClipBoardMgr()
           
 java.lang.Object GetBeanObject(int nPageID, int nBeanID)
          Finds a bean using the ID of the page containing the bean and the by ID of the bean in that page
 java.lang.Object GetBeanPropertyValue(java.lang.Object objBean, java.lang.reflect.Method methodRead)
          Returns the value for the property
 HWMPage GetCurrentPage()
          Get the current page
 HWMBeanInfo GetHWMBeanInfo(int nPageID, int nBeanID)
          Returns the HWMBeanInfo object for the given bean on a given page.
 HWMPage GetPageByID(int nPageID)
          Finds a page by virtue of the ID of the page
 HWMPage GetPageByName(java.lang.String szPageName)
          Finds a page by virtue of the name of the page
 int GetPageCount()
          Returns the number of pages
 java.util.Vector GetPages()
          Returns the pages
 void InitBeans(IHWMFrameWork iFrameWork)
          Initializes all the beans on all the pages.
 void LoadProject(HWMObjectInputStream streamIn)
          Retrieve the project file.
 void NextPage()
          Shows the next page in the list.
 void OnCopyBean()
          OnCopyBean this method will take care for copying of the single or multiple selected bean from the current page By Surya
 void OnCutBean()
          OnCutBean...
 void OnMigrateProject(HWMPageMgrModel hwmOldPgMgrModel, HWMPageMgrModel hwmOldDefPgMgrModel)
          Migrates the old model pg mgr model to follow the new template.
 void OnPasteBean()
          OnPasteBean...
 void pasteControl()
          paste the bean from the clipBorad...
 void PrevPage()
          Shows the prev page in the list
 void ReadVersion1_0(HWMObjectInputStream streamIn)
          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 streamOut)
          Save the project file.
 void selectAllControls()
          select all beans in the current page...
 void SetCurrentPage(HWMPage hwmPageCurrent)
          Set the current page
 void SetCurrentPage(int nPageID)
          Shows the page with the given ID
 void SetCurrentPage(java.lang.Object objSrc, HWMPage hwmPageCurrent)
          Set the current page
 void SetCurrentPage(java.lang.Object objSrc, int nPageID)
          Shows the page with the given ID
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_PRJ

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

See Also:
Constant Field Values

PROP_PGMGR_CURRPG

public static final java.lang.String PROP_PGMGR_CURRPG
Properties for which prop change evt are fired

See Also:
Constant Field Values
Constructor Detail

HWMPageMgrModel

public HWMPageMgrModel(HWMModelInstance hwmModelInstance)
Constructor

Method Detail

getBeanClipBoardMgr

public HWMBeanClipBoardMgr getBeanClipBoardMgr()

InitBeans

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

Parameters:
iFrameWork - The frame work interface

NextPage

public void NextPage()
Shows the next page in the list. If there is no page being shown, then it shows the first page in the list. The workflow uses this feature to show the first page when a workflow has not been set or there is no current task.


PrevPage

public void PrevPage()
Shows the prev page in the list


SetCurrentPage

public void SetCurrentPage(int nPageID)
Shows the page with the given ID

Parameters:
nPageID - ID of the page to be displayed

SetCurrentPage

public void SetCurrentPage(java.lang.Object objSrc,
                           int nPageID)
Shows the page with the given ID

Parameters:
objSrc - The source for this change
nPageID - ID of the page to be displayed

SetCurrentPage

public void SetCurrentPage(HWMPage hwmPageCurrent)
Set the current page

Parameters:
hwmPageCurrent - The new current page

SetCurrentPage

public void SetCurrentPage(java.lang.Object objSrc,
                           HWMPage hwmPageCurrent)
Set the current page

Parameters:
hwmPageCurrent - The new current page

GetCurrentPage

public HWMPage GetCurrentPage()
Get the current page

Returns:
HWMPage

ClearAll

public void ClearAll()
When a new template/project is loaded, or the existing project/template closed, we need to clear all the contents of this panel. This function does that precisely


GetPageByID

public HWMPage GetPageByID(int nPageID)
Finds a page by virtue of the ID of the page

Parameters:
nPageID - The id of the page

GetPageByName

public HWMPage GetPageByName(java.lang.String szPageName)
Finds a page by virtue of the name of the page

Parameters:
szPageName - The name of the page

GetBeanObject

public java.lang.Object GetBeanObject(int nPageID,
                                      int nBeanID)
Finds a bean using the ID of the page containing the bean and the by ID of the bean in that page

Parameters:
nPageID - The id of the page containing the bean
nBeanID - The id of the bean

GetHWMBeanInfo

public HWMBeanInfo GetHWMBeanInfo(int nPageID,
                                  int nBeanID)
Returns the HWMBeanInfo object for the given bean on a given page.

Parameters:
nPageID - The page id of the page containing the bean
nBeanID - The id of the bean

GetPages

public java.util.Vector GetPages()
Returns the pages

Returns:
java.util.Vector The pages

GetPageCount

public int GetPageCount()
Returns the number of pages

Returns:
int The number of pages

ExportPageTCL

public void ExportPageTCL(java.io.BufferedWriter fwriter)
                   throws java.lang.Exception
Export the current page onto the given filename as TCL.

Parameters:
fwriter - - The stream to export the current page
Throws:
java.lang.Exception

OnMigrateProject

public void OnMigrateProject(HWMPageMgrModel hwmOldPgMgrModel,
                             HWMPageMgrModel hwmOldDefPgMgrModel)
                      throws java.lang.Exception
Migrates the old model pg mgr model to follow the new template. This class will propogate this call down to the pages The way migration works is- It'll update the new prj with data that has changed from the old default prj to the old prj.

Parameters:
hwmOldPgMgrModel - -- The pg mgr model from the old project
hwmOldDefPgMgrModel - -- The pg mgr model from the old default project
Throws:
java.lang.Exception - - when any other error occurs

SaveProject

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

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

ReadVersion1_0

public void ReadVersion1_0(HWMObjectInputStream streamIn)
                    throws java.lang.Exception
Retrieve the project file. The project file has all the information regarding the properties of the individual beans.

Parameters:
streamIn - -- The stream to read from
Throws:
java.lang.Exception

LoadProject

public void LoadProject(HWMObjectInputStream streamIn)
                 throws java.lang.Exception
Retrieve the project file. The project file has all the information regarding the properties of the individual beans. Read the version & call approp fn to read the data

Parameters:
streamIn - -- The stream to read from
Throws:
java.lang.Exception

addPropertyChangeListener

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


removePropertyChangeListener

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


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

copyControl

public void copyControl(HWMBeanInstance hmwBeanInstance)
copy bean from page to clipBaord

Parameters:
hmwBeanInstance -

copyControl

public void copyControl(HWMBeanInstance hmwBeanInstance,
                        boolean mulitpleSelection)
Parameters:
hmwBeanInstance -
mulitpleSelection -

cutControl

public void cutControl(HWMBeanInstance hmwBeanInstance)
cut the bean from page and store it in the clipboard

Parameters:
hmwBeanInstance -

pasteControl

public void pasteControl()
paste the bean from the clipBorad...


selectAllControls

public void selectAllControls()
select all beans in the current page...


deselectAllContorls

public void deselectAllContorls()
deselect All Controls on click of mouse on page - all selected bean components shold be deselected... By Surya


deleteAllBean

public void deleteAllBean()
delete all beans on current page...


deleteBean

public void deleteBean()
deleteBean... this method will take care for deleting of the single or multiple selected bean from the current page By Surya


OnCopyBean

public void OnCopyBean()
OnCopyBean this method will take care for copying of the single or multiple selected bean from the current page By Surya


OnCutBean

public void OnCutBean()
OnCutBean... this method will take care for Cut or Ctrl+X of the bean.... single or multiple selected bean from the current page By Surya


OnPasteBean

public void OnPasteBean()
OnPasteBean...


GetBeanPropertyValue

public java.lang.Object GetBeanPropertyValue(java.lang.Object objBean,
                                             java.lang.reflect.Method methodRead)
Returns the value for the property

Parameters:
objBean - The bean whose value is to be retrieved
methodRead - The get method for the property
Returns:
Object The value for the property