Antwort: Re: [udig-devel] question concerning interface MapGraphic

Jesse Eichar jeichar at refractions.net
Thu Jul 19 10:23:19 PDT 2007


Ah I see.  Ok that would be why.  It is fixed on RC10a.  I'm trying  
to release RC11 but I have some wrong jars on my classpath.  It seems  
to be a pretty good release so I'd recommend taking a look at it to  
verify if it satisfies your requirements.

Jesse


On Jul 18, 2007, at 11:41 PM, tony.roth at GMX.de wrote:

> version: 1.1 RC8
>
> tony roth
> -----udig-devel-bounces at lists.refractions.net schrieb: -----
>
> An: User-friendly Desktop Internet GIS <udig- 
> devel at lists.refractions.net>
> Von: Jesse Eichar <jeichar at refractions.net>
> Gesendet von: udig-devel-bounces at lists.refractions.net
> Datum: 18.07.2007 08:31PM
> Thema: Re: [udig-devel] question concerning interface MapGraphic
>
> Sounds like a bug to me.  I thought we had recently fixed one like  
> this.  What version of uDig are you using?
>
> Jesse
>
> On Jul 18, 2007, at 7:48 AM, tony.roth at GMX.de wrote:
>
>> Hi.
>> since some of my users want a red cross in the center of the map  
>> (don't ask why...) I implemented the class attached below. It is  
>> realized like the ScalebarMapGraphic and published via the  
>> extension point "net.refractions.udig.mapgraphic.mapgraphic".
>> The application gets a reference to the layer like done in  
>> AbstractToggleMapGraphicAction using the MapGraphicService.
>> The user can toggle on/off the scalebar and the cross with a  
>> checkbox in a viewpart. Each has its own checkbox. If the state of  
>> the checkbox changes, the visibility of the layer is set to the  
>> appropriate state and the layer is refreshed:
>> crossLayer.setVisible(checkboxState);
>> crossLayer.refresh(null);
>> If only one of both layers is visible it works fine. But if both  
>> are active I get the following behaviour:
>> scalebarLayer visible, crossLayer not visible -> visible: works (I  
>> can see both)
>> scalebarLayer visible, crossLayer visible -> not visible: nothing  
>> happens (the cross is still visible)
>> if I deactivate the scalebar both disappear. if I activate the  
>> scalebar again both appear (which is wrong) and then (after a  
>> second) the cross disappears.
>> the same happens if both are activated and I remove the scalebar:
>> crossLayer visible, scalebarLayer visible  -> not visible: nothing  
>> happens (the scalebar is still visible)
>> if I deactivate the cross both disappear
>> In MapGraphic is the hint to check the clip area of the  
>> Viewportgraphics object to determine what area needs to be  
>> refreshed. I cannot find a passage in ScalebarMapGraphic  where  
>> this is done.
>> Can someone help me with this?
>> thanks,
>> tony roth
>> package foo.bar;
>> import java.awt.Color;
>> import java.awt.geom.GeneralPath;
>> import net.refractions.udig.mapgraphic.MapGraphic;
>> import net.refractions.udig.mapgraphic.MapGraphicContext;
>> import net.refractions.udig.ui.graphics.ViewportGraphics;
>> /**
>>  * Decorator object
>>  *
>>  */
>> public class CenterCrossMapGraphic implements MapGraphic {
>>  public void draw(MapGraphicContext context) {
>>
>>   int displayWidth = context.getRenderManagerInternal 
>> ().getMapDisplay().getWidth();
>>   int displayHeight = context.getRenderManagerInternal 
>> ().getMapDisplay().getHeight();
>>
>>   ViewportGraphics graphics = context.getGraphics();
>>   GeneralPath path = new GeneralPath();
>>         path.moveTo(displayWidth/2, displayHeight/2-10);
>>         path.lineTo(displayWidth/2, displayHeight/2+10);
>>
>>         path.moveTo(displayWidth/2-10, displayHeight/2);
>>         path.lineTo(displayWidth/2+10, displayHeight/2);
>>         Color halo = new Color(255,255,255,128);
>>         graphics.setColor(halo);
>>         graphics.setStroke(ViewportGraphics.LINE_SOLID, 3);
>>         graphics.draw(path);
>>
>>         graphics.setColor(Color.RED);
>>         graphics.setStroke(ViewportGraphics.LINE_SOLID, 1);
>>         graphics.draw(path);
>>  }
>> }
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20070719/f744905e/attachment.html


More information about the udig-devel mailing list