Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Events for SLD

James Macgill wrote:

now I would like to see rendering stay within GeoTools.  Jody's
earlier comment about me worring about the ShapeFile specific renderer
opps - sorry james.

Events are a cross cutting concern, so wrapping them over the top is
inapropriate, as it doing it through extention.  I have an urgent need
to add events to the Style objects but have held off as it is very
nasty (propogate events up though a very deep tree, which can wander
off into filters and expressions).
Really James? That is great news - we are currently replacing the entire tree each and everytime and relying on container notification to communicate that fact that something (somewhere) in there changed.

On the bright side I have a good idea now of how to handle that "propagate events up through a very deep tree" problem.

To solve this I was contemplating dynamic proxies or even aspects code
(behaviour injection in to the set methods) but I welcome an event's
discussion across the whole geotools board.  (aspects could give us
events for every set method everywhere btw)
We did consider aspects - however here is a more event based solution (from the UDig Catalog implementation).

Basically you have a single event type, and that event contains a "delta" describing what has changed. You can even block events and let the delta build up (so your events don't cause a cascade when modifying the model in several places) - this is most often seen when moving a rule up or down in a list for example.

And this time there is real documentation (rather then just javadocs):
- http://udig.refractions.net/confluence/display/DEV/Tracking+Changes

Oh why does this work? You listen for events in a central location (rather then on all the different leaves at the edge of your very deep tree).

The canvas is the view and the control in this case, and it controls
several models.  e.g. a layer model, a selection model an AOI model.
I obviously need a new term here, //Jesse has an interface:
- http://udig.refractions.net/nightly/udig/latest/docs/javadoc/net/refractions/udig/ui/graphics/ViewportGraphics.html

This interface allows renderer to be written against either toolkit (and hopefully Draw2D or OpenGL as well). Two implementations one for SWT and one for AWT are used by udig. This is a very simple interface suited on for the portrayal of Features and Rasters - is pure view.

James for your definition of a Canvas that controls models - are you thinking along the lines of: - http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/feature/display/canvas/FeatureCanvas.html

In uDig we have several things that can control the Map/Layer model, but they are all equal: Map Editor, Layer View and Projects View. Indeed for printing the entire model is repurposed to a different end.

We should probably put off some of this discussion until Jesse can be involved.
Jody


Back to the top