[udig-devel] Faster styling

Ugo Taddei ugo.taddei at iais.fraunhofer.de
Tue Mar 11 11:29:05 PDT 2008


Hi,

Jody Garnett said:
> Ugo Taddei wrote:
>> Hello,
>>
>> I've written a widget for the user to interactively change the style of
>> a vector layer.
>>
...
>>
> Sounds fun! You will find some of the earlier style configuration pages
> worked in a similar manner; at
> the time rendering was so slow we placed "Apply" and "Cancel" buttons
> into the mix. I am looking forward
> to experimenting with your widget.
>> So far I'm happy with the responsiveness. (I probably could optmize here
>> and there, but I still need to understand udig - will I ever? - and how
>> eclipse works.)
>>
> I really should do a breakout IRC session with people that are learning;
> there are really only two ideas
> I expect would be new to people (#1 Blackboard #2 IAdaptable). There are
> some interesting uses of
> eclipse technologies (like EMF) but you can sneak up on those as you
> need them.
>> Anyway, I doubt the response would be fast enough, if style creation and
>> setting were on mouse dragging, rather than on mouse up.
>>
>> So I had a look at the javadocs, the mailing list and the code, and I'm
>> still trying to figure out how to get hold of a MapGraphicContext (or
>> the like), in order to draw directly onto the awt image.
>>
> So far only two and a half things can draw onto the map:
> - #1 a tool; it actually does so by scheduling a command that is drawn
> each time the screen is refreshed
> - #2 a renderer; draws whenever the viewport model changes (or if the
> data itself changes)
> - #2.5 mapgraphic - actually this is just a renderer that happens to not
> have any data to listen to
>> Or perhaps a custom renderer is the way to go? (As I read from some
>> posting.) If so, how do I roll my own and set it? Anyone with hints,
>> snippets or pointers?
>>
> There is a tutorial (from the commercial training course) you can
> review; on all three method listed above.

Oops! I forgot about the tutorials. I was looking at the snippet/examples
only.

>> To finish off, a quick question: if I have a layer (and changed its
>> style), how do I request a refresh?
>>
> I would place the new style on the style blackboard and let the layer
> figure it out.
> Jody


Well, I did place it on the blackboard, but never saw an update. So I
forced one.

Cheers,

Ugo




More information about the udig-devel mailing list