Re: [OpenMap Users] Layer vs. Plugin?

From: Don Dietrick <dietrick@bbn.com>
Date: Fri May 14 2004 - 21:36:55 EDT

Hi Michael,

This is actually a very good question.

On May 14, 2004, at 4:24 PM, MNewcomb@tacintel.com wrote:

> UTMGridPlugin vs. GraticuleLayer
>
> Why was one built as a plugin and the other as a layer?

The GraticuleLayer was one of the first layers ever written, before
plugins were conceived. Plugins were invented to abstract some of the
data access and OMGraphic creation away from layer management, so that
the OMGraphics could be created in an object that could be used in a
client or a server.

The addition of OMGraphicHandlerLayer in 4.6 has made it pretty easy to
create a Layer, even easier than a PlugIn.

> Can you give me some differences between the two?

A Layer is a Swing component. A PlugIn is an OMGraphic factory that
can be used by a Layer.

> When should I use Plugin/Layer?

You should use a PlugIn if you think you may want to reuse the
OMGraphic creation code in a server. Although I should point out there
isn't any PlugIn server code, nor a client that could talk to one.

I almost always write layers now that inherit from
OMGraphicHandlerLayer. I put any code used to get to a data source to
create OMGraphics in the com.bbn.openmap.dataAccess package tree, and
then have a simple OMGraphicHandlerLayer use those components. The
OMGraphicHandlerLayer
has a bunch of new MouseEvent handling code in it that makes it really
easy to react to mouse events in a common way, and that hasn't been
translated into PlugIn yet.

Hope this helps,

Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Fri May 14 21:37:53 2004

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT