|
Deliver On-the-Fly Mapping Services to Your Rich Desktop Java Application, Part 3
by Dan Andrews
Part 1 of this series examined how a client application requests individual tiles from a tile server. Part 2 demonstrated how to develop an XML configuration to generate a tile URL dynamically. The main advantage of using an XML configuration for tile URL generation is the ability this provides to update or plugin new configurations without recompiling Java code.
In the final part of this series, you'll see how to build a rich client Java mapping application that will make use of the XML configuration developed previously. The complete code for Part 3 will be available at the end of this article as an Eclipse project. Let's begin by describing the package structure for the application.
Package Structure
In Part 2, the code for parsing the XML configuration, including the helloworld.xml file, resided in the ca.ansir.swingx.maps.xml package. The package immediately above, ca.ansir.swingx.maps, was used for the GeoBounds class. Now, you'll add four more packages to build the application. One of these packages will be for the rich client application and three will be used for supporting infrastructure classes only. An outline of the package structure is shown below:
-
ca.ansir.app: This is the rich client application package.
-
ca.ansir.jnlp: This supports the infrastructure for launching a URL.
-
ca.ansir.swing: This supports the infrastructure and utilities for building Swing applications.
-
ca.ansir.swing.worker: This supports the infrastructure for downloading a URL.
-
ca.swingx.maps: This enhances the wrapping of the SwingX-WS project's map viewer.
-
ca.swingx.maps.xml: This is code from Part 2 that parses the XML configuration.
Any packages which provide supporting infrastructure for the application are not specific to the application, and, therefore, will not be discussed.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|