SS,

   public RenderingManager(final LayerViewPanel panel) {
       this.panel = panel;
       repaintTimer.setCoalesce(true);
       putAboveLayerables(SelectionBackgroundRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new SelectionBackgroundRenderer(panel);
                   }
               });
       putAboveLayerables(FeatureSelectionRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new FeatureSelectionRenderer(panel);
                   }
               });
       putAboveLayerables(AuditNonDupSelectionRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new AuditNonDupSelectionRenderer(panel);
                   }
               });
       putAboveLayerables(AuditDupSelectionRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new AuditDupSelectionRenderer(panel);
                   }
               });
       putAboveLayerables(LineStringSelectionRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new LineStringSelectionRenderer(panel);
                   }
               });
       putAboveLayerables(PartSelectionRenderer.CONTENT_ID,
               new Renderer.Factory() {
                   public Renderer create() {
                       return new PartSelectionRenderer(panel);
                   }
               });
   }

regards,
Larry

On 5/23/07, Sunburned Surveyor <[EMAIL PROTECTED]> wrote:

I was finally able to figure out why I was getting a
NullPointerException in my pluggable rendering code. It is becuase
OpenJUMP is attempting to render Java String objects. (At least that
is what it looks like to me.)

My code returns a NullPointerException when it encounters one of these
Strings because I didn't design it to return a Renderer objecct for
Strings.

Here is how I found out what was happening. I added some logging
statements using log4j in the LayerViewPanel.repaint() method. I knew
that this was the source of the NullPointerException. I also suspected
that OpenJUMP was passing me something other that a Layer or WMSLayer
to render. So I modified the LayerViewPanel.repaint() method to loop
through the List of ContentIDs, or objects to be rendered. I think
printed the class name of each object in the List. After I found out
that the objects causing me problems were Strings, I modified the
logging statements in the repaint() method to also print out the value
of the Strings.

The Strings that are present in the List of objects to be rendered
when OpenJUMP first starts have the following values:

SELECTION_BACKGROUND
SELECTED_FEATURES
SELECTED_LINESTRINGS
SELECTED_PARTS
GRID
SCALE_SHOW
SCALE_BAR

Isn't this odd? Those Strings almost look like Constant values. I
wonder where in the world they are coming from?

I've attached a text file that contains the logging statements I put
into the modified LayerViewPanel.repaint() method. I have also
attached the log file that contains the text from the logging
statements.

I can modify my pluggable rendering system to ignore String objects,
but I'd really like to know how they end up in the ContentIDs List to
begin with. Thank you in advance for any suggestions or insight.

The Sunburned Surveyor

P.S. - I just found a new friend. His name is log4j. :]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel





--
http://amusingprogrammer.blogspot.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to