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 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:
- Have a "menu" package in your devXXX folder under devContrib
- The menu package should containt
PgElementSet_Menu
and PgPolygonSet_Menu
, depending on what kind of geometry your workshop acts on.
- In your JavaView run configuration make sure that ...
-
devContrib
is added to your classpath
- you run
javaview
with program argument archive.dev=show
- In the JavaView application go to
Help->Preferences
and enter "devXXX.menu" in the Menu
textfield