Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » set Default Color of figures
set Default Color of figures [message #667792] Mon, 02 May 2011 09:00 Go to next message
Eclipse UserFriend
Originally posted by: jo.engelhardt.ostfalia.de

Hello,

the default colors of our figures is set on the corresponding
???ViewProvider.create???() method to avoid the restriction not being
allowed changing the colors of diagram elements from the toolbar (when
setting the default colors directly in the .gmfmap model.

Now, we want also set these default colors when the user choose "Default
Color" from the Color Palette tool. I've searched for a few days as well
in the forum as in the generated code to find a way hook into the
process of setting the default colors of a figure.

Unfortunately I didn't find a solution and ask you if anyone can help me.

Thank you very much for any hint and help.


With best regards,

Jo
Re: set Default Color of figures [message #669506 is a reply to message #667792] Tue, 10 May 2011 11:29 Go to previous message
Eclipse UserFriend
Originally posted by: Joachim Engelhardt

Hi,

I found the solution by myself:
Overwrite the method

public Object getPreferredValue(EStructuralFeature feature)

of the GMF generated xxxEditPart class in the xxxDiagram.edit.parts package.
See the implementation of

org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPa rt.getPreferredValue(EStructuralFeature
feature)

how using the parameter feature to differ the requested value and return
your own.

Greetings,
Jo

> Hello,
>
> the default colors of our figures is set on the corresponding
> ???ViewProvider.create???() method to avoid the restriction not being
> allowed changing the colors of diagram elements from the toolbar (when
> setting the default colors directly in the .gmfmap model.
>
> Now, we want also set these default colors when the user choose "Default
> Color" from the Color Palette tool. I've searched for a few days as well
> in the forum as in the generated code to find a way hook into the
> process of setting the default colors of a figure.
>
> Unfortunately I didn't find a solution and ask you if anyone can help me.
>
> Thank you very much for any hint and help.
>
>
> With best regards,
>
> Jo
Previous Topic:Opening instance of .ecore in GMF diagram
Next Topic:The "+" popup: how to remove it?
Goto Forum:
  


Current Time: Sat Apr 20 02:30:27 GMT 2024

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

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

Back to the top