com.altair.hwm.toolkit.page
Class HWMAppModelInstance

java.lang.Object
  extended by com.altair.hwm.toolkit.page.HWMModelInstance
      extended by com.altair.hwm.toolkit.page.HWMAppModelInstance
All Implemented Interfaces:
HWMCommListener, IHWMFrameWork, java.util.EventListener

public class HWMAppModelInstance
extends HWMModelInstance
implements HWMCommListener

Title: HWMAppModelInstance

Description: The model instance for the app mode of EPIC

Company: Altair Engineering, Inc.


Field Summary
 
Fields inherited from class com.altair.hwm.toolkit.page.HWMModelInstance
APPTYPE_APP, APPTYPE_TODO, PROP_MODEL_PRJNAME, PROP_MODEL_TPLNAME, PROP_TPLDISPLAY_NAME, VERSION_PRJ, VERSION_TPL
 
Constructor Summary
HWMAppModelInstance(java.awt.Component frameEPIC, IHWMFrame iHWMFrame)
          Constructor
 
Method Summary
 java.lang.String GetInstanceName()
          Will return the complete path of the prj file
 HWMMenuBarContainer GetMenuBar()
          Returns the instance's menubar
 HWMToolBarContainer GetToolBar()
          Returns the instance's toolbar
 void HandleSessionMessages(HWMClientComm hwmSession, boolean bStart)
          Request the framework to handle/stop handling the HWPM script messages received by the comm session.
 void InitMenuBar(HWMMenuBarContainer barMenu)
          Customizes the menubar.
 void InitToolBar(HWMToolBarContainer barTool)
          Adds a shortcut bar if required.
 boolean IsDesignMode()
          This is invoked by a bean when it needs to know if its being used in design mode or app mode.
 boolean IsNewProject()
          Return whether this model instance was created as a result of creating new or opening an existing prj
 void OnCloseInstance()
          Close this instance
 java.lang.Object OnCommCommandReceived(HWMCommEvent hwmCommEvent)
          A HWPM command has been received
 void OnMigrateProject(HWMAppModelInstance hwmOldPrjInst, HWMAppModelInstance hwmOldDefPrjInst)
          Migrates the old model instance to follow the new template.
 void OnNewInstance(java.io.File filePrj, java.io.File fileTpl)
          Create a new instance
 void OnOpenInstance(java.io.File filePrj, java.io.File fileTpl, boolean bForce)
          Open an instance
 void OnSaveAsInstance(java.lang.String sSaveAsfilename)
          Saves the insatnce.
 void OnSaveInstance()
          Saves the insatnce.
 void OnSessionEnded(HWMCommEvent hwmCommEvent)
          The session has ended
 java.lang.String SendPmgrTclCommand(java.lang.String strTCLCmd)
          Invoke the required tcl command on PM tcl side
 void SetInteraction(HWPMInteraction pmInteraction)
          Set the PM interaction
 void SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
          Sets a ref to the MenuToolBarHandler for customization.
 
Methods inherited from class com.altair.hwm.toolkit.page.HWMModelInstance
AddHWMEventListener, addPropertyChangeListener, AddToolkitEventListener, AppendToTitle, ApplyTemplateProperties, BringToFront, ClearAll, CloseInstance, ExecuteJavaScript, Exit, ExportPageTCL, GetAppTypeFromFile, GetAppTypeFromTplPrefs, GetBeans, GetBindingInfoMgr, GetCommMgr, GetDataModel, GetDefaultPrjName, GetEPICFrame, GetFrame, GetHWPMInteraction, GetInteraction, GetMenuToolBarCustomizer, GetPageMgrModel, GetPmdFile, GetPrjVersion, GetProjectDir, GetProjectFileName, GetProjectName, GetProjectVersion, GetTemplateDir, GetTemplateFileBasedOn, GetTemplateFileName, GetTemplateName, GetTemplatePreferenceValue, GetTemplateVersion, GetTplProperties, GetTplVer, GetTplVersion, GetWorkflow, GetWorkflowModel, HideView, Initialize, InvokeRun, IsHWPMMode, IsProjectNew, LogStatus, ReadBindingsFromTpl, ReadPmdFile, ReadPrjVersion1_0, ReadPrjVersion6_0, ReadProject, ReadTemplate, ReadTemplatePreference, ReadTpl6_0, ReadTplPrjVersion2_0, ReadXMLProject, RemoveAllJavaScriptContexts, RemoveHWMEventListener, removePropertyChangeListener, RemoveToolkitEventListener, SaveAndCloseInstance, SaveAndExit, SendPmgrTCLCommandWOException, SendToBack, SetAppTypeInTplPrefs, SetProject, SetTemplate, SetTplProperties, ShowView, WritePmdFile, WriteTpl, WriteXMLProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HWMAppModelInstance

public HWMAppModelInstance(java.awt.Component frameEPIC,
                           IHWMFrame iHWMFrame)
Constructor

Parameters:
frameEPIC - The main frame for EPIC
iHWMFrame - The frame interface allows to create/close/save etc. process instances with user exits.
Method Detail

OnNewInstance

public void OnNewInstance(java.io.File filePrj,
                          java.io.File fileTpl)
                   throws java.lang.Exception
Create a new instance

Parameters:
filePrj - The file for which an instance should be created
fileTpl - The template file that the prj should be based on
Throws:
java.lang.Exception

OnOpenInstance

public void OnOpenInstance(java.io.File filePrj,
                           java.io.File fileTpl,
                           boolean bForce)
                    throws java.io.FileNotFoundException,
                           java.lang.Exception
Open an instance

Parameters:
filePrj - The file for which an instance should be opened
fileTpl - The template that the prj is based on
bForce - If true, the prj is opened using the def pmt even if the pmt file name in prj does not match with the def pmt name
Throws:
java.io.FileNotFoundException - - Thrown when the pmt file name in the prj does not match with the def pmt name
java.lang.Exception

OnCloseInstance

public void OnCloseInstance()
                     throws java.lang.Exception
Close this instance

Specified by:
OnCloseInstance in class HWMModelInstance
Throws:
java.lang.Exception

OnSaveInstance

public void OnSaveInstance()
                    throws java.lang.Exception
Saves the insatnce. Save prj

Specified by:
OnSaveInstance in class HWMModelInstance
Throws:
java.lang.Exception

OnMigrateProject

public void OnMigrateProject(HWMAppModelInstance hwmOldPrjInst,
                             HWMAppModelInstance hwmOldDefPrjInst)
                      throws java.lang.Exception
Migrates the old model instance to follow the new template. The instance will propogate this call down to other modules like the page mgr model etc. The workflow model and the template props will be retrieved from the new template whereas the data model will be retrieved from the old project The data from data model of old prj is retrieved 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:
hwmOldPrjInst - -- The model instance representing the old project
hwmOldDefPrjInst - -- The model instance representing the default old project
Throws:
java.lang.Exception - - when any other error occurs

GetInstanceName

public java.lang.String GetInstanceName()
Will return the complete path of the prj file

Specified by:
GetInstanceName in class HWMModelInstance
Parameters:
String - The complete path of the prj file

GetMenuBar

public HWMMenuBarContainer GetMenuBar()
Returns the instance's menubar

Returns:
HWMMenuBarContainer

GetToolBar

public HWMToolBarContainer GetToolBar()
Returns the instance's toolbar

Returns:
HWMtoolBarContainer

InitMenuBar

public void InitMenuBar(HWMMenuBarContainer barMenu)
Customizes the menubar.

Specified by:
InitMenuBar in class HWMModelInstance
Parameters:
barMenu -

InitToolBar

public void InitToolBar(HWMToolBarContainer barTool)
Adds a shortcut bar if required.

Specified by:
InitToolBar in class HWMModelInstance
Parameters:
barTool - The toolbar container to customize

SetMenuToolBarHandler

public void SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
Sets a ref to the MenuToolBarHandler for customization.

Specified by:
SetMenuToolBarHandler in class HWMModelInstance
Parameters:
handlerMenuTool -

IsNewProject

public boolean IsNewProject()
Return whether this model instance was created as a result of creating new or opening an existing prj


SendPmgrTclCommand

public java.lang.String SendPmgrTclCommand(java.lang.String strTCLCmd)
                                    throws java.lang.Exception
Invoke the required tcl command on PM tcl side

Overrides:
SendPmgrTclCommand in class HWMModelInstance
Parameters:
strTCLCmd - The command to be executed
bEncloseInCatch - If true, enclose the command in a catch statement
Returns:
String The return value
Throws:
java.lang.Exception

SetInteraction

public void SetInteraction(HWPMInteraction pmInteraction)
Set the PM interaction

Overrides:
SetInteraction in class HWMModelInstance
Parameters:
pmInteraction - The PM interaction class

IsDesignMode

public boolean IsDesignMode()
This is invoked by a bean when it needs to know if its being used in design mode or app mode. Implemented by derived classes

Specified by:
IsDesignMode in interface IHWMFrameWork
Overrides:
IsDesignMode in class HWMModelInstance
Returns:
boolean If design mode, then true else false

HandleSessionMessages

public void HandleSessionMessages(HWMClientComm hwmSession,
                                  boolean bStart)
Request the framework to handle/stop handling the HWPM script messages received by the comm session.

Specified by:
HandleSessionMessages in interface IHWMFrameWork
Overrides:
HandleSessionMessages in class HWMModelInstance
Parameters:
hwmSession - The session for which the framework should start or stop handling the incoming messages
bStart - If true, it starts handling else stops handling

OnCommCommandReceived

public java.lang.Object OnCommCommandReceived(HWMCommEvent hwmCommEvent)
                                       throws java.lang.Exception
A HWPM command has been received

Specified by:
OnCommCommandReceived in interface HWMCommListener
Parameters:
hwmCommEvent - The comm event
Returns:
Object The result of processing this command from the socket. Return null, if this command does not interest you -- otherwise, at least return "";
Throws:
java.lang.Exception

OnSessionEnded

public void OnSessionEnded(HWMCommEvent hwmCommEvent)
The session has ended

Specified by:
OnSessionEnded in interface HWMCommListener
Parameters:
hwmCommEvent - The comm event

OnSaveAsInstance

public void OnSaveAsInstance(java.lang.String sSaveAsfilename)
                      throws java.lang.Exception
Description copied from class: HWMModelInstance
Saves the insatnce. Save prj

Specified by:
OnSaveAsInstance in class HWMModelInstance
Throws:
java.lang.Exception