| DemoBase is the primary class of the three Demo* classes which combine into a
demonstration application that introduces each of the major modules of the
Geotools library. DemoBase creates an instance of each class and provides the
methods which will control almost all of the action in the demonstration.
WARNING: This is a work in progress and is incomplete.
The Demo* classes are organized into a [data model / view / controller] split
common to modern applications.
Control starts in the 'main' method of this DemoBase class and immediately
passses to the DemoGUI instance which is created. In the GUI, interactive
control by the user is limited to the 'Quit' button and one other button.
Each button, when pressed, returns the control to the 'button*' methods in
the demoBase instance of this class. These 'button*' methods then call the
remaining methods in the class. Readers can therefore follow the action of
the demonstration application simply by reading in turn each of the methods
below which follow the 'button*' methods.
The View is managed by demoGUI, an instance of the DemoGUI class, which
creates the window of the
demonstration application. Later on, the instance also creates the JMapPane
in which the map will be rendered. The instance therefore holds on to the
Renderer and the MapContext instances which determine the contents which
will actually be rendered and the details of the rendering such as the
styling and projection information.
The data model is managed by demoData, an instance of the DemoData class,
which holds all the Feature data (the geospatial data maintained by the
application).
The demoData instance holds several List objects which show how an
application can manage data access itself.
The instance also holds a single Catalog object which shows how an
application can use the Geotools library Catalog system to manage data
This tutorial shows the following elements:
(1) FeatureSource creation:
This creates, through several approaches, the handles which are
used later for the manipulation of data.
1.1 - a feature source from scratch
1.2 - a feature source from a shapefile
1.3 - a feature source from a WMS/WFS (an image)
(.) Catalog creation:
This creates a resource through which to handle all the features
used by a complex application.
(.) Coordinate Transform creation:
This creates a coordinate operation and uses that to transform the
data in a feature source to a different Coordinate Referencing
System.
(.) Query creation:
This creates a Filter/Expression to query a feature for its
contents and thereby to subset a feature.
...
(5) Style creation:
This creates the graphical elements which are used to display
the data.
(6) Display:
This creates a GUI MapViewerto display the data.
(7) Image output:
This renders an image to an image buffer and then dumps the image
buffer to a file.
...
HISTORY:
This class regroups work from many different tutorials.
Section 1.1 - "Feature from scratch" was inspired by earlier tutorials.
Section 1.2 - "Feature from shapefile" was in Ian's MapViewer class.
Section 5 - The style demo came from an email by Tom Howe on user-list.
Section 6 - The GUI was inspired by Ian Turton's MapViewer demo.
Section 7 - MakeImage with email advice from David Adler, Aaron B. Parks.
author: Adrian Custer, gnuGIS author: Justin Deoliveira, The Open Planning Project version: 0.03 since: 2.3-M0 |