public class PgGeometry_Menu extends PsMethodMenu
PgGeometry_Menu
which adds additional menu items and sub menus. When the geometry is the current geometry in the
viewer, then its set of method menus is added to the menu bar of the control window.
Each geometry may add a set of menu items to submenus of the 'method' menu.
Usage:
In the init()
method add new menu entries as follows:
addMenu("Menu-Name"); addMenuItem("Menu-Name", "Menu-Item-Name");The submenu is created if it does not exist. Catch menu events in the
applyMethod(String name)
using:
if (name.equals("Menu-Item-Name")) // invoke method related with "Menu-Item-Name".
PsMethodMenu
,
Serialized FormModifier and Type | Field and Description |
---|---|
java.lang.String[] |
m_geometryMethod |
static int |
MTHD_PRINT_ALL |
static int |
MTHD_PRINT_BNDBOX |
static int |
MTHD_PRINT_CENTER |
static int |
MTHD_SHOW_BNDBOX |
static int |
MTHD_SHOW_CENTER |
static int |
MTHD_SHOW_NAME |
static int |
MTHD_UPDATE |
Constructor and Description |
---|
PgGeometry_Menu() |
Modifier and Type | Method and Description |
---|---|
boolean |
applyMethod(java.lang.String aMethod)
Invoke action determined by current string.
|
PvViewerIf |
getViewer()
Get viewer which enables access to displays and inspectors.
|
void |
init(PsObject anObject)
Register the target geometry, and
subclasses should register all menu items and submenus.
|
void |
setViewer(PvViewerIf viewer)
Set viewer enable access to displays and inspectors.
|
boolean |
update(java.lang.Object event)
Update this menu if the parent object has changed.
|
actionPerformed, addMenu, addMenu, addMenuItem, addMenuItem, addMenuItem, clone, getFather, getLanguage, getMenu, getMenuItem, getName, hasMenu, hasMenuItem, itemStateChanged, removeMenu, removeMenuItem, setName, setParent
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
public static final int MTHD_UPDATE
public static final int MTHD_PRINT_ALL
public static final int MTHD_PRINT_CENTER
public static final int MTHD_PRINT_BNDBOX
public static final int MTHD_SHOW_NAME
public static final int MTHD_SHOW_BNDBOX
public static final int MTHD_SHOW_CENTER
public java.lang.String[] m_geometryMethod
public void init(PsObject anObject)
PsMethodMenu
init
in class PsMethodMenu
anObject
- argument used by subclasses to specify object on which action shall be executed.public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PsMethodMenu
event
- carries a lot of informationPsMethodMenu.setParent(PsUpdateIf)
,
PsMethodMenu.getFather()
public boolean applyMethod(java.lang.String aMethod)
PsMethodMenu
false
, and should be overwritten by subclasses.applyMethod
in class PsMethodMenu
public PvViewerIf getViewer()
setViewer(PvViewerIf)
public void setViewer(PvViewerIf viewer)
getViewer()
"