Perforce JViews Maps Sample: Extending the Map Builder
Description
This sample shows how to build a simple application by adding and removing GUI elements to or from the Map Builder.
How to Use the Sample
-
This demonstration reuses the Map Builder code, but changes certain of its elements. For example it:
- Hides some menu buttons.
- Hides the Options menu.
- Adds a specific More menu with one fake My Action... entry.
- Listens for mouse clicks in a view in order to display a dialog.
- Removes some toolbar buttons.
- Adds a shortcut menu button.
- Removes some status bar components.
- Customizes the coordinate viewer and the graphic scale and moves them to the toolbar.
- Customizes the bottom left tabbed pane.
- Changes the view background.
- Changes the layer tree menus.
- Creates a new custom view for display in the right hand pane.
- Removes some import formats.
- Adds its own fake import format to the list that create a single text in the center of the view.
- Changes the initial map loaded at start time.
- Changes the label factory to show both the selected labelling attribute and the population.
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
mbextend.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Loading prebuilt map.
- Using JViews Maps Beans.
Detailed Description
This sample shows how to build a simple application by adding and removing GUI elements to or from the Map Builder.
Note: This data source is available on the installation DVD for JViews Maps. For more information see The Maps Data Disk in Programming with JViews Maps.
Installation Directory
The Extending the Map Builder sample is installed here.