mouse listeners for editpart/figures [message #153024] |
Wed, 06 October 2004 14:07 |
Eclipse User |
|
|
|
Originally posted by: imran.shafiq.bmw-carit.de
Hi All,
I want to change some information in the model
(and also display some new info in figure)
on the basis of the location in the figure where
mouse click (different on all buttons)occurs.
I can add mouselistener on figures but then i have to
inform models about it which is not good keeping
in view MVC architecture.
I think, better would be if somehow my edit part is informed about
mouseclick n location and then editpart
can delegate to both model and figure
or if i could do it through an edit policy would be nicer.
So, I tried LayoutEditPolicy and tried to look through the
request objects
two of them looked relevant
REQ_SELECTION_HOVER
(problem: gives the mouse location but no info abt buttons)
REQ_SELECTION
(problem: SelectionRequest object has information abt
location and mouse buttons but it behaves in a strange manner, i have to
keep the mouse button pressed and then enter my edit part :-s , doesnt work
if mouse is
inside edit part and click occurs later)
so is there any appropriate way?
|
|
|
Re: mouse listeners for editpart/figures [message #153040 is a reply to message #153024] |
Wed, 06 October 2004 14:45 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
REQ_SELECTION is used for determining the target of the selection tool. The
target will eventually return the DragTracker, which will receive the mouse
clicks.
I don't see any problem with using Clickables. The figure can allow the
editpart to add ActionListeners to the appropriate clickables, so view
separation will still exist.
"Imran Shafiq" <imran.shafiq@bmw-carit.de> wrote in message
news:ck0ttj$2g3$1@eclipse.org...
> Hi All,
>
> I want to change some information in the model
> (and also display some new info in figure)
> on the basis of the location in the figure where
> mouse click (different on all buttons)occurs.
>
> I can add mouselistener on figures but then i have to
> inform models about it which is not good keeping
> in view MVC architecture.
>
> I think, better would be if somehow my edit part is informed about
> mouseclick n location and then editpart
> can delegate to both model and figure
>
> or if i could do it through an edit policy would be nicer.
>
> So, I tried LayoutEditPolicy and tried to look through the
> request objects
> two of them looked relevant
> REQ_SELECTION_HOVER
> (problem: gives the mouse location but no info abt buttons)
> REQ_SELECTION
> (problem: SelectionRequest object has information abt
> location and mouse buttons but it behaves in a strange manner, i have to
> keep the mouse button pressed and then enter my edit part :-s , doesnt
work
> if mouse is
> inside edit part and click occurs later)
>
> so is there any appropriate way?
>
>
|
|
|
Re: mouse listeners for editpart/figures [message #153079 is a reply to message #153040] |
Wed, 06 October 2004 16:05 |
Eclipse User |
|
|
|
Originally posted by: imran.shafiq.bmw-carit.de
I was just trying PerformRequest(....) REQ_DIRECT_EDIT in the editpart
to get the click (but left only) and the location
then i would have to pass the location info to my figure to ask what
does it want to do with a click at that location
(actually to give me a new size) and update the model
(cuz the SetLayoutconstraint is called in edit part which takes bounds
from model and set it into XYLayout in
the refreshVisuals)
Actually i want to have some sort of figure collapsing
so that figure can toggle between "just a title label when compact" and
"increase in size, show children when collapsed"
if you dont recommend going for this then i would go for the clickables,
but personally i would like to go for handling
it from the edit part side !
"Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
news:ck105l$7t2$1@eclipse.org...
> REQ_SELECTION is used for determining the target of the selection tool.
> The
> target will eventually return the DragTracker, which will receive the
> mouse
> clicks.
>
> I don't see any problem with using Clickables. The figure can allow the
> editpart to add ActionListeners to the appropriate clickables, so view
> separation will still exist.
>
> "Imran Shafiq" <imran.shafiq@bmw-carit.de> wrote in message
> news:ck0ttj$2g3$1@eclipse.org...
>> Hi All,
>>
>> I want to change some information in the model
>> (and also display some new info in figure)
>> on the basis of the location in the figure where
>> mouse click (different on all buttons)occurs.
>>
>> I can add mouselistener on figures but then i have to
>> inform models about it which is not good keeping
>> in view MVC architecture.
>>
>> I think, better would be if somehow my edit part is informed about
>> mouseclick n location and then editpart
>> can delegate to both model and figure
>>
>> or if i could do it through an edit policy would be nicer.
>>
>> So, I tried LayoutEditPolicy and tried to look through the
>> request objects
>> two of them looked relevant
>> REQ_SELECTION_HOVER
>> (problem: gives the mouse location but no info abt buttons)
>> REQ_SELECTION
>> (problem: SelectionRequest object has information abt
>> location and mouse buttons but it behaves in a strange manner, i have to
>> keep the mouse button pressed and then enter my edit part :-s , doesnt
> work
>> if mouse is
>> inside edit part and click occurs later)
>>
>> so is there any appropriate way?
>>
>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03685 seconds