Re: Creating a pallette for a created layer

From: Don Dietrick <dietrick@bbn.com>
Date: Wed Aug 21 2002 - 10:45:51 EDT

Michael,

Your layer just has to override the getGUI() method and return the
java.awt.Component you want to be on the palette. The Layer class
returns null by default, so if you don't override this method, you get
the 'No Palette' palette. I usually keep all the code for the palette
within the layer, since the palette usually controls the layer
parameters. Layers that have other components that manage their data,
like the LocationLayer, can call some method on those components (I
usually call that method getGUI, too) to get their java.awt.Components
to use on the palette. Whatever works for you, since it's pretty
isolated to whatever your layer is doing in the first place.

Hope this helps,

Don

On Wednesday, August 21, 2002, at 09:46 AM, Mulvaney, Michael wrote:

> Hello fellow open-mappers,
> I have a created layer that currently displays up to 7 different
> "line-types" each distinguished by one of seven different colors.  On
> the layer tool, when I click the pallette button for this layer,
> obviously I get a "No Pallette" display.  I would like to know if
> anyone knows how to create a pallette for this layer with the
> following parameters:
>
> 1)Kinda like how the rpf coverage tool allows you to turn off
> different map sets, the pallette tool I want to create would allow you
> to turn on and off the individual line-types.  The reason for asking
> this, is that this would probably be more user-friendly than making
> each individual lines a separate layer.  For a bit of clarification,
> this is a layer where I have for example 20 lines of color 1, 50 lines
> of color 2, etc, and I'd like to be able to not show color 1, but do
> show color 2, or have both on or neither on.
>
> 2)If possible, I'd like to also give to user the ability to change the
> color of the lines and save the user's preference dynamically.  This
> is not too high a priority as the other ability is more important to
> the user.
>
> If anyone has some basic skeletons that I can use to create such a
> pallette, you help would be greatly appreciated.  I'm a bit of a
> novice at this open map stuff, so my only other question would be
> where to place this code for the pallette?  Should I put it in the
> same class as the rest of the infomation for the layer?  Or should it
> become a separate class called by the layer's class.  Again any
> feedback and information would be greatly appreciated.
>
> -Mike
>
>

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
10 Moulton Street, Cambridge, MA 02138
617-873-3031 [fax]-2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Wed Aug 21 10:47:16 2002

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