[udig-devel] RenderManagerAdapters NullPointerException
Jesse Eichar
jeichar at refractions.net
Tue Dec 18 10:01:34 PST 2007
HI Leigh,
Previously the ActiveMap has always been derived from the active
editor. However there is not always an active editor even if there
are editors open. So I recently added a Tracker that monitors
workbench parts that open and close and keeps track of the most
recently active editor. As you have found I've obviously missed a
couple places where the old method is used. This issue is fixed now.
Jesse
On 17-Dec-07, at 10:01 PM, Leigh Fitzgibbon wrote:
> I just worked out what caused the error and how it can be reproduced.
>
> Suppose I open a UDig map editor, then select a layer from the
> Layers view
> to populate the "Table" view. I also have another editor open (in
> this case
> a Eurobios Schedule Editor) and now I select that editor making it the
> active editor. I can now cause the error to occur by clicking on a
> row in
> the "Table" view and selecting "Show Selection". I can eliminate
> the error
> by clicking on the UDig map thus making it the active editor.
>
> There are probably many other ways to reproduce it - it seems to be
> an issue
> with the map (or a map?) not being the active editor.
>
> Cheers,
> Leigh
>
> -----Original Message-----
> From: udig-devel-bounces at lists.refractions.net
> [mailto:udig-devel-bounces at lists.refractions.net] On Behalf Of Jody
> Garnett
> Sent: Friday, 14 December 2007 6:19 PM
> To: User-friendly Desktop Internet GIS
> Subject: Re: [udig-devel] RenderManagerAdapters NullPointerException
>
> Leigh Fitzgibbon wrote:
>> I just ran into this error:
>>
> Thanks; can you tell me what was going on when you got this error? My
> guess is you were closing the editor; and a change event fired off
> after
> the editor was closed.
>
> I created an task to track this report:
> - http://jira.codehaus.org/browse/UDIG-1345
>> Which is caused by the following code because the active editor is
>> null:
>>
> Thanks: here is my patch; but I am not sure if I should commit; it may
> only mask a real problem. Can you tell me more about what happened to
> cause this error?
>> public void notifyChanged( Notification msg ) {
>> manager.checkState();
>> switch( msg.getFeatureID(ViewportModel.class) ) {
>> case RenderPackage.VIEWPORT_MODEL__BOUNDS: {
>> MapEditor activeEditor =
>> ApplicationGISInternal.getActiveEditor();
>> if( activeEditor != null &&
>> activeEditor.isVisible() )
>> refreshDirtyArea(msg);
>> break;
>> }
>> case RenderPackage.VIEWPORT_MODEL__CRS: {
>> manager.refresh(null);
>> break;
>> }
>> }// switch
>> }
> Jody
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.17/1179 - Release Date:
> 9/12/2007
> 11:06 AM
>
>
> Internal Virus Database is out-of-date.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.17/1179 - Release Date:
> 9/12/2007
> 11:06 AM
>
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
More information about the udig-devel
mailing list