|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.altair.hwm.toolkit.page.HWMModelInstance
public abstract class HWMModelInstance
Title: HWMModelInstance
Description: The generic model instance. This will contain info about the project file. in design mode, it contains info about the def prj file. This also implements the framework interface
Company: Altair Engineering, Inc.
Field Summary | |
---|---|
static int |
APPTYPE_APP
|
static int |
APPTYPE_TODO
|
static java.lang.String |
PROP_MODEL_PRJNAME
|
static java.lang.String |
PROP_MODEL_TPLNAME
These statics represent the properties fired by the model instance |
static java.lang.String |
PROP_TPLDISPLAY_NAME
|
static java.lang.String |
VERSION_PRJ
|
static java.lang.String |
VERSION_TPL
|
Constructor Summary | |
---|---|
HWMModelInstance(java.awt.Component frameEPIC,
IHWMFrame iHWMFrame)
Constructor |
Method Summary | |
---|---|
void |
AddHWMEventListener(HWMEventListener hwmEventListener)
Add a bean as an HWMEventListener |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
Add a property change listener |
void |
AddToolkitEventListener(HWMToolkitEventListener listenerEvent)
Adds a HWMToolkitEventListener |
void |
AppendToTitle(java.lang.String strTitleSuffix)
Append to the title of the application |
java.lang.String |
ApplyTemplateProperties(java.util.Properties propsParamVals)
Apply the properties read. |
void |
BringToFront()
This gets the application's view to the front |
void |
ClearAll()
Clears al the models |
void |
CloseInstance()
Close this instance |
java.lang.Object |
ExecuteJavaScript(java.lang.Object objScope,
java.lang.String strScript)
Execute a JavaScript ("this" modelinstance will be the scope) and return the result |
void |
Exit()
This is invoked by a bean when the application should exit. |
void |
ExportPageTCL(java.lang.String strFilename)
Export the current page onto the given filename as a TCL task. |
static int |
GetAppTypeFromFile(java.io.File file)
Get the app type for the template |
int |
GetAppTypeFromTplPrefs()
Get the type of application |
java.util.Vector |
GetBeans(java.lang.String strBeanInstanceName)
Get the bean instance by the given name |
HWMBindingInfoMgr |
GetBindingInfoMgr()
Get the binding info mgr for this instance |
HWMCommMgr |
GetCommMgr()
This gets the comm mgr class |
IHWMDataModel |
GetDataModel()
This gets the data model for this framework. |
java.lang.String |
GetDefaultPrjName(java.lang.String strTplName)
Given the template file name - get the default prj name |
java.awt.Component |
GetEPICFrame()
Returns the parent component. |
IHWMFrame |
GetFrame()
Returns the IHWMFrame interface. |
IHWInteraction |
GetHWPMInteraction()
This returns the HWPMInteraction for this framework. |
abstract java.lang.String |
GetInstanceName()
Implemented in the app & dsgn specific classes. |
HWPMInteraction |
GetInteraction()
Get the PM interaction |
IMenuToolBarCustomizer |
GetMenuToolBarCustomizer()
the menu/toolbar customizer |
HWMPageMgrModel |
GetPageMgrModel()
Get the page mgr model for this instance |
java.io.File |
GetPmdFile(java.io.File fileTpl)
Get pmd file given the pmt file |
static java.lang.String |
GetPrjVersion(java.io.File file)
Get the project version. |
java.lang.String |
GetProjectDir()
Returns the complete path of the prj directory |
java.lang.String |
GetProjectFileName()
Returns the complete path of the prj file |
java.lang.String |
GetProjectName()
Returns the project name. |
java.lang.String |
GetProjectVersion()
Get the project version. |
java.lang.String |
GetTemplateDir()
Returns the complete path of the template directory |
static java.io.File |
GetTemplateFileBasedOn(java.io.File filePrj)
Get the template file that this file is based on |
java.lang.String |
GetTemplateFileName()
Returns the complete path of the template file |
java.lang.String |
GetTemplateName()
Returns the template name. |
java.lang.Object |
GetTemplatePreferenceValue(java.lang.String strTemplatePrefKey)
This method returns the template preference value associated with the template preference key specified. |
java.lang.String |
GetTemplateVersion()
Get the template version. |
HWMTplProps |
GetTplProperties()
Get the pmt props for the template to which this instance belomgs to |
static java.lang.String |
GetTplVer(java.io.ObjectInputStream ois)
Get the template version. |
static java.lang.String |
GetTplVersion(java.io.File file)
Get the template version. |
IHWMWorkflow |
GetWorkflow()
Gets the workflow interface |
HWMWorkflowModel |
GetWorkflowModel()
Get the workflow model for this instance |
void |
HandleSessionMessages(HWMClientComm hwmSession,
boolean bStart)
Request the framework to handle/stop handling the HWPM script messages received by the comm session. |
void |
HideView()
This hides the application's view |
void |
Initialize()
Initializes all the beans on all the pages. |
abstract void |
InitMenuBar(HWMMenuBarContainer barMenu)
Customizes the menubar. |
abstract void |
InitToolBar(HWMToolBarContainer barTool)
Adds a shortcut bar if required. |
void |
InvokeRun()
Invoke "Run" on all the controls that implement "IHWMControl" interface This is invoked by OpenProject and OpenTemplate methods in app and designer mode respectively. |
boolean |
IsDesignMode()
This is invoked by a bean when it needs to know if its being used in design mode or app mode. |
boolean |
IsHWPMMode()
Returns true, if its in HWPM mode else false |
boolean |
IsProjectNew()
Returns a flag indicating if the project is new |
void |
LogStatus(java.lang.String strMsg)
This displays the given message in the status bar for the application |
abstract void |
OnCloseInstance()
Close this instance |
abstract void |
OnSaveAsInstance(java.lang.String sSaveAsfilename)
Saves the insatnce. |
abstract void |
OnSaveInstance()
Saves the insatnce. |
void |
ReadBindingsFromTpl(java.io.File fileTpl)
Reads the binding info from template This is used in the app mode to read bindings when the prj is of the old version |
void |
ReadPmdFile(java.io.File fileTpl,
java.util.Properties propsParamVals)
Read pmd file |
void |
ReadPrjVersion1_0(HWMObjectInputStream hwmStreamIn,
boolean bForce)
Reads the project file for version 1.0. |
void |
ReadPrjVersion6_0(org.jdom.Element elemRoot)
Reads the project file for version 6.0. |
void |
ReadProject(java.io.File filePrj,
boolean bForce)
Reads the project file. |
void |
ReadTemplate(java.io.File fileTpl)
Reads the pmt file. |
static void |
ReadTemplatePreference(HWMTplProps hwmTplProps,
java.io.File fileTpl)
Reads the pmt preferences from the pmt file. |
void |
ReadTpl6_0(HWMObjectInputStream hwmStreamIn)
Reads the template for version 6.0. |
void |
ReadTplPrjVersion2_0(HWMObjectInputStream hwmStreamIn,
boolean bForce)
Reads the template or project file for version 2.0. |
void |
ReadXMLProject(java.io.File filePrj)
Reads the xml project file. |
void |
RemoveAllJavaScriptContexts()
Removes all javascript context scopes |
void |
RemoveHWMEventListener(HWMEventListener hwmEventListener)
Remove a bean as an HWMEventListener |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
Remove a property change listener |
void |
RemoveToolkitEventListener(HWMToolkitEventListener listenerEvt)
Removes a HWMToolkitEventListener |
void |
SaveAndCloseInstance(boolean bAskUser)
Close this instance If bAskUser is true, then the user is asked if he/she wants to save the pmt/prj file. |
void |
SaveAndExit(boolean bAskUser)
This is invoked by a bean when the application should exit. |
java.lang.String |
SendPmgrTclCommand(java.lang.String strTCLCmd)
Invoke the required tcl command on PM tcl side |
java.lang.String |
SendPmgrTCLCommandWOException(java.lang.String strTCLCmd)
Send pmgr tcl a command. |
void |
SendToBack()
This sets the application's view to the back |
void |
SetAppTypeInTplPrefs(int nAppType)
Set the type of application in the tpl preferences if it is not already present |
void |
SetInteraction(HWPMInteraction pmInteraction)
Set the PM interaction |
abstract void |
SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
Sets a ref to the MenuToolBarHandler for customization. |
void |
SetProject(java.io.File filePrj)
Sets the prj file name and the complete path name |
void |
SetTemplate(java.io.File fileTpl)
Sets the template file name and the complete path name |
void |
SetTplProperties(HWMTplProps hwmTplProps)
Set the pmt props for the template to which this instance belomgs to |
void |
ShowView()
This shows the application's view |
void |
WritePmdFile(java.io.File fileTpl)
Write pmd file |
void |
WriteTpl(java.io.File file)
Saves the template file. |
void |
WriteXMLProject(java.io.File file)
Saves the project file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int APPTYPE_TODO
public static final int APPTYPE_APP
public static final java.lang.String PROP_TPLDISPLAY_NAME
public static final java.lang.String VERSION_TPL
public static final java.lang.String VERSION_PRJ
public static final java.lang.String PROP_MODEL_TPLNAME
public static final java.lang.String PROP_MODEL_PRJNAME
Constructor Detail |
---|
public HWMModelInstance(java.awt.Component frameEPIC, IHWMFrame iHWMFrame)
frameEPIC
- The main frame for EPICiHWMFrame
- The frame interface allows to create/close/save etc.
process instances with user exits.Method Detail |
---|
public boolean IsHWPMMode()
public abstract void OnSaveInstance() throws java.lang.Exception
java.lang.Exception
public abstract void OnSaveAsInstance(java.lang.String sSaveAsfilename) throws java.lang.Exception
java.lang.Exception
public abstract void OnCloseInstance() throws java.lang.Exception
java.lang.Exception
public void SetInteraction(HWPMInteraction pmInteraction)
pmInteraction
- The PM interaction classpublic HWPMInteraction GetInteraction()
public IHWInteraction GetHWPMInteraction()
GetHWPMInteraction
in interface IHWMFrameWork
public java.lang.String SendPmgrTclCommand(java.lang.String strTCLCmd) throws java.lang.Exception
strTCLCmd
- The command to be executedbEncloseInCatch
- If true, enclose the command in a catch statement
java.lang.Exception
public void ClearAll()
public void RemoveAllJavaScriptContexts()
public void SetTemplate(java.io.File fileTpl)
fileTpl
- The template file objectpublic void SetProject(java.io.File filePrj)
fileTpl
- The prj file objectpublic java.lang.String GetTemplateName()
String
- The template namepublic java.lang.String GetTemplateDir()
GetTemplateDir
in interface IHWMFrameWork
String
- The complete path of the template directory
public java.lang.String GetTemplateFileName()
GetTemplateFileName
in interface IHWMFrameWork
String
- The complete path of the template file
public java.lang.String GetProjectName()
String
- The project namepublic java.lang.String GetProjectDir()
GetProjectDir
in interface IHWMFrameWork
String
- The complete path of the prj directory
public java.lang.String GetProjectFileName()
GetProjectFileName
in interface IHWMFrameWork
String
- The complete path of the prj file
public java.lang.String GetDefaultPrjName(java.lang.String strTplName)
strTplName
- The template namepublic abstract java.lang.String GetInstanceName()
String
- The complete path of the prj/pmt filepublic void SetTplProperties(HWMTplProps hwmTplProps)
hwmTplProps
- The template properties for this instancepublic HWMTplProps GetTplProperties()
public HWMWorkflowModel GetWorkflowModel()
public HWMPageMgrModel GetPageMgrModel()
public HWMBindingInfoMgr GetBindingInfoMgr()
public abstract void InitMenuBar(HWMMenuBarContainer barMenu)
barMenu
- public abstract void InitToolBar(HWMToolBarContainer barTool)
barTool
- The toolbar container to customizepublic abstract void SetMenuToolBarHandler(HWMMenuToolBarHandler handlerMenuTool)
handlerMenuTool
- public void Initialize() throws java.lang.Exception
java.lang.Exception
public void SetAppTypeInTplPrefs(int nAppType)
nAppType
- should be one of the HWMModelInstance.APPTYPE_XXXpublic int GetAppTypeFromTplPrefs()
public void InvokeRun()
public void ExportPageTCL(java.lang.String strFilename) throws java.lang.Exception
strFilename
- The file to export the current page
java.lang.Exception
public static java.io.File GetTemplateFileBasedOn(java.io.File filePrj) throws java.lang.Exception
filePrj
- The file whose template should be recovered
java.lang.Exception
- if any error occurspublic static int GetAppTypeFromFile(java.io.File file) throws java.lang.Exception
file
- The file whose app type should be recovered
java.lang.Exception
- if any error occurspublic java.lang.String GetTemplateVersion() throws java.lang.Exception
java.lang.Exception
- - If any error occurspublic java.lang.String GetProjectVersion() throws java.lang.Exception
java.lang.Exception
- - If any error occurspublic static java.lang.String GetTplVersion(java.io.File file) throws java.lang.Exception
file
- The template file
java.lang.Exception
- - If any error occurspublic static java.lang.String GetPrjVersion(java.io.File file) throws java.lang.Exception
file
- The project file
java.lang.Exception
- - If any error occurspublic static java.lang.String GetTplVer(java.io.ObjectInputStream ois) throws java.lang.Exception
ois
- The input stream for the template
java.lang.Exception
- - If any error occurspublic void ReadPrjVersion1_0(HWMObjectInputStream hwmStreamIn, boolean bForce) throws java.io.FileNotFoundException, java.lang.Exception
hwmStreamIn
- -- The input stream to read frombForce
- 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
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
Exception - when any other error occurs
java.lang.Exception
public void ReadTplPrjVersion2_0(HWMObjectInputStream hwmStreamIn, boolean bForce) throws java.io.FileNotFoundException, java.lang.Exception
hwmStreamIn
- -- The input stream to read frombForce
- 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
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
Exception - when any other error occurs
java.lang.Exception
public void ReadTpl6_0(HWMObjectInputStream hwmStreamIn) throws java.lang.Exception
hwmStreamIn
- -- The input stream to read from
java.lang.Exception
- - when any other error occurspublic void ReadPrjVersion6_0(org.jdom.Element elemRoot) throws java.lang.Exception
elemRoot
- -- The root element
java.lang.Exception
- -- when any error occurspublic void ReadProject(java.io.File filePrj, boolean bForce) throws java.io.FileNotFoundException, java.lang.Exception
filePrj
- -- The project file to readbForce
- 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
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
Exception - when any other error occurs
java.lang.Exception
public void ReadXMLProject(java.io.File filePrj) throws java.io.FileNotFoundException, java.lang.Exception
filePrj
- -- The project file to read
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
DataFormatException
- - Thrown when the prj file is not xml
java.lang.Exception
- - when any other error occurspublic void ReadTemplate(java.io.File fileTpl) throws java.io.FileNotFoundException, java.lang.Exception
fileTpl
- -- The pmt file to read
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
Exception - when any other error occurs
java.lang.Exception
public void ReadBindingsFromTpl(java.io.File fileTpl) throws java.io.FileNotFoundException, java.lang.Exception
fileTpl
- -- The pmt file to read
java.io.FileNotFoundException
- - Thrown when the pmt file cannot be
found. Occurs in App mode only
Exception - when any other error occurs
java.lang.Exception
public static void ReadTemplatePreference(HWMTplProps hwmTplProps, java.io.File fileTpl) throws java.lang.Exception
hwmTplProps
- The template properties whose preferences should be
readfileTpl
- -- The pmt file to read
java.lang.Exception
- - when any error occurspublic void WriteXMLProject(java.io.File file) throws java.lang.Exception
file
- The file to save
java.lang.Exception
public void WriteTpl(java.io.File file) throws java.lang.Exception
file
- The file to save
java.lang.Exception
public java.io.File GetPmdFile(java.io.File fileTpl) throws java.lang.Exception
java.lang.Exception
public java.lang.String ApplyTemplateProperties(java.util.Properties propsParamVals)
propsParamVals
- The properties read from the pmd file
public void ReadPmdFile(java.io.File fileTpl, java.util.Properties propsParamVals) throws java.lang.Exception
fileTpl
- The tpl file being readpropsParamVals
- the properties for the template
java.lang.Exception
public void WritePmdFile(java.io.File fileTpl) throws java.lang.Exception
java.lang.Exception
public void AddToolkitEventListener(HWMToolkitEventListener listenerEvent)
listenerEvent
- The listener to addpublic void RemoveToolkitEventListener(HWMToolkitEventListener listenerEvt)
listenerEvent
- The listener to removepublic void addPropertyChangeListener(java.beans.PropertyChangeListener propListener)
propListener
- The property change listener to be addedpublic void removePropertyChangeListener(java.beans.PropertyChangeListener propListener)
propListener
- The property change listener to be removedpublic void LogStatus(java.lang.String strMsg)
LogStatus
in interface IHWMFrameWork
strMsg
- The message to showpublic boolean IsDesignMode()
IsDesignMode
in interface IHWMFrameWork
public void HideView()
HideView
in interface IHWMFrameWork
public void ShowView()
ShowView
in interface IHWMFrameWork
public void BringToFront()
BringToFront
in interface IHWMFrameWork
public void SendToBack()
SendToBack
in interface IHWMFrameWork
public HWMCommMgr GetCommMgr()
GetCommMgr
in interface IHWMFrameWork
public IHWMDataModel GetDataModel()
GetDataModel
in interface IHWMFrameWork
public void AppendToTitle(java.lang.String strTitleSuffix)
AppendToTitle
in interface IHWMFrameWork
strTitleSuffix
- The suffix to append to the titlepublic java.lang.String SendPmgrTCLCommandWOException(java.lang.String strTCLCmd)
strTCLCmd
- The TCL command to send to pmgrpublic void CloseInstance()
CloseInstance
in interface IHWMFrameWork
public void SaveAndCloseInstance(boolean bAskUser)
SaveAndCloseInstance
in interface IHWMFrameWork
public void Exit()
Exit
in interface IHWMFrameWork
public void SaveAndExit(boolean bAskUser)
SaveAndExit
in interface IHWMFrameWork
public IMenuToolBarCustomizer GetMenuToolBarCustomizer()
GetMenuToolBarCustomizer
in interface IHWMFrameWork
public IHWMWorkflow GetWorkflow()
GetWorkflow
in interface IHWMFrameWork
public java.awt.Component GetEPICFrame()
GetEPICFrame
in interface IHWMFrameWork
public IHWMFrame GetFrame()
GetFrame
in interface IHWMFrameWork
public java.lang.Object ExecuteJavaScript(java.lang.Object objScope, java.lang.String strScript) throws java.lang.Exception
ExecuteJavaScript
in interface IHWMFrameWork
strScript
- The Java script to execute
java.lang.Exception
public void AddHWMEventListener(HWMEventListener hwmEventListener)
AddHWMEventListener
in interface IHWMFrameWork
hwmEventListener
- The listener objectpublic void RemoveHWMEventListener(HWMEventListener hwmEventListener)
RemoveHWMEventListener
in interface IHWMFrameWork
hwmEventListener
- The listener objectpublic java.util.Vector GetBeans(java.lang.String strBeanInstanceName)
strBeanInstanceName
- The (unique) bean instance name
public java.lang.Object GetTemplatePreferenceValue(java.lang.String strTemplatePrefKey) throws java.lang.Exception
GetTemplatePreferenceValue
in interface IHWMFrameWork
strTemplatePrefKey
- The template preference key.
java.lang.Exception
public void HandleSessionMessages(HWMClientComm hwmSession, boolean bStart)
HandleSessionMessages
in interface IHWMFrameWork
hwmSession
- The session for which the framework should start or
stop handling the incoming messagesbStart
- If true, it starts handling else stops handlingpublic boolean IsProjectNew()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |