Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Adding marquee selection to SelectionTool
Adding marquee selection to SelectionTool [message #156142] Fri, 29 October 2004 21:19 Go to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Greetings,

I have noticed that the Selection tool used in the logic example also
carries "Marquee" drag functionality when you click and drag on a canvas.
However, the default behaviour doesn't seem to do this. How would I add
this? I can't seem to find the example code that does it.

I tried setting a MarqueeDragTracker on the SelectionTool, but doing in
the createTool call on an entry throws an exception in
AbstractTool.activate, so I assume this approach is either incorrect or
being done too early.


--Cam
Re: Adding marquee selection to SelectionTool [message #156453 is a reply to message #156142] Mon, 01 November 2004 17:25 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Does anyone have an idea this?

Thanks,

Cameron

Cameron Bateman wrote:

> Greetings,

> I have noticed that the Selection tool used in the logic example also
> carries "Marquee" drag functionality when you click and drag on a canvas.
> However, the default behaviour doesn't seem to do this. How would I add
> this? I can't seem to find the example code that does it.

> I tried setting a MarqueeDragTracker on the SelectionTool, but doing in
> the createTool call on an entry throws an exception in
> AbstractTool.activate, so I assume this approach is either incorrect or
> being done too early.


> --Cam
Re: Adding marquee selection to SelectionTool [message #156461 is a reply to message #156453] Mon, 01 November 2004 18:39 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
The default behaviour already does that. All you need to do is add a
PanningSelectionToolEntry to your palette.

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:cm5ric$6iu$1@eclipse.org...
> Does anyone have an idea this?
>
> Thanks,
>
> Cameron
>
> Cameron Bateman wrote:
>
> > Greetings,
>
> > I have noticed that the Selection tool used in the logic example also
> > carries "Marquee" drag functionality when you click and drag on a
canvas.
> > However, the default behaviour doesn't seem to do this. How would I add
> > this? I can't seem to find the example code that does it.
>
> > I tried setting a MarqueeDragTracker on the SelectionTool, but doing in
> > the createTool call on an entry throws an exception in
> > AbstractTool.activate, so I assume this approach is either incorrect or
> > being done too early.
>
>
> > --Cam
>
>
Re: Adding marquee selection to SelectionTool [message #156475 is a reply to message #156461] Mon, 01 November 2004 19:04 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Hi Pratik,

Thanks for your response. I am adding the PanningSelectionToolEntry as
you say, but when I try to click and drag on my canvass with the tool, it
just sets the "invalid mode" mouse pointer (circle with a cross through
it) as though a request is being rejected.

Is it possible that I'm inadvertently overriding the default behaviour?
The marquee tool _does_ work. The code that creates the pallette entries
looks like this:

...
_paletteRoot = new PaletteRoot();

// group the default controls
PaletteGroup controls = new PaletteGroup("Controls");

// selection tool
PanningSelectionToolEntry toolEntry = new PanningSelectionToolEntry();
controls.add(toolEntry);
_paletteRoot.setDefaultEntry(toolEntry);

// Marquee (group selection) tool
controls.add(new MarqueeToolEntry());

_paletteRoot.add(controls);


--Cam

Pratik Shah wrote:

> The default behaviour already does that. All you need to do is add a
> PanningSelectionToolEntry to your palette.

> "Cameron Bateman" <cbateman@rim.com> wrote in message
> news:cm5ric$6iu$1@eclipse.org...
> > Does anyone have an idea this?
> >
> > Thanks,
> >
> > Cameron
> >
> > Cameron Bateman wrote:
> >
> > > Greetings,
> >
> > > I have noticed that the Selection tool used in the logic example also
> > > carries "Marquee" drag functionality when you click and drag on a
> canvas.
> > > However, the default behaviour doesn't seem to do this. How would I add
> > > this? I can't seem to find the example code that does it.
> >
> > > I tried setting a MarqueeDragTracker on the SelectionTool, but doing in
> > > the createTool call on an entry throws an exception in
> > > AbstractTool.activate, so I assume this approach is either incorrect or
> > > being done too early.
> >
> >
> > > --Cam
> >
> >
Re: Adding marquee selection to SelectionTool [message #156487 is a reply to message #156475] Mon, 01 November 2004 19:37 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Set a breakpoint in SelectionTool#handleButtonDown() and see what's going
on. You can compare it to our examples to see what should be happening.
What is the target edit part that is determined in this method? And what is
its drag tracker?

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:cm61bk$h3i$1@eclipse.org...
> Hi Pratik,
>
> Thanks for your response. I am adding the PanningSelectionToolEntry as
> you say, but when I try to click and drag on my canvass with the tool, it
> just sets the "invalid mode" mouse pointer (circle with a cross through
> it) as though a request is being rejected.
>
> Is it possible that I'm inadvertently overriding the default behaviour?
> The marquee tool _does_ work. The code that creates the pallette entries
> looks like this:
>
> ..
> _paletteRoot = new PaletteRoot();
>
> // group the default controls
> PaletteGroup controls = new PaletteGroup("Controls");
>
> // selection tool
> PanningSelectionToolEntry toolEntry = new PanningSelectionToolEntry();
> controls.add(toolEntry);
> _paletteRoot.setDefaultEntry(toolEntry);
>
> // Marquee (group selection) tool
> controls.add(new MarqueeToolEntry());
>
> _paletteRoot.add(controls);
>
>
> --Cam
>
> Pratik Shah wrote:
>
> > The default behaviour already does that. All you need to do is add a
> > PanningSelectionToolEntry to your palette.
>
> > "Cameron Bateman" <cbateman@rim.com> wrote in message
> > news:cm5ric$6iu$1@eclipse.org...
> > > Does anyone have an idea this?
> > >
> > > Thanks,
> > >
> > > Cameron
> > >
> > > Cameron Bateman wrote:
> > >
> > > > Greetings,
> > >
> > > > I have noticed that the Selection tool used in the logic example
also
> > > > carries "Marquee" drag functionality when you click and drag on a
> > canvas.
> > > > However, the default behaviour doesn't seem to do this. How would I
add
> > > > this? I can't seem to find the example code that does it.
> > >
> > > > I tried setting a MarqueeDragTracker on the SelectionTool, but doing
in
> > > > the createTool call on an entry throws an exception in
> > > > AbstractTool.activate, so I assume this approach is either incorrect
or
> > > > being done too early.
> > >
> > >
> > > > --Cam
> > >
> > >
>
>
Re: Adding marquee selection to SelectionTool [message #156491 is a reply to message #156475] Mon, 01 November 2004 19:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It sounds like you are attempting to drag your contents editpart. You
should return NULL or the marquee drag tracker in your getDragTracker(req)
method. See LogicDiagramEditPart for an example.

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:cm61bk$h3i$1@eclipse.org...
> Hi Pratik,
>
> Thanks for your response. I am adding the PanningSelectionToolEntry as
> you say, but when I try to click and drag on my canvass with the tool, it
> just sets the "invalid mode" mouse pointer (circle with a cross through
> it) as though a request is being rejected.
>
> Is it possible that I'm inadvertently overriding the default behaviour?
> The marquee tool _does_ work. The code that creates the pallette entries
> looks like this:
>
> ..
> _paletteRoot = new PaletteRoot();
>
> // group the default controls
> PaletteGroup controls = new PaletteGroup("Controls");
>
> // selection tool
> PanningSelectionToolEntry toolEntry = new PanningSelectionToolEntry();
> controls.add(toolEntry);
> _paletteRoot.setDefaultEntry(toolEntry);
>
> // Marquee (group selection) tool
> controls.add(new MarqueeToolEntry());
>
> _paletteRoot.add(controls);
>
>
> --Cam
>
> Pratik Shah wrote:
>
> > The default behaviour already does that. All you need to do is add a
> > PanningSelectionToolEntry to your palette.
>
> > "Cameron Bateman" <cbateman@rim.com> wrote in message
> > news:cm5ric$6iu$1@eclipse.org...
> > > Does anyone have an idea this?
> > >
> > > Thanks,
> > >
> > > Cameron
> > >
> > > Cameron Bateman wrote:
> > >
> > > > Greetings,
> > >
> > > > I have noticed that the Selection tool used in the logic example
also
> > > > carries "Marquee" drag functionality when you click and drag on a
> > canvas.
> > > > However, the default behaviour doesn't seem to do this. How would I
add
> > > > this? I can't seem to find the example code that does it.
> > >
> > > > I tried setting a MarqueeDragTracker on the SelectionTool, but doing
in
> > > > the createTool call on an entry throws an exception in
> > > > AbstractTool.activate, so I assume this approach is either incorrect
or
> > > > being done too early.
> > >
> > >
> > > > --Cam
> > >
> > >
>
>
Re: Adding marquee selection to SelectionTool [message #156503 is a reply to message #156491] Mon, 01 November 2004 20:09 Go to previous messageGo to next message
Cameron Bateman is currently offline Cameron BatemanFriend
Messages: 39
Registered: July 2009
Member
Yep, that did it! Thanks. One follow-up: with the selection tool working
in this way, is there any further functionality in the Marquee tool that
makes it worth keeping on my palette?

--Cam

Randy Hudson wrote:

> It sounds like you are attempting to drag your contents editpart. You
> should return NULL or the marquee drag tracker in your getDragTracker(req)
> method. See LogicDiagramEditPart for an example.

> "Cameron Bateman" <cbateman@rim.com> wrote in message
> news:cm61bk$h3i$1@eclipse.org...
> > Hi Pratik,
> >
> > Thanks for your response. I am adding the PanningSelectionToolEntry as
> > you say, but when I try to click and drag on my canvass with the tool, it
> > just sets the "invalid mode" mouse pointer (circle with a cross through
> > it) as though a request is being rejected.
> >
> > Is it possible that I'm inadvertently overriding the default behaviour?
> > The marquee tool _does_ work. The code that creates the pallette entries
> > looks like this:
> >
> > ..
> > _paletteRoot = new PaletteRoot();
> >
> > // group the default controls
> > PaletteGroup controls = new PaletteGroup("Controls");
> >
> > // selection tool
> > PanningSelectionToolEntry toolEntry = new PanningSelectionToolEntry();
> > controls.add(toolEntry);
> > _paletteRoot.setDefaultEntry(toolEntry);
> >
> > // Marquee (group selection) tool
> > controls.add(new MarqueeToolEntry());
> >
> > _paletteRoot.add(controls);
> >
> >
> > --Cam
> >
> > Pratik Shah wrote:
> >
> > > The default behaviour already does that. All you need to do is add a
> > > PanningSelectionToolEntry to your palette.
> >
> > > "Cameron Bateman" <cbateman@rim.com> wrote in message
> > > news:cm5ric$6iu$1@eclipse.org...
> > > > Does anyone have an idea this?
> > > >
> > > > Thanks,
> > > >
> > > > Cameron
> > > >
> > > > Cameron Bateman wrote:
> > > >
> > > > > Greetings,
> > > >
> > > > > I have noticed that the Selection tool used in the logic example
> also
> > > > > carries "Marquee" drag functionality when you click and drag on a
> > > canvas.
> > > > > However, the default behaviour doesn't seem to do this. How would I
> add
> > > > > this? I can't seem to find the example code that does it.
> > > >
> > > > > I tried setting a MarqueeDragTracker on the SelectionTool, but doing
> in
> > > > > the createTool call on an entry throws an exception in
> > > > > AbstractTool.activate, so I assume this approach is either incorrect
> or
> > > > > being done too early.
> > > >
> > > >
> > > > > --Cam
> > > >
> > > >
> >
> >
Re: Adding marquee selection to SelectionTool [message #156523 is a reply to message #156503] Mon, 01 November 2004 21:58 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

No.

"Cameron Bateman" <cbateman@rim.com> wrote in message
news:cm6551$o42$1@eclipse.org...
> Yep, that did it! Thanks. One follow-up: with the selection tool working
> in this way, is there any further functionality in the Marquee tool that
> makes it worth keeping on my palette?
>
> --Cam
>
Previous Topic:Polyline.setPoints()
Next Topic:Creating a table
Goto Forum:
  


Current Time: Thu Jun 27 21:02:55 GMT 2024

Powered by FUDForum. Page generated in 0.03778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top