Classification: UNCLASSIFIED
Hello,
Has anybody run into difficulty using setAttribute or getAttribute?
I can get an OMGraphic object to store attributes if I say
<code>
...
omg.setAttributes( new HashMap() ); // line 10
omg.putAttribute(SOME_KEY, someData );
omg.putAttribute(ANOTHER_KEY, someOtherData );
// then later in the code
System.out.println( "SOME_KEY =>" +omg.getAttribute(SOME_KEY) ); //ok
//does NOT print null because line 10
System.out.println( omg.getAttribute(ANOTHER_KEY) );
OMPoint omPt = new OMPoint();
// everything works so far
// now I want to replace omg with omPt
// I need to swap app attributes.
// THIS BREAKS
omPt.setAttributes( omg.getAttributes() ); //line 468
</code>
Here's the Exception:
<dump>
java.lang.NullPointerException
at java.util.Hashtable.put(Unknown Source)
at
com.bbn.openmap.omGraphics.geom.BasicGeometry.setAttributes(BasicGeometry.ja
va:407)
at com.bbn.openmap.layer.UnitsLayer.replaceOMGraphic(MyLayer.java:468)
</dump>
Debug print of omg.getAttributes() showing key => value pairs :
the Map size=4
2 => someData
app_object_key => {app_object_key=null}
1 => someOtherDate
att_map_key => {2=someData, app_object_key={app_object_key=null},
1=someOtherData, att_map_key=(this Map)}
Any Ideas?
-----Original Message-----
From: owner-openmap-users_at_bbn.com [mailto:owner-openmap-users_at_bbn.com]On
Behalf Of Tobias Gorgs
Sent: Saturday, April 02, 2005 3:19 AM
To: openmap-users_at_bbn.com
Subject: [OpenMap Users] DTED
Hi,
I have two questions about DTEDLayers.
1) How is it possible to change the Opaqueness of a DTEDLayer?
This is how I tried it:
dtedLayer.setOpaqueness(135);
dtedLayer.doPrepare();
This lines of code should be processed, when a special button of my user
interface is pressed. If I ask for the new opaqueness
(getOpaqueness()) the value is 135. But nothing happens. The DTEDLayer
is already added to the MapHandler. If I let OpenMap show the palette to
change DTED-Properties it works. Any ideas?
2) Is it possible to remove a DTEDLayer from the MapHandler and later add it
again? I want to show DTED Level 0 until a defined scale-level is reached
and then show DTED Level 1. To save memory I thought I remove DTED Level 1
until the application has the defined scale and then add it. Is this the
right idea?
I already tried with:
mapHandler.remove(dtedLayer);
mapHandler.add(dtedLayer);
The boolean which is returned is true for both lines of code. After the
layer was removed it isn`t shown at the map anymore. This is great, but
after I added the layer - it doesn`t appear on my map either. Can anyone
help me with this topic?
Thanks a lot.
Tobi
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Apr 04 2005 - 13:32:05 EDT