I was able to look at the source code for the
RenderingManager.createRenderer() method today at lunch. I found the
answer to the earlier question, and inadvertently or accidentally
answered another question I had about JUMP's rendering system. I'm
posting my discovery for others benefits, and will also get this
information on the JPP wiki.

The RenderingManager class in JUMP and OpenJUMP declares to
OrderedMaps as private member variables. (java.util.OrderedMap) One is
named contentIDToHighRendererFactoryMap and the other is
contentIDToLowRendererFactoryMap.

I was curious about the purpose of these member variables when I
noticed they were called in the createRenderer() method of the
RenderingManager class. I found a clue to their purpose in the
putAboveLayerables() method and putBelowLayerables() method, which are
also in the RenderingManager class. These two methods accept objects
that create Renderers for JUMP and stores them in the two OrderedMaps
mentioned above.

When a call is made to the renderAll() method or the copyTo() method
of the RenderingManager class the contentIDs() method is called. (I
think this method name should be changed to something like
"getContentIDs()".)

The contentIDs() method returns a List of objects that need to be
rendered by JUMP/OpenJUMP. This list is returned in the order the
objects need to be painted in. In other words, the objects that need
to be painted first, or underneath the other objects are in the top of
the List, and the objects that need to be painted last, or on top of
everything else are in the bottom of this list. This List really
controls the order of rendering or painting in OpenJUMP.

This List is constructed in the contentIDs() method. That means this
method really contains the logic that determines the order in which
items are rendered by JUMP/OpenJUMP. This all ties into the two
OrderedMaps mentioned earlier. The items in the
contentIDToLowRendererFactoryMap are placed on the top of the List
returned by the contentIDs() method. (This is what we want, because
those items get painted first or on the "bottom" of everything else.)
The contentIDs() method then uses the order of the Layer objects in
the LayerViewPanel to place Layer objects in the List. (This means
that theLayerManager tracks in which order the Layer objects are
rendered. This makes sense becuase the user interacts with the
LayerManager to control this order.) Finally, the contentIDs() method
takes the items in the contentIDToHighRendererFactoryMap and places
them in the List. (This is what we want, because those items need to
get painted last, or on top of everything else.)

That is how JUMP/OpenJUMP paints things on the LayerViewPanel in the
right order. This was the question I accidentally answered. :]

I think I can improve support for "pluggable" renderers using the
basics of Ole's OpenJUMP code and an understanding of how this system
works. I'm still working out the details which I will need to run by
Ed at Vivid Solutions. I'll let everyone know when I get some code
cooked up so they can give me their opinion. Even if we can't get the
changes approved for JUMP I can see what you guys will think about
adopting them in OpenJUMP.

The Sunburned Surveyor

On 12/13/06, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:
> Thanks Stefan. I'm going to take another look at the code today over
> lunch to see if I can figure it out.
>
> The Sunburned Surveyor
>
> On 12/13/06, Stefan Steiniger <[EMAIL PROTECTED]> wrote:
> > i guess the only ones who knows why they did that are Jon and Martin
> >
> > stefan
> >
> > Sunburned Surveyor schrieb:
> > > I working on the patch to add pluggable renderers to Vivid's JUMP,
> > > based on code that is already in OpenJUMP. Most of my work revolves
> > > around the createRenderer() method of the RenderingMananger class.
> > > This method contains the following Java statements:
> > >
> > >
> > > if (contentIDToLowRendererFactoryMap.containsKey(contentID)) {
> > >                       return ((Renderer.Factory) 
> > > contentIDToLowRendererFactoryMap
> > >                                       .get(contentID)).create();
> > >               }
> > >               if 
> > > (contentIDToHighRendererFactoryMap.containsKey(contentID)) {
> > >                       return ((Renderer.Factory) 
> > > contentIDToHighRendererFactoryMap
> > >                                       .get(contentID)).create();
> > >               }
> > >
> > > Can someone help me understand the purpose of this code?
> > >
> > > I appreciate the help.
> > >
> > > The Sunburned Surveyor
> > >
> > > -------------------------------------------------------------------------
> > > Take Surveys. Earn Cash. Influence the Future of IT
> > > Join SourceForge.net's Techsay panel and you'll get the chance to share 
> > > your
> > > opinions on IT & business topics through brief surveys - and earn cash
> > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > > _______________________________________________
> > > Jump-pilot-devel mailing list
> > > Jump-pilot-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> > >
> > >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Jump-pilot-devel mailing list
> > Jump-pilot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
> >
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to