com.altair.hwm.toolkit.preferences
Class HWMMenuToolBarPreferences

java.lang.Object
  extended by com.altair.hwm.toolkit.preferences.HWMMenuToolBarPreferences

public class HWMMenuToolBarPreferences
extends java.lang.Object

Title: HWMMenuToolBarPreferences

Description: Encapsulates the menubar and toolbar preferences.

Company: Altair Engineering, Inc.


Field Summary
static java.lang.String MENU_TOOLBAR_PREF_VERSION
           
 
Constructor Summary
HWMMenuToolBarPreferences()
          Default Constructor
HWMMenuToolBarPreferences(int nAppType)
          Constructor for constructing default menu and toolbars for macro type apps or standard apps
 
Method Summary
 javax.swing.tree.DefaultTreeModel GetMenuBarPrefModel()
          Returns the MenuBarPreference model
 HWMMenuBarPrefNode GetMenuBarPrefNode(javax.swing.tree.DefaultMutableTreeNode nodeParent, java.lang.String szName)
          Returns the node with the specified name by searching the specified parent node.
 HWMMenuBarPrefNode GetMenuBarPrefNode(java.lang.String szName)
          Returns the node with the specified name
 HWMMenuBarPrefNode GetMenuBarPrefNode(java.lang.String strParentName, java.lang.String szName)
          Returns the node with the specified name under the specified parent
 javax.swing.tree.DefaultTreeModel GetToolBarPrefModel()
          Returns the ToolBarPreference model
 HWMToolBarPrefNode GetToolBarPrefNode(java.lang.String szName)
          Returns the node with the specified name
 HWMToolBarPrefNode GetToolBarPrefNode(java.lang.String strParentName, java.lang.String szName)
          Returns the node with the specified name under the specified parent
 void Load(java.io.ObjectInputStream streamIn)
          Loads the menubar and toolbar preference models
 void Save(java.io.ObjectOutputStream streamOut)
          Saves the menubar and toolbar preference models
 void SetAppType(int nAppType)
          Change the toolbar/menu bar prefs according to the pmt type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MENU_TOOLBAR_PREF_VERSION

public static final java.lang.String MENU_TOOLBAR_PREF_VERSION
See Also:
Constant Field Values
Constructor Detail

HWMMenuToolBarPreferences

public HWMMenuToolBarPreferences()
Default Constructor


HWMMenuToolBarPreferences

public HWMMenuToolBarPreferences(int nAppType)
Constructor for constructing default menu and toolbars for macro type apps or standard apps

Parameters:
nAppType - The type of application. Will be one of HWMModelInstance.APPTYPE_XXX
Method Detail

GetToolBarPrefNode

public HWMToolBarPrefNode GetToolBarPrefNode(java.lang.String szName)
Returns the node with the specified name

Parameters:
szName - The name of the node to find
Returns:
HWMToolBarPrefNode The found node, null if not found.

GetToolBarPrefNode

public HWMToolBarPrefNode GetToolBarPrefNode(java.lang.String strParentName,
                                             java.lang.String szName)
Returns the node with the specified name under the specified parent

Parameters:
strParentName - The name of the parent
szName - The name of the node to find
Returns:
HWMToolBarPrefNode The found node, null if not found.

GetMenuBarPrefNode

public HWMMenuBarPrefNode GetMenuBarPrefNode(java.lang.String szName)
Returns the node with the specified name

Parameters:
szName - The name of the node to find
Returns:
HWMMenuBarPrefNode The found node, null if not found.

GetMenuBarPrefNode

public HWMMenuBarPrefNode GetMenuBarPrefNode(java.lang.String strParentName,
                                             java.lang.String szName)
Returns the node with the specified name under the specified parent

Parameters:
strParentName - The name of the parent
szName - The name of the node to find
Returns:
HWMMenuBarPrefNode The found node, null if not found.

GetMenuBarPrefNode

public HWMMenuBarPrefNode GetMenuBarPrefNode(javax.swing.tree.DefaultMutableTreeNode nodeParent,
                                             java.lang.String szName)
Returns the node with the specified name by searching the specified parent node.

Parameters:
nodeParent - The node to search
szName - The name of the node to find.
Returns:
HWMMenuBarPrefNode The found node, null if not found

GetMenuBarPrefModel

public javax.swing.tree.DefaultTreeModel GetMenuBarPrefModel()
Returns the MenuBarPreference model

Returns:
DefaultTreeModel

GetToolBarPrefModel

public javax.swing.tree.DefaultTreeModel GetToolBarPrefModel()
Returns the ToolBarPreference model

Returns:
DefaultTreeModel

Save

public void Save(java.io.ObjectOutputStream streamOut)
          throws java.io.IOException
Saves the menubar and toolbar preference models

Parameters:
streamOut - The output stream to write to
Throws:
java.io.IOException

Load

public void Load(java.io.ObjectInputStream streamIn)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Loads the menubar and toolbar preference models

Parameters:
streamIn - The stream to read from
Throws:
java.io.IOException
java.lang.ClassNotFoundException

SetAppType

public void SetAppType(int nAppType)
Change the toolbar/menu bar prefs according to the pmt type. Called either via the constructor or from tpl pref panel when todo checkbox is checked/unchecked.

Parameters:
nAppType - The application type can be one of the HWMModelInstance.APPTYPE_XXX