Sunburned,

  I'll let Jon answer, but the code you posted is not what he was referring
to.  Instead look into (for example) SimpleFeatureCollectionRenderer for:

   protected void paint(Graphics2D g) throws Exception {
       for (Iterator i = styles.iterator(); i.hasNext();) {
           Style style = (Style) i.next();
           if (cancelled) {
               return;
           }
           for (Iterator j = layerToFeaturesMap.keySet().iterator(); j
                   .hasNext();) {
               Layer layer = (Layer) j.next();
               if (cancelled) {
                   return;
               }
               Collection features = (Collection) layerToFeaturesMap
                       .get(layer);
               paint(g, features, layer, style);
           }
       }
   }

Note the nested for loops with style on the outer and features on the
inside.

regards,
Larry

On 11/30/06, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:

Thanks for replying Jon. It looks like Larry was already able to get
to the bottom of the problem we were discussing. I'm still curious
about something though. Maybe you will have a few minutes to help me
out.

You wrote: "If memory serves, LayerViewPanel's RenderingManager loops
through the LayerManager's layers. For each layer it loops through the
layer's Styles and calls paint() on each one."

Yes. I think that is this code:

public void copyTo(Graphics2D destination) {
    for (Iterator i = contentIDs().iterator(); i.hasNext();) {
      Object contentID = i.next();

         if (getRenderer(contentID) != null) {
            getRenderer(contentID).copyTo(destination);
         }
    }
}

Here is my question though. When and how does OJ assign a Layer a
Renderer. Is this done when a layer is created, or after?

SS


On 11/29/06, Jonathan Aquino <[EMAIL PROTECTED]> wrote:
> Hi Sunburned - If memory serves, LayerViewPanel's RenderingManager loops
> through the LayerManager's layers. For each layer it loops through the
> layer's Styles and calls paint() on each one.
>
> Jon
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Sunburned Surveyor
> > Sent: Wednesday, November 29, 2006 10:29 PM
> > To: List for discussion of JPP development and use.
> > Subject: [JPP-Devel] OJ's rendering code...
> >
> >
> > I feel like I'm in a maze with no exit... :]
> >
> > I've been going through OJ's rendering code for an hour or
> > two. I was hoping to find out some more about our double call
> > to BasicStyle.paint().
> >
> > I don't think I'm going to get as near as far as I had hoped,
> > although I am throwing together some notes about the
> > rendering system I'll try to get on the wiki.
> >
> > There is one thing I haven't been able to figure out. At what
> > point, and how, does OpenJUMP associate a Renderer with a
> > Layer? I've looked at the the RenderingMananger class, the
> > LayerManager class, the LayerViewPanel class, the
> > FeatureCollectionRenderer class, and a bunch of other
> > classes, but I can't determine where this takes place.
> >
> > At some point after a Layer is created, but before or at the
> > moment it is made visible, OJ needs to decide which Renderer
> > will paint the Layer's contents on the LayerViewPanel.
> >
> > Where is this done?
> >
> > Does each Renderer track what Layers it needs to paint, or is
> > this done by the RendererMananger?
> >
> > Thanks for 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

-------------------------------------------------------------------------
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