Re: [OpenMap Users] Problem with printLayerProperties when switching to 4.6.4

From: Frédéric Delanoy <frederic.delanoy_at_gmail.com>
Date: Thu, 19 Jun 2008 12:00:04 +0200

Hi Don.

Sorry if I've been confusing.

I'm effectively talking about the fillColor property of a layer loaded from
an ESRI Shapefile (version 1000, type Polygon if that can help) through the
layersPanel interface:
- Display tools for "foo" layer
- click on the "-" button [Modify Drawing Parameters]
- click on Color -> Change Fill Color
- select some other color, then "Redraw Layer"

-> the layers' fill color display effectively changes

[ The layers panel was created like this: LayersPanel layersPanel = new
LayersPanel(layerHandler); ]

Now, I use some GUI widget that eventually calls the following code (without
changing any map component) :

 Properties getCurrentViewProperties(LayerHandler layerHandler, MapBean
mapBean) {
       Properties props = new Properties();
       printLayerProperties(layerHandler, this, null, props);
       < use props, get rid of not-to-be-saved properties, and save the new
values somewhere >
}

 [ Note the "printLayerProperties" method is *not* overriden]

Now while debugging I put a breakpoint at startup of the function and
examined
   layerHandler > allLayers > ShapeLayer (foo) > drawingAttributes >
fillPaint
-> the value is the new updated Color

However, after the call to "printLayerProperties", I check the value of
props.get("foo.fillColor") and I get the old value.

Oddly enough this worked (the Properties contains the new value) until
v4.6.3 but failed when I tried to upgrade to v4.6.4 (and 4.6.5beta).

Hope I've been clearer, and thanks again for your kind help.

Frédéric

On Thu, Jun 19, 2008 at 3:51 AM, Don Dietrick <dietrick_at_bbn.com> wrote:

> Hi Frédéric,
>
> Can you clarify what you mean when you san the layerHandler contains the
> updated value, but the props contain the old value? Specifically, the value
> of what? Are you referring to the changed fill color property? If so, isn't
> that property being retrieved from the layer before being written out?
>
> - Don
>
>
> Frédéric Delanoy wrote:
>
>> Hi,
>>
>> I'm using a LayersPanel and the user can change, for instance, fill color
>> from layers loaded from a binary .shp file.
>>
>> I've a custom PropertyHandler that basically removes properties from
>> dynamically generated layers so they aren't saved on exit.
>>
>> at some point, I have the current code:
>>
>> Properties getCurrentViewProperties(LayerHandler layerHandler, MapBean
>> mapBean) {
>> Properties props = new Properties();
>> printLayerProperties(layerHandler, this, null, props);
>> <...>
>> }
>>
>> This code works nice for openmap 4.6.2 and 4.6.3. <http://4.6.3.>
>> However, when switching to 4.6.4 (same problem with 4.6.5 beta), it
>> stopped working.
>>
>> The sequence was so
>> - load the map
>> - change the fillColor of a .shp file through the LayersPanel
>> - exit the app, and the previous function is called.
>>
>> When debugging, it seems the layerHandler contains the new updated value,
>> but props still contains the old value.
>>
>> Could anyone please help ?
>>
>> Thanks in advance.
>>
>> Frédéric
>>
>


--
[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 Thu Jun 19 2008 - 06:01:24 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT