You are here: AGGeom » JavaView » JVMenuItems

JVMenuItems

This page describes how to introduce a menu item into JavaView.

A Tutorial Project

Update your JavaView and JavaViewDev SVN. You find a project at JavaViewDev/DevelopContrib/src/devTutor/ with a corresponding launch configuration at _eclipse/launch/DevTutor-Menu.launch. Here you need to have made eclipse aware of the launch configurations, but that should have been setup during the installation of JavaView. When running the launch configuration, you see the JavaView default geometry and in the menu Method you see a new entry at the bottom: devTutorMenu → Evolve which allows you to evolve the surface in normal direction.

One way of using this to introduce menu items is to replace the PwEvolve workshop with your own workshop. Therefore you have to assure that eclipse finds your workshop.

Loading a resource file

The above described launch configuration load the resource file srcBase/rsrc/jv-rsrcDevTutorMenu.jvr which specifies the location of the menu file in section
<preferences version="alpha">
   <directory type="menu">devTutor.geom</directory>
</preferences>
Watch JavaView → menu Help → menu Preferences where the menu directory should be listed. It is encouraged to add the menu location to your own rsrc configuration file.

Note: The DevelopContrib project, respectively the project containing the package which has the menu file needs to be in the classpath of the run config, otherwise introducing the menu location does not enable JV to find it.

To load your menu preferences in your launch configuration "DevContrib-Tutor_Pa..." add in srcBase/rsrc/jv-rsrc.jvr
<preferences>
   <directory type="menu">devTutor.menu</directory>
</preferences>

Workshops as Menu Entries

Workshops can be added to the JavaView method menu and thus be interactively called by a user of the JavaView application. To add your workshop as a menu entry do the following steps:

  1. Have a "menu" package in your devXXX folder under devContrib
  2. The menu package should containt PgElementSet_Menu and PgPolygonSet_Menu, depending on what kind of geometry your workshop acts on.
  3. In your JavaView run configuration make sure that …
    • devContrib is added to your classpath
    • you run javaview with program argument archive.dev=show
  4. In the JavaView application go to Help→Preferences and enter "devXXX.menu" in the Menu textfield

Comments

 
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback