Thanks for your help Larry. Let me see if I understand what is going
on in this method.

for (Iterator i = styles.iterator(); i.hasNext();) {
Style style = (Style) i.next();

Get each Style  object stored in the collection of Styles in the
SimpleFeatureCollectionRenderer.

for (Iterator j = layerToFeaturesMap.keySet().iterator(); j.hasNext();) {
   Layer layer = (Layer) j.next();

The SimpleFeatureCollectionRenderer stores a HashMap that associates
Layer objects with FeatureCollections. (These FeatureCollections
contain the Features in the Layer visible in the current envelope of
the Viewport???)

Collection features = (Collection) layerToFeaturesMap.get(layer);
   paint(g, features, layer, style);

Get the Features associated with the Layer in the HashMap. Then pass
these Feature objects, the Layer, and the Style to the other Paint()
method in the SimpleFeatureCollectionRenderer class.

Is that correct?

If so, which class creates the layerToFeaturesMap? Does this mean a
SimpleFeatureCollectionRenderer can be associated with more than one
Layer?

(That appears to be the case.)

The Sunburned Surveyor


On 11/30/06, Larry Becker <[EMAIL PROTECTED]> wrote:
> 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
>
>
>

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