showing feedback on connections adjacent to selected element [message #190083] |
Tue, 02 August 2005 00:34 |
Eclipse User |
|
|
|
Originally posted by: user.domain.invalid
Hi,
I would like to show connections whose source/dest is selected in a
different way. Given all the structure of parts/viewer/model, the best
way I can come up with is as follows:
- in the editor's selectionChanged() method I call my own version of
setSelected() on the selected node model.
- this setSelected() calls a srcDstSelected() method on all adjacent
connections
- srcDstSelected() notifies its part (that was registered with the model
through a custom event notification pattern)
- the part for the connection calls refreshVisual(), which shows some
custom feedback for these connections.
This is kind of cumbersome. Is there a better way to do this? Ideally
I'd like from selectionChanged() in the model to be able to retrieve the
part for a certain model. I would retrieve the parts for all the
connections adjacent to the selected element and call a method on them
to change the visual aspect (off course, I have to call the same method
on unselected elements to return the aspect to normal).
Any Idea?
Thanks,
Federica
|
|
|
Re: showing feedback on connections adjacent to selected element [message #190407 is a reply to message #190083] |
Wed, 03 August 2005 18:14 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
In your EditPart's setSelected() method, you can get the adjacent
connections and their editparts (using getViewer().getEditPartRegistry()).
Then just invoke (or queue the invocation of) viewer.appendSelection().
If your model stores selection state, then you can just select the
connections in the model. When connection editparts are notified of this
change, they append themselves to the selection.
<user@domain.invalid> wrote in message news:dcmf2a$69d$1@news.eclipse.org...
> Hi,
> I would like to show connections whose source/dest is selected in a
> different way. Given all the structure of parts/viewer/model, the best
> way I can come up with is as follows:
>
> - in the editor's selectionChanged() method I call my own version of
> setSelected() on the selected node model.
> - this setSelected() calls a srcDstSelected() method on all adjacent
> connections
> - srcDstSelected() notifies its part (that was registered with the model
> through a custom event notification pattern)
> - the part for the connection calls refreshVisual(), which shows some
> custom feedback for these connections.
>
> This is kind of cumbersome. Is there a better way to do this? Ideally
> I'd like from selectionChanged() in the model to be able to retrieve the
> part for a certain model. I would retrieve the parts for all the
> connections adjacent to the selected element and call a method on them
> to change the visual aspect (off course, I have to call the same method
> on unselected elements to return the aspect to normal).
>
> Any Idea?
>
>
> Thanks,
> Federica
|
|
|
Powered by
FUDForum. Page generated in 0.02940 seconds