[OpenMap Users] Re: Graphic elements not displaying

From: Don Dietrick <dietrick@bbn.com>
Date: Tue Jan 13 2004 - 18:34:52 EST

Hi Charles,

On Jan 12, 2004, at 5:43 PM, charles.nagy@dmr.com.au wrote:

> Hi,
>
> I am attempting to integrate the OpenMap classes into a Train
> Management
> System that we maintain. Generally integrating the functionality
> into an
> existing application has not proved too difficult, however I have
> struck a
> problem that I hope you can help me with.
>
> Firstly the application development environment is JDK1.3.03 and I am
> using
> OpenMap4.5.4 A point to note is that the application is based on AWT.
> So
> because of compatibility issues so I am forced to place the
> bufferedmapbean
> into a Panel which in turn is placed into a Frame.

That's OK. Swing components can be embedded in awt components.

> All seems to work fine except when I generate a new layer
> programmatically. I am finding that if I add the layer as part of the
> panel
> constructor it appears in the map. However when I add the same layer
> outside of the panel constructor all appears normal except that it
> does not
> display. I have noticed that when I undock the toolbar a repaint of
> the
> map occurs and the graphics that was previously not visible suddenly
> appears.

Look at com.bbn.openmap.examples.simple.SimpleMap2 on how the
MapHandler is used as a connecting device between OpenMap components.
You can then just add the MapBean/LayerHandler/Layers/OMToolSet to the
MapHandler to have everything connected from a listener/event point of
view. Then, you can lay out the components in your Frame the way you
want.

Your refreshMap() method creates a new RouteLayer and adds it to the
map. Are you sure you want to do that?

- Don

>
> Obviously I am missing something but cannot see what! Do you have any
> ideas.
>
> I am attaching some test code that exhibits the problem. The class
> tmatdsbl calls a cut down version of the RouteLayer class that is
> shipped
> with the crew example
>
> (See attached file: RouteLayer.java)(See attached file: tmatdsbl.java)
>
> I look forward to any suggestions
>
> Many thanks
> Charles Nagy
>
> <RouteLayer.java><tmatdsbl.java>

--
[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 Tue Jan 13 18:36:32 2004

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