Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] button selection listener : call modal tool

Didn't try it but it might work to do:

- Create a tool action proxy from the toolmeneger:
      IAction createToolAction( final String toolID, final String categoryID );

- then send the action:
     context = ApplicationGIS.createContext(activeMap);
     context.sendCommand

Last part is by memory.

Hope that help,
Andrea



On Thu, Jun 10, 2010 at 10:56 AM, Virginie BERRE
<virginie.berre@xxxxxxxxxxxx> wrote:
>
> Dear all,
>
>
>
> I would like to add a button in a viewpart which draw a polygon. I've implemented a modal tool and I don't know how to call it in the button's selection listener.
>
>
>
> My tool is:
>
> public class DrawRectangleTool extends AbstractModalTool implements ModalTool {
>
>
>
>       public static String ID = "mytools.datamanager.drawRectangle";
>
>       private Point start;
>
>       DrawShapeCommand draw = new DrawShapeCommand();
>
>       public Coordinate startCoord;
>
>       public Coordinate endCoord;
>
>
>
>
>
>       /**
>
>        *
>
>        */
>
>       public DrawRectangleTool() {
>
>             draw.setFill(new Color(Color.ORANGE.getRed(),
>
>                         Color.ORANGE.getGreen(), Color.ORANGE.getBlue(), 50));
>
>       }
>
>
>
>       /**
>
>        * @param targets
>
>        */
>
>       public DrawRectangleTool(int targets) {
>
>             super(targets);
>
>             draw.setFill(new Color(Color.ORANGE.getRed(),
>
>                         Color.ORANGE.getGreen(), Color.ORANGE.getBlue(), 50));
>
>       }
>
>
>
	for <udig-devel@xxxxxxxxxxxxxxxxxxxxx>;
	Fri, 11 Jun 2010 01:35:17 -0700 (PDT)
Received: by pxi18 with SMTP id 18so381440pxi.8
	for <udig-devel@xxxxxxxxxxxxxxxxxxxxx>;
	Fri, 11 Jun 2010 01:36:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:content-type:mime-version
	:subject:from:in-reply-to:date:content-transfer-encoding:message-id
	:references:to:x-mailer;
	bh=MOAI36xPjkKOgRMrIf9xRDZnMUBEfTDrEDgAsqZHmPs=;
	b=dUHNT8U49TicTTfma7jugGTGJyy+OKy5VAEyEQHI4t1aPdWA5a9qZPgw8XIQ8Uvjar
	wGaGjrsxbpZgXe1FPNS/k1Qy4lV62oKxBmXyHj/ngWswveUzTyfOeJoXrSpp/Osffyg4
	1bXBlQi+VFdT/nbQwRgfvcGPlrf5+Jke8MUaYDomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=content-type:mime-version:subject:from:in-reply-to:date
	:content-transfer-encoding:message-id:references:to:x-mailer;
	b=Ol44f1EaKPhFXMm/UJDHW2Bu9//4sfSo/mOpuIpLpCVwsYjykpo0goL0KFmTaOpQ/j
	OktQwZdZK0STWAYcKB4zmzqj9WIGFChqCtGm/md534JcYEguHonRd31yMnM+2Xxs7WCE
	Q8FZVeQjpeVOoPCmjRw7BQP97/owpJItrgwscReceived: by 10.141.14.19 with SMTP id r19mr1096683rvi.255.1276245014839;
	Fri, 11 Jun 2010 01:30:14 -0700 (PDT)
Received: from [192.168.0.10] (199.77.233.220.static.exetel.com.au
	[220.233.77.199])
	by mx.google.com with ESMTPS id d14sm972141rva.6.2010.06.11.01.30.13
	(version=TLSv1/SSLv3 cipher=RC4-MD5);
	Fri, 11 Jun 2010 01:30:14 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Apple Message framework v1078)
From: Jody Garnett <jody.garnett@xxxxxxxxx>
In-Reply-To: <4C11ECC4.80405@xxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2010 18:30:10 +1000
Content-Transfer-Encoding: quoted-printable
Message-Id: <B632F892-CF2B-4151-8C62-55C6A99B62A9@xxxxxxxxx>
References: <4C11DA52.7080003@xxxxxxxxxxxxxxxxxx>
	<759F365C-2FD8-48C5-95CE-6A472CC77874@xxxxxxxxx>
	<4C11ECC4.80405@xxxxxxxxxxxxxxxxxx>
To: User-friendly Desktop Internet GIS <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
X-Mailer: Apple Mail (2.1078)
Subject: Re: [udig-devel] Listening to render events
X-BeenThere: udig-devel@xxxxxxxxxxxxxxxxxxxxx
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: User-friendly Desktop Internet GIS <udig-devel@xxxxxxxxxxxxxxxxxxxxx>
List-Id: User-friendly Desktop Internet GIS <udig-devel.lists.refractions.net>
List-Unsubscribe: <http://lists.refractions.net/mailman/options/udig-devel>,
	<mailto:udig-devel-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe>
List-Archive: <http://lists.refractions.net/pipermail/udig-devel>
List-Post: <mailto:udig-devel@xxxxxxxxxxxxxxxxxxxxx>
List-Help: <mailto:udig-devel-request@xxxxxxxxxxxxxxxxxxxxx?subject=help>
List-Subscribe: <http://lists.refractions.net/mailman/listinfo/udig-devel>,
	<mailto:udig-devel-request@xxxxxxxxxxxxxxxxxxxxx?subject=subscribe>
X-List-Received-Date: Fri, 11 Jun 2010 08:35:18 -0000

Great;

And if you come up with a code snippet of listening to the rendering process please share so we can add to the developers guide.

Jody

On 11/06/2010, at 5:59 PM, Ugo Taddei wrote:

> Found it. Great!
> 
> Thanks,
> 
> Ugo
> 
> Jody Garnett wrote:
>> I think so; the thing doing the rendering is called the render executor and you could go and see what it provides. Remember to use the Notification system for more detail then is provided by listeners (as per my previous email).
>> Jody
>> On 11/06/2010, at 4:40 PM, Ugo Taddei wrote:
>>> Hello,
>>> 
>>> I want to know when the map has finished rendering all layers. Is there a way to listen to render events? (If there is such a thing, anyway.)
>>> 
>>> Background: sometimes a layer (coming from a WMS) takes more time than usual (has lots of polys), and the user is left waiting, so I want to include a more visible message to to the user. Furthermore, I've got the impression that map.getRenderManager().refresh(null) doesn't always work ok. Looks like some layers don't refresh or get redrawn).
>>> 
>>> Thanks in advance,
>>> 
>>> Ugo
>>> _______________________________________________
>>> 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



Back to the top