OpenMap 4.4.1 has been released!
We've released version 4.4.1 of OpenMap(tm) at
OpenMap is open source software. New for this release:
-----------------------------------------------
* PropertyConsumer handling has been very significantly improved,
thanks to a code submission from Bernhard Reiter and Kai Lessmann.
First, there is a new package, called
com.bbn.openmap.util.propertyEditor. It contains generic
PropertyEditor classes, and an Inspector class that uses the
PropertyConsumer's methods to provide an interface to set and
modify properties.
You can run the Inspector as an application on any
PropertyConsumer class to test out what that interface looks like,
and to see if there are any problems loading the Inspector with
the contents of the PropertyConsumer's properties.
The Inspector exects that the properties returned in the
PropertyConsumer.getProperties() method will be scoped, i.e. that
if a property prefix is used, the properties will also have that
prefix in front of the properties.
The Inspector uses the PropertyConsumer.getPropertyInfo() method
of classes to get information about the properties being
displayed. The Inspector does not expect that the properties
returned in this method will be scoped - Just the base properties
should be returned as keys, with their values being a short
explaination for what the property represents. This explaination
is used as a tool tip in the interface. Also in this method,
properties can be set with the key having a '.editor' suffix, with
the value of the property being the fully qualified class name of
the PropertyEditor to use to adjust that property.
So, while a class might return a (prefix.lineColor, AARRGGBB)
property from the getProperties method, it would return a
(lineColor, "Color used for lines") property and a (lineColor.editor,
"com.bbn.openmap.util.propertyEditor.ColorPropertyEditor")
property in the getPropertyInfo() method to use to adjust the
fillColor property.
The PropertyConsumer now has a EditorProperty string 'editor' and
a ScopedEditorProperty string '.editor' which makes it easier to
define PropertyEditor properties on the fly.
The submission also includes a com.bbn.openmap.gui.LayerAddPanel,
which can be brought up by the LayersMenu, or the LayersPanel. It
uses a property called openmap.addable to set a list of Layer and
PlugIn classes that can be created at runtime, and configured
using the Inspector. Each unique marker name (separate from the
marker names used in the openmap.layers list) needs to have a
.class property defined for it (what to instantiate), and a
.prettyName property (a generic GUI name for the layer). The
LayerAddPanel provides a place to actually name specific layer
instatiations, and the prefix for those layers are automatically
generated (see PropertyHandler changes).
One more note on this - You'll notice that we've changed the property definitions
so that they *DON'T* include a scoping period
at the front of them. The PropertyConsumer interface has a
setProperties(Properties) method, so the PropertyConsumer can be
configured without a property prefix.
This really applies to developers that configure their layers
programmically. If you define a Properties object that is only
used by one Layer (or other PropertyConsumer type) you don't have
to scope the properties. i.e.
ShapeLayer shapelayer = new ShapeLayer();
Properties shapeprops = new Properties();
shapeprops.put("shapeFile", shapefilepath);
shapeprops.put("lineColor", shapefilepath);
// or
// shapeprops.put(ShapeLayer.shapeFileProperty, shapefilepath);
// shapeprops.put(ShapeLayer.lineColorProperty, shapefilepath);
shapelayer.setProperties(shapeprops);
You could do this:
ShapeLayer shapelayer = new ShapeLayer();
Properties shapeprops = new Properties();
String shapeprefix = "uniqueshape";
shapeprops.put(shapeprefix + ".shapeFile", shapefilepath);
shapeprops.put(shapeprefix + ".lineColor", shapefilepath);
// or
// shapeprops.put(shapeprefix + "." + ShapeLayer.shapeFileProperty,
shapefilepath);
// shapeprops.put(shapeprefix + "." + ShapeLayer.lineColorProperty,
shapefilepath);
shapelayer.setProperties(shapeprefix, shapeprops);
But you don't have to if the shape layer is the only layer using
the Properties object.
But, if you use the Properties object for all of your properties
definitions, then you have to use the prefix to ensure that the
layer picks up the properties meant for it.
-----------------------------------------------
* The PropUtils had methods added that are really helpful to use
for the PropertyConsumer methods.
String prefix = PropUtils.getScopedPropertyPrefix(PropertyConsumer ps);
String prefix = PropUtils.getScopedPropertyPrefix(String prefix);
Either return an empty string ("") for null prefixes, or the
prefix with a period attached. Either way, the properties in
getProperties can be defined by calling the method above, and
simply putting it in front of the property name.
-----------------------------------------------
* The PropertyHandler has been updated to keep track of
usedPrefixes, and can test and modify suggestions for new prefixes
if asked. The LayerAddPanel uses this when new layers are created
at runtime.
The PropertyHandler has also been modified to take a PrintStream
and the MapHandler, and create a openmap.properties file. It can
also read in a openmap.properties file at runtime (which is
essentially loading a new map). The application components are
not affected by the contents of a newer openmap.components
property in the new file. Just the layer properties are used, and
the projection settings.
When a new openmap.properties file is created, the
openmap.components property that was set in the lauched properties
file is reused. New components that may have been added at
runtime have not been added. This is a temporary workaround to
the problem that occurs when pulling objects out of the MapHandler
- they do not come out in any specific order, which really affects
the look of any application that may try to load components with
that order. That's also why the application ignores the
openmap.components property of any openmap.properties file loaded
later.
The FileMenu was modified to have 'Load Map...' and 'Save Map...'
options, using the SavePropertiesMenuItem.
-----------------------------------------------
* Modified for PropertyConsumer compliance. These are layers ready to
be created at runtime:
- DrawingAttributes.java (just so you know for your layers)
- EarthquakeLayer.java GraticuleLayer.java (also uses Inspector for
runtime modifications via palette)
- com.bbn.openmap.layer.location
- com.bbn.openmap.layer.rpf
- com.bbn.openmap.layer.shape
The areas package has not been updated for PropertyConsumer
methods yet. However, the AreaHandler was reworked to provide
better access and control over the area definitions.
-----------------------------------------------
* The PlugInLayer and PlugIn were updated to use the
PropertyConsumer interface, and they resolve between themselves
how to handle properties in the different situations where the
PlugInLayer was created and defined the PlugIn, or when the PlugIn
was created and the LayerAddPanel or LayerHandler created the
PlugInLayer for it.
This makes a difference on how properties are represented in
openmap.properties files saved by the application.
The WebImagePlugIn abstract class was created, which defines code
shared by the shis and wms plugin pacakges. This code really
affects the PropertyHandling, and the palettes, which take
advantage of the Inspector to allow modification of their
parameters at runtime. There is also a palette option to see what
the query to the web server looks like before it is actually sent.
-----------------------------------------------
* The Layer class has been updated so that it contains the handle
to its palette, instead of having the LayerPane manage
it. Layer.showPalette() and Layer.hidePalette() methods have been
added, and the gui components have been modified as well.
ComponentListeners to the Layer will receive events about the
palette, too, telling them when the palette has been activated or
hidden.
The Layer is now an ActionListener in order to receive commands to
show and hide its palette. It also can receive commands
(Layer.DisplayPropertiesCmd) to bring up the Inspector, which uses
the PropertyConsumer interface to set the layer's properties.
The Layer.RedrawCmd has been defined, too, but individual layers
have to code how to specifically react to it.
The Layer has a new property, autoPalette, which can be used to
tell if the palette for a layer should be turned on by default.
The MapBean has a new method, MapBean.showLayerPalettes(), that
calls Layer.showPalette() on all layers with this property set to
true. MapBean.hideLayerPalettes() turns them all off.
The OpenMap application now calls this new MapBean method at
startup. The result - you can have certain layer palettes come up
automatically at application startup by setting a layer property.
The Layer had a findAndInit(Object) method added, which is called
by findAndInit(Iterator) when objects are added to the MapHandler.
See comments on changes to MapHandlerChild on why this is good.
Property handling in general for layers is improving. With the
addition of the Inspector, you should make sure that all the
PropertyConsumer methods in your layers are implemented, and that
calling setProperties() in your layer reconfigures it if needed. Not
all of the OpenMap layers have been modified yet to act properly in
this way, but many have.
-----------------------------------------------
* The LayerHandler was updated to be able to create PlugIn
directly from the openmap.layers property list. If the
LayerHandler finds a PlugIn, it will automatically create a
PlugInLayer for it and hook it up to the PlugIn. Likewise, the
properties for the PlugIn can be scoped in the properties file
exactly like a layer:
plugin_markername.class=com.bbn.openmap.plugin.PlugIn
plugin_markername.prettyName=Example
plugin_markername.<whatever>=
The former way to add PlugIns, within a PlugInLayer defined in the
openmap.layers list, still works as before.
-----------------------------------------------
* The MapBean has been altered to provide an option to release
Layers that have been removed from it right away. Previously, the
MapBean actually held on to layers that were removed, in case they
were added again without the projection changing. This prevented
the layer from doing unnecessary work just by being toggled on and
off the map, but we got requests to make this an option.
-----------------------------------------------
* Added a method to the MapHandler (BeanContext) called get(String
classname), that looks at its contents and returns an object of
that type. Handy for getting the MapBean, LayerHandler, etc. or
any SoloMapComponent from the MapHandler when it's actually
needed, without maintaining a constant handle to it. Kinda handy
for finding the first one of objects that may have sibling types,
but not so much.
-----------------------------------------------
* MapHandlerChild class has the findAndInit(Object) and
findAndUndo(Object) method added. This lets you override the
findAndInit(Object) method in MapHandlerChild subclasses, and be
able to provide the super class with objects from the MapHandler,
too. Previously, this was not possible because using the iterator
clears it and it couldn't be used in different places. Likewise,
the findAndUndo(Object) method was added for objects being removed
from the MapHandler.
-----------------------------------------------
* The OMCircle was modified to handle rotation! The rotation
angle, in radians, can defined with setRotationAngle(double), with
zero being due West. Positive and negative values can be used.
The EditableOMGraphic doesn't really handle the rotation angle
completely. You can't modify the angle at all, and the grab
points for the OMCircle actually show up where they would be with
a rotation angle of zero. But, adjusting the position of the grab
points does modify the dimensions of the rotated OMCircle, and you
can move it around. The EditableOMGraphic has commented-out code
to render the points properly, but the MouseEvent locations have
to be translated in order for them to be effective. Releasing
this class as it is was the lessor evil of the alternatives.
--- This part is important!! ---
The rotation was accomplished by changing the internal
representation of the OMCircle to be based on java.awt.Shape
objects, and then using AffineTransforms on the shape during
generation. This actually made the render and distance methods
become very generic, not relying on rendertype or what kind of
shape was being rendered. This will be a change that all
OMGraphics will be headed toward very soon.
Also, the OMCircle has a new Shape[] getShapes() method, which
lets you get the generated shape objects and then use them for
some spatial analysis operations that the java.awt.Shape interface
provides. This is really powerful, and look for this to become
part of the generic OMGraphic API. This method returns an array
of shapes because in some small world situations (really zoomed
out) there are multiple Shape objects that are used to represent
the graphic wrapping around the other side of the earth.
-----------------------------------------------
* Added the GoToMenu, which lets you saved named Projections,
consisting of projection type, center location and scale. You can
add to the list dynamically, and the locations get saved to the
openmap.properties file when a map is saved. You can also add
locations by modifying the properties for the GoToMenu class.
-----------------------------------------------
* Added the Esri plugin package, submitted by Doug Van Auken.
This package includes and EsriLayer and EsriPlugIn, and has
support for reading and writing shape files (shp) and their
supporting files (shx and dbf). The EsriPlugIn was added to take
advantage of the SwingWorker in PlugInLayer, and also has code
that displays the contents of the dbf attribute file in the layer
palette, and will highlight graphics on the map corresponding to
any selections in the table. Likewise, and graphics on the map
selected (in Gestures mouse mode) will hightlight entries in the
table.
There will be more improvements coming to the package soon. Among
them, support for sorting the table, use of the BinaryBufferedFile
for buffered input, and increased support for distinctive coloring
for individual graphic.
The package also contains a sample applet and application to
demonstrate how to use the different capabilities of the
components.
-NOTE- There are a couple of problems in this package, which I
(dietrick) introduced by making some changes. These will be resolved
shortly with an update release.
-----------------------------------------------
Misc:
* OMGraphic has the getColor methods undeprecated. If the Paint
objects used are not Color objects, null is returned. This was
done to save casting trouble.
* OMText was updated to paint the boundary rectangle correctly.
* The DistanceMouseMode was modified to be a PropertyConsumer, and
it's parameters can be set in the openmap.properties file for
customized configuration - units, etc.
* The ControlMenu was modified to let you toggle the ToolPanel on
and off.
* Bill Huff submitted several memory cleanups in LayerPane and
LayersPanel, to help with GC'ing layers that were removed from the
application.
* The NavigatePanel was updated to provide methods to set the
coordinates the map goes to when the center button of the rosette
is pressed. By default, it still goes to the starting
coordinates.
* The OMToolSet has properties that can be used to set which
components are visible on the ToolPanel - the NavigatePanel,
ZoomPanel and ScalePanel are optional, but on by default.
* The ImageServer now has a main method that lets you pass it an
openmap.properties file, and it kicks out an image file. You need
to have a couple of extra properties defined, like what formatter
to use, in the properties file.
* DMSLatLonPoint longitude wrapping bug fixed.
* The status lights of the InformationDelegator where made to be
buttons that bring up the palette of the corresponding layer's
palette.
* The TerrainLayer's LOSGenerator algorithm was improved via a
submission from Mark Wigmore.
See http://openmap.bbn.com/com/bbn/openmap/ChangeLog for a list of
changes.
OpenMap is a JavaBeans-based toolkit for building applications and
applets
needing geographic information. Using OpenMap components, you can access
data from legacy applications, in-place, in a distributed setting. At
its
core, OpenMap is a set of Swing components that understand geographic
coordinates. These components help you show map data and help you handle
user input events to manipulate that data.
OpenMap is a trademark of BBNT Solutions LLC (a part of Verizon).
-----
See http://openmap.bbn.com for OpenMap(tm) info.
Use openmap@spam_me_not.bbn.com for OpenMap qestions.
Remove the "spam_me_not." part first!
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Mon Nov 5 13:27:15 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT