Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Thursday, March 03, 2005

Re: [jump-users] Help With JUMP Source Code

Hi Sunburned Surveyor:

Although the comments are sparse (typically only present when the
logic is especially tricky or when the intent is not clear), my hope
is that the method names are descriptive enough to give you a
sufficient understanding of their intent.

I'm curious -- are you going to be rendering JUMP Features or your own

To answer your questions:

1. You've got the basic idea. A LayerViewPanel contains a LayerManager
which contains Layers which each contain a FeatureCollection which
contains Features which each contains a JTS Geometry. The
LayerViewPanel's RenderingManager calls each Layer's associated
LayerRenderer, which for each geometry calls the layer's BasicStyle,
which paints the geometry using StyleUtil.

2. The painting process is initiated by LayerViewPanel#paintComponent,
which, like buttons and other GUI controls, is called by the Java
system whenever it needs repainting e.g. another window has been
dragged over it. Anyway, you'll see that paintComponent calls
RenderingManager, and the chain of logic begins as described in (1)

You might have some questions as you read the RenderingManager code --
ask me if you need a hand understanding "content IDs" or other things.

3. The map canvas component is LayerViewPanel.

4. The object that converts a JTS Geometry to a Java Shape is
Java2DConverter. It is called by StyleUtil, mentioned in (1) above.

Hope that helps!


On Wed, 2 Mar 2005 18:22:09 -0800, Sunburned Surveyor wrote:
> The journey has finally begun.............
> I started to dig into the JUMP source code today, so I can see exactly
> how the rendering system in JUMP works. I found the javadoc and source
> code sparsely commented, which will make my effort more difficult. I
> know this part of the code isn't important to your typical plug-in
> developer, and that is probably why it isn't documented as well as
> some other portions of the source code I have seen. This question will
> most likely have to go to Jon or Martin, although any others that have
> worked with the rendering system are welcome to reply!
> I need a starting point to build a chain of objects used by JUMP to
> render features. I think I can pull the chain from references in the
> source and javadoc, but can't seem to pin down the start of the chain
> right now.
> I have these questions about rendering in JUMP:
> (1) How does JUMP render features? (Just looking for a basic
> explanation here.) I think it grabs layer objects initially, and then
> uses the layers to access the JTS Geometries. These geometries are
> then converted to shapes and painted on the canvas.....
> (2) Which object initiates this process, and what method does it call to do so?
> (3) Which object represents the map canvas in JUMP?
> (4) Which object converts a JTS Geometry to a Java Shape?
> Thanks,
> The Sunburned Surveyor


Post a Comment

<< Home