Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Access to figures through domain model elements
Access to figures through domain model elements [message #78282] Thu, 16 November 2006 12:36 Go to next message
Eclipse UserFriend
Originally posted by: christian.daenekas.informatik.uni-oldenburg.de

Hi there!

I´ve written a Java constraint that detects cycles in my editors graphs.
I store the domain model elements that cause the cycle. Now I want to
get access to the figures so that i can visualize the cycle in my graph
(I think of coloring the elements red). Now, how do I get from my domain
element to it´s graphical representation and change its decoration.

Greetings,
Christian
Re: Access to figures through domain model elements [message #78298 is a reply to message #78282] Thu, 16 November 2006 13:08 Go to previous messageGo to next message
Eclipse UserFriend
HI Christian ;

To reach for the EditParts/Views/Figures form the semantic element you
can do :

diagramEditor.getDiagramGraphicalViewer().findEditPartsForEl ement(
EMFCoreUtil.getProxyID(myObject),????EditPart.class);

this will return you a List of edit parts, then using the edit parts you
can get both notation views and figures, by using getModel and getFigure()

now that you have the Notation view you can get change the shape style
on this view to reflect the colors you like (check ShapeStyle and
FillStyle)

Christian Dänekas wrote:
> Hi there!
>
> I´ve written a Java constraint that detects cycles in my editors graphs.
> I store the domain model elements that cause the cycle. Now I want to
> get access to the figures so that i can visualize the cycle in my graph
> (I think of coloring the elements red). Now, how do I get from my domain
> element to it´s graphical representation and change its decoration.
>
> Greetings,
> Christian
Re: Access to figures through domain model elements [message #78832 is a reply to message #78298] Mon, 20 November 2006 07:20 Go to previous message
Eclipse UserFriend
Originally posted by: christian.daenekas.informatik.uni-oldenburg.de

Hi,
one more question. How do I get the diagrameditor object that you mention?

Greetings,
Christian

Mohammed Mostafa schrieb:
> HI Christian ;
>
> To reach for the EditParts/Views/Figures form the semantic element
> you can do :
>
> diagramEditor.getDiagramGraphicalViewer().findEditPartsForEl ement(
> EMFCoreUtil.getProxyID(myObject),????EditPart.class);
>
> this will return you a List of edit parts, then using the edit parts you
> can get both notation views and figures, by using getModel and getFigure()
>
> now that you have the Notation view you can get change the shape style
> on this view to reflect the colors you like (check ShapeStyle and
> FillStyle)
>
> Christian Dänekas wrote:
>> Hi there!
>>
>> I´ve written a Java constraint that detects cycles in my editors
>> graphs. I store the domain model elements that cause the cycle. Now I
>> want to get access to the figures so that i can visualize the cycle in
>> my graph (I think of coloring the elements red). Now, how do I get
>> from my domain element to it´s graphical representation and change its
>> decoration.
>>
>> Greetings,
>> Christian
Previous Topic:Attaching analysis code
Next Topic:Persisting diagram in rdb
Goto Forum:
  


Current Time: Wed Jul 16 23:20:11 EDT 2025

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

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

Back to the top