Home » Eclipse Projects » GEF » How to provide visual feedback in a policy?
How to provide visual feedback in a policy? [message #67352] |
Fri, 28 February 2003 14:06 |
Eclipse User |
|
|
|
Originally posted by: Raymond_Tsui.ca.ibm.co
I am a relatively new GEF user and I am trying to write some code to provide
visual feedback on the screen as the mouse passes over objects.
What I woud like to do is draw a plus sign as the mouse passes in between
IFigures. I want to understand how to temporarily draw a arbitrary shape.
What is the correct method for accessing the screen?
At the ShowTargetFeedback method in the editpolicy, I don't see any way to
paint onto the screen.
Ray
|
|
|
Re: How to provide visual feedback in a policy? [message #67408 is a reply to message #67352] |
Fri, 28 February 2003 15:35 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
news:b3nok7$cal$1@rogue.oti.com...
> I am a relatively new GEF user and I am trying to write some code to
provide
> visual feedback on the screen as the mouse passes over objects.
If you are between two figures, then you are over the diagram, or "contents"
EditPart. The SelectionTool will target whatever EditPart is underneath the
mouse. You could add an EditPolicy to the diagram EditPart that responds to
showFeedback(Request), where request.equals(RequestContsants.REQ_SELECTION),
and in that method you can create another figures and do an
addFeedback(plusFigure).
> What I woud like to do is draw a plus sign as the mouse passes in between
> IFigures. I want to understand how to temporarily draw a arbitrary shape.
> What is the correct method for accessing the screen?
> At the ShowTargetFeedback method in the editpolicy, I don't see any way to
> paint onto the screen.
>
> Ray
>
>
>
|
|
|
Re: How to provide visual feedback in a policy? [message #67428 is a reply to message #67408] |
Fri, 28 February 2003 16:01 |
Eclipse User |
|
|
|
Originally posted by: Raymond_Tsui.ca.ibm.co
Hi again
Would this also apply if I am in the move/create/add state? I want to show
the feedback in the middle of that request.
What is the addFeedback you are referring to? So if I understand you
correctly, the only way to show any sort of feedback is to add a figure to
the enclosing edit part? There is no way to draw to the screen other than
using Figures?
One other question, how do I redirect the targetted Editpart?
You said that the tool will choose whichever editpart it is over. Where I
can override this behavior? For example, if my mouse is on child A of parent
B, when I call getHost, it returns A, but the mouse so close to the edge of
A that I want the host to be B. Can I redirect the host in one of my
editpolicies?
Thanks
Ray
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b3ntr7$h1q$1@rogue.oti.com...
>
> "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> news:b3nok7$cal$1@rogue.oti.com...
> > I am a relatively new GEF user and I am trying to write some code to
> provide
> > visual feedback on the screen as the mouse passes over objects.
>
> If you are between two figures, then you are over the diagram, or
"contents"
> EditPart. The SelectionTool will target whatever EditPart is underneath
the
> mouse. You could add an EditPolicy to the diagram EditPart that responds
to
> showFeedback(Request), where
request.equals(RequestContsants.REQ_SELECTION),
> and in that method you can create another figures and do an
> addFeedback(plusFigure).
>
> > What I woud like to do is draw a plus sign as the mouse passes in
between
> > IFigures. I want to understand how to temporarily draw a arbitrary
shape.
> > What is the correct method for accessing the screen?
> > At the ShowTargetFeedback method in the editpolicy, I don't see any way
to
> > paint onto the screen.
> >
> > Ray
> >
> >
> >
>
>
|
|
|
Re: How to provide visual feedback in a policy? [message #67448 is a reply to message #67428] |
Fri, 28 February 2003 16:26 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
"Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
news:b3nvbf$i9u$1@rogue.oti.com...
> Hi again
>
> Would this also apply if I am in the move/create/add state? I want to show
> the feedback in the middle of that request.
Sorry, if you are in the middle of move/create/add, this is much more
common. Please try running the logic example and creating a FlowContainer.
Then, add multiple children to this container. You will see the insertion
emphasis which is probably what you are trying to do. This is handled
already by FlowLayoutEditPolicy.
> What is the addFeedback you are referring to? So if I understand you
> correctly, the only way to show any sort of feedback is to add a figure to
> the enclosing edit part?
Nope, the feedback is added to the feedback layer, and can paint anywhere,
but yes it is a figure. It is not clipped by the enclosing editpart.
> One other question, how do I redirect the targetted Editpart?
> You said that the tool will choose whichever editpart it is over. Where I
> can override this behavior? For example, if my mouse is on child A of
parent
> B, when I call getHost, it returns A, but the mouse so close to the edge
of
> A that I want the host to be B. Can I redirect the host in one of my
> editpolicies?
Once again, look at the logic example. If A is not capable of receiving
children (for example, and LED in the LogicEditor), then it does not return
getHost(). In fact, tt should not have a layout editpolicy, so it will
return NULL sa the target. In this scenario, the targeting tool keeps
drilling down until if finds B, which says that it is the target of
ADD/MOVE/CREATE.
If A and B are potential containers, then you do have to be a little more
creative. What you would want then is the type of targeting that is done in
Windows File Explorer.
|
|
| |
Re: How to provide visual feedback in a policy? [message #67490 is a reply to message #67448] |
Fri, 28 February 2003 18:44 |
Eclipse User |
|
|
|
Originally posted by: Raymond_Tsui.ca.ibm.co
The funny thing is: I ran the logic designer example and I don't get any
insertion feedback at all, would there be something I need to turn on to see
the insertion line?
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b3o0qk$jjt$1@rogue.oti.com...
>
> "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> news:b3nvbf$i9u$1@rogue.oti.com...
> > Hi again
> >
> > Would this also apply if I am in the move/create/add state? I want to
show
> > the feedback in the middle of that request.
>
> Sorry, if you are in the middle of move/create/add, this is much more
> common. Please try running the logic example and creating a
FlowContainer.
> Then, add multiple children to this container. You will see the insertion
> emphasis which is probably what you are trying to do. This is handled
> already by FlowLayoutEditPolicy.
>
> > What is the addFeedback you are referring to? So if I understand you
> > correctly, the only way to show any sort of feedback is to add a figure
to
> > the enclosing edit part?
>
> Nope, the feedback is added to the feedback layer, and can paint anywhere,
> but yes it is a figure. It is not clipped by the enclosing editpart.
>
> > One other question, how do I redirect the targetted Editpart?
> > You said that the tool will choose whichever editpart it is over. Where
I
> > can override this behavior? For example, if my mouse is on child A of
> parent
> > B, when I call getHost, it returns A, but the mouse so close to the edge
> of
> > A that I want the host to be B. Can I redirect the host in one of my
> > editpolicies?
>
> Once again, look at the logic example. If A is not capable of receiving
> children (for example, and LED in the LogicEditor), then it does not
return
> getHost(). In fact, tt should not have a layout editpolicy, so it will
> return NULL sa the target. In this scenario, the targeting tool keeps
> drilling down until if finds B, which says that it is the target of
> ADD/MOVE/CREATE.
>
> If A and B are potential containers, then you do have to be a little more
> creative. What you would want then is the type of targeting that is done
in
> Windows File Explorer.
>
>
>
|
|
|
Re: How to provide visual feedback in a policy? [message #67550 is a reply to message #67490] |
Fri, 28 February 2003 19:00 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Are you using the latest code from Eclipse.org?
There was a bug in Pointlist that caused the insertion line to not appear.
I just fixed it before lunch.
"Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
news:b3ob0f$q7q$1@rogue.oti.com...
> The funny thing is: I ran the logic designer example and I don't get any
> insertion feedback at all, would there be something I need to turn on to
see
> the insertion line?
>
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:b3o0qk$jjt$1@rogue.oti.com...
> >
> > "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> > news:b3nvbf$i9u$1@rogue.oti.com...
> > > Hi again
> > >
> > > Would this also apply if I am in the move/create/add state? I want to
> show
> > > the feedback in the middle of that request.
> >
> > Sorry, if you are in the middle of move/create/add, this is much more
> > common. Please try running the logic example and creating a
> FlowContainer.
> > Then, add multiple children to this container. You will see the
insertion
> > emphasis which is probably what you are trying to do. This is handled
> > already by FlowLayoutEditPolicy.
> >
> > > What is the addFeedback you are referring to? So if I understand you
> > > correctly, the only way to show any sort of feedback is to add a
figure
> to
> > > the enclosing edit part?
> >
> > Nope, the feedback is added to the feedback layer, and can paint
anywhere,
> > but yes it is a figure. It is not clipped by the enclosing editpart.
> >
> > > One other question, how do I redirect the targetted Editpart?
> > > You said that the tool will choose whichever editpart it is over.
Where
> I
> > > can override this behavior? For example, if my mouse is on child A of
> > parent
> > > B, when I call getHost, it returns A, but the mouse so close to the
edge
> > of
> > > A that I want the host to be B. Can I redirect the host in one of my
> > > editpolicies?
> >
> > Once again, look at the logic example. If A is not capable of receiving
> > children (for example, and LED in the LogicEditor), then it does not
> return
> > getHost(). In fact, tt should not have a layout editpolicy, so it will
> > return NULL sa the target. In this scenario, the targeting tool keeps
> > drilling down until if finds B, which says that it is the target of
> > ADD/MOVE/CREATE.
> >
> > If A and B are potential containers, then you do have to be a little
more
> > creative. What you would want then is the type of targeting that is
done
> in
> > Windows File Explorer.
> >
> >
> >
>
>
|
|
|
Re: How to provide visual feedback in a policy? [message #67670 is a reply to message #67550] |
Fri, 28 February 2003 22:03 |
Eclipse User |
|
|
|
Originally posted by: Raymond_Tsui.ca.ibm.co
thanks, I guess I will have to wait until Monday to get that update.
Ray
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b3obvo$r8t$1@rogue.oti.com...
> Are you using the latest code from Eclipse.org?
> There was a bug in Pointlist that caused the insertion line to not appear.
> I just fixed it before lunch.
>
> "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> news:b3ob0f$q7q$1@rogue.oti.com...
> > The funny thing is: I ran the logic designer example and I don't get any
> > insertion feedback at all, would there be something I need to turn on to
> see
> > the insertion line?
> >
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:b3o0qk$jjt$1@rogue.oti.com...
> > >
> > > "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> > > news:b3nvbf$i9u$1@rogue.oti.com...
> > > > Hi again
> > > >
> > > > Would this also apply if I am in the move/create/add state? I want
to
> > show
> > > > the feedback in the middle of that request.
> > >
> > > Sorry, if you are in the middle of move/create/add, this is much more
> > > common. Please try running the logic example and creating a
> > FlowContainer.
> > > Then, add multiple children to this container. You will see the
> insertion
> > > emphasis which is probably what you are trying to do. This is handled
> > > already by FlowLayoutEditPolicy.
> > >
> > > > What is the addFeedback you are referring to? So if I understand you
> > > > correctly, the only way to show any sort of feedback is to add a
> figure
> > to
> > > > the enclosing edit part?
> > >
> > > Nope, the feedback is added to the feedback layer, and can paint
> anywhere,
> > > but yes it is a figure. It is not clipped by the enclosing editpart.
> > >
> > > > One other question, how do I redirect the targetted Editpart?
> > > > You said that the tool will choose whichever editpart it is over.
> Where
> > I
> > > > can override this behavior? For example, if my mouse is on child A
of
> > > parent
> > > > B, when I call getHost, it returns A, but the mouse so close to the
> edge
> > > of
> > > > A that I want the host to be B. Can I redirect the host in one of my
> > > > editpolicies?
> > >
> > > Once again, look at the logic example. If A is not capable of
receiving
> > > children (for example, and LED in the LogicEditor), then it does not
> > return
> > > getHost(). In fact, tt should not have a layout editpolicy, so it
will
> > > return NULL sa the target. In this scenario, the targeting tool keeps
> > > drilling down until if finds B, which says that it is the target of
> > > ADD/MOVE/CREATE.
> > >
> > > If A and B are potential containers, then you do have to be a little
> more
> > > creative. What you would want then is the type of targeting that is
> done
> > in
> > > Windows File Explorer.
> > >
> > >
> > >
> >
> >
>
>
|
|
|
Re: How to provide visual feedback in a policy? [message #68017 is a reply to message #67550] |
Mon, 03 March 2003 16:41 |
Eclipse User |
|
|
|
Originally posted by: Raymond_Tsui.ca.ibm.co
Which build would I pick up to get this fix?
Ray
"Randy Hudson" <none@us.ibm.com> wrote in message
news:b3obvo$r8t$1@rogue.oti.com...
> Are you using the latest code from Eclipse.org?
> There was a bug in Pointlist that caused the insertion line to not appear.
> I just fixed it before lunch.
>
> "Ray Tsui" <Raymond_Tsui@ca.ibm.co> wrote in message
> news:b3ob0f$q7q$1@rogue.oti.com...
> > The funny thing is: I ran the logic designer example and I don't get any
> > insertion feedback at all, would there be something I need to turn on to
> see
> > the insertion line?
|
|
|
Goto Forum:
Current Time: Sat Dec 21 14:47:01 GMT 2024
Powered by FUDForum. Page generated in 0.04181 seconds
|