JavaView© v3.95.000

jv.project
Class PgGeometry_Menu

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended byjv.objectGui.PsMethodMenu
                  extended byjv.project.PgGeometry_Menu
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, java.util.Collection, java.util.EventListener, java.awt.event.ItemListener, java.util.List, PsUpdateIf, java.util.RandomAccess, java.io.Serializable
Direct Known Subclasses:
PgPointSet_Menu, PgPointSet_Menu

public class PgGeometry_Menu
extends PsMethodMenu
implements PsUpdateIf

Add specific menu items to 'method' menu in control panel to invoke methods from menu. For example, each geometry may have a menu class derived 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".
 

See Also:
PsMethodMenu, Serialized Form

Field Summary
 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 Summary
PgGeometry_Menu()
           
 
Method Summary
 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.
 
Methods inherited from class jv.objectGui.PsMethodMenu
actionPerformed, addMenu, addMenu, addMenuItem, addMenuItem, addMenuItem, clone, getFather, getLanguage, getMenu, getMenuItem, getName, 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, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jv.object.PsUpdateIf
getFather, getName, setParent
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

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
Constructor Detail

PgGeometry_Menu

public PgGeometry_Menu()
Method Detail

init

public void init(PsObject anObject)
Description copied from class: PsMethodMenu
Register the target geometry, and subclasses should register all menu items and submenus.

Overrides:
init in class PsMethodMenu
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:
update in interface PsUpdateIf
Overrides:
update in class PsMethodMenu
See Also:
PsMethodMenu.setParent(PsUpdateIf), PsMethodMenu.getFather()

applyMethod

public boolean applyMethod(java.lang.String aMethod)
Description copied from class: PsMethodMenu
Invoke action determined by current string. This method returns false, and should be overwritten by subclasses.

Overrides:
applyMethod in class PsMethodMenu

getViewer

public PvViewerIf getViewer()
Get viewer which enables access to displays and inspectors.

Since:
JavaView 2.45
See Also:
setViewer(PvViewerIf)

setViewer

public void setViewer(PvViewerIf viewer)
Set viewer enable access to displays and inspectors.

Since:
JavaView 2.45
See Also:
getViewer()

JavaView© v3.95.000

The software JavaView© is copyright protected. All Rights Reserved.