highlight on mouse rollover [message #196811] |
Tue, 27 September 2005 11:07 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
can anyone point me at sample code that shows figures getting
highlighted as the mouse moves over them (and losing the highlight after).
i'd like to see a concrete example of the interactions between EditPart,
EditPolicy, DragTracker, et al that are required to accomplish this.
i don't seem to be able to find what i want in the standard samples, but
maybe i'm missing something.
a description of what to do would be acceptable, but pointer to code
would be preferred :-).
regards,
al
|
|
|
Re: highlight on mouse rollover [message #196839 is a reply to message #196811] |
Tue, 27 September 2005 14:01 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
highlighting depends on the tool that is active. For the normal selection
tool, use the SELECTION_REQUEST, or SELECT_HOVER request ids. For dragging,
you need to look for MOVE or ADD requests.
"Al Major" <alnospammajor@noboxspamspoon.com> wrote in message
news:dhb94a$2gk$1@news.eclipse.org...
> can anyone point me at sample code that shows figures getting highlighted
> as the mouse moves over them (and losing the highlight after).
>
> i'd like to see a concrete example of the interactions between EditPart,
> EditPolicy, DragTracker, et al that are required to accomplish this.
>
> i don't seem to be able to find what i want in the standard samples, but
> maybe i'm missing something.
>
> a description of what to do would be acceptable, but pointer to code would
> be preferred :-).
>
> regards,
>
> al
|
|
|
Re: highlight on mouse rollover [message #196930 is a reply to message #196839] |
Wed, 28 September 2005 15:09 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
ok. i took your hints and created an edit policy which implements
showTargetFeedback
and
eraseTargetFeedback.
this policy was then installed in the
SELECTION_FEEDBACK_ROLE
of the base edit part.
and i'm not using a palette here, so it should just be the selection
tool working.
showTargetFeedback simply stores the mouse location in the appropriate
figure, and calls repaint on the figure. the figure paint method knows
how to highlight the appropriate location when it has a mouse location.
eraseTargetFeedback sets the mouse location to null (and calls repaint)
so the highlight should then disappear.
however, it's not working properly. it seems like both the show and the
erase get called before either paint call on the figure runs. so the
stored location is always null, and nothing ever gets highlighted.
any thoughts on what i should do to fix this problem?
on a separate note, the only request that shows up is a selection
request. the selection hover request never seems to get fired off. this
could be because the mouse interaction is being interrupted by the
debugger (or not).
Randy Hudson wrote:
> highlighting depends on the tool that is active. For the normal selection
> tool, use the SELECTION_REQUEST, or SELECT_HOVER request ids. For dragging,
> you need to look for MOVE or ADD requests.
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02847 seconds