jv.project
Class PgGeometry_Menu
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector
-
- jv.objectGui.PsMethodMenu
-
- jv.project.PgGeometry_Menu
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.ItemListener, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.EventListener, java.util.List, java.util.RandomAccess, PsUpdateIf
- Direct Known Subclasses:
- PgPointSet_Menu, PgPointSet_Menu
public class PgGeometry_Menu extends PsMethodMenu
Add specific menu items to 'method' menu in control panel to invoke methods from menu. For example, each geometry may have a menu class derivedPgGeometry_Menuwhich 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 theinit()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 theapplyMethod(String name)using:if (name.equals("Menu-Item-Name")) // invoke method related with "Menu-Item-Name".- See Also:
PsMethodMenu, Serialized Form- Author:
- Konrad Polthier
- Version:
- 20.12.01, 2.20 revised (ep) Internationalization.
12.12.01, 2.10 revised (kp) Showing of bndbox and center enabled.
18.07.99, 2.00 revised (kp) Method calls changed and PsMenu replaced with standard java.awt.Menu.
00.00.98, 1.00 created (kp)
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.String[]m_geometryMethodstatic intMTHD_PRINT_ALLstatic intMTHD_PRINT_BNDBOXstatic intMTHD_PRINT_CENTERstatic intMTHD_SHOW_BNDBOXstatic intMTHD_SHOW_CENTERstatic intMTHD_SHOW_NAMEstatic intMTHD_UPDATE
-
Constructor Summary
Constructors Constructor and Description PgGeometry_Menu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanapplyMethod(java.lang.String aMethod)Invoke action determined by current string.PvViewerIfgetViewer()Get viewer which enables access to displays and inspectors.voidinit(PsObject anObject)Register the target geometry, and subclasses should register all menu items and submenus.voidsetViewer(PvViewerIf viewer)Set viewer enable access to displays and inspectors.booleanupdate(java.lang.Object event)Update this menu if the parent object has changed.-
Methods inherited from class jv.objectGui.PsMethodMenu
actionPerformed, addMenu, addMenu, addMenuItem, addMenuItem, addMenuItem, clone, getFather, getLanguage, getMenu, getMenuItem, getName, getPanelVersion, hasMenu, hasMenuItem, itemStateChanged, removeMenu, removeMenuItem, setName, setParent
-
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, forEach, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeIf, replaceAll, retainAll, set, setElementAt, setSize, size, sort, spliterator, subList, toArray, toArray, toString, trimToSize
-
-
-
-
Field Detail
-
MTHD_UPDATE
public static final int MTHD_UPDATE
- See Also:
- Constant Field Values
-
MTHD_PRINT_ALL
public static final int MTHD_PRINT_ALL
- See Also:
- Constant Field Values
-
MTHD_PRINT_CENTER
public static final int MTHD_PRINT_CENTER
- See Also:
- Constant Field Values
-
MTHD_PRINT_BNDBOX
public static final int MTHD_PRINT_BNDBOX
- See Also:
- Constant Field Values
-
MTHD_SHOW_NAME
public static final int MTHD_SHOW_NAME
- See Also:
- Constant Field Values
-
MTHD_SHOW_BNDBOX
public static final int MTHD_SHOW_BNDBOX
- See Also:
- Constant Field Values
-
MTHD_SHOW_CENTER
public static final int MTHD_SHOW_CENTER
- See Also:
- Constant Field Values
-
m_geometryMethod
public java.lang.String[] m_geometryMethod
-
-
Method Detail
-
init
public void init(PsObject anObject)
Description copied from class:PsMethodMenuRegister the target geometry, and subclasses should register all menu items and submenus.- Overrides:
initin classPsMethodMenu- Parameters:
anObject- argument used by subclasses to specify object on which action shall be executed.
-
update
public boolean update(java.lang.Object event)
Update this menu if the parent object has changed. Set the state of CheckboxMenuItems depending on the states of the parent geometry.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsMethodMenu- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsMethodMenu.setParent(PsUpdateIf),PsMethodMenu.getFather()
-
applyMethod
public boolean applyMethod(java.lang.String aMethod)
Description copied from class:PsMethodMenuInvoke action determined by current string. This method returnsfalse, and should be overwritten by subclasses.- Overrides:
applyMethodin classPsMethodMenu
-
getViewer
public PvViewerIf getViewer()
Get viewer which enables access to displays and inspectors.- Since:
- JavaView 2.45
- See Also:
setViewer(PvViewerIf)- Version:
- 11.11.02, 1.00 created (kp)
-
setViewer
public void setViewer(PvViewerIf viewer)
Set viewer enable access to displays and inspectors.- Since:
- JavaView 2.45
- See Also:
getViewer()- Version:
- 11.11.02, 1.00 created (kp)
-
-
"