Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Changing default values
Changing default values [message #185273] Mon, 05 May 2008 07:11 Go to next message
Eclipse UserFriend
Originally posted by: aritz.galdos.iese.fraunhofer.de

Hello everybody!!!

I have created a diagram editor by GMF. There are simple nodes (only one
kind, a rectangle) and there are simple relations (with default values)
between them. The relations have defaultly some values which are indicated
in "Properties -> Appearance". I want to change this default values. Does
anybody know? The most important is to have a Rectilinear connection instead
of Oblique. Can anybody help me? It would be greatful!!

Thank you in advance and I am sorry because of my poor English!!

Aritz
Re: Changing default values [message #185319 is a reply to message #185273] Mon, 05 May 2008 10:39 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Aritz,

See generated DiagramPreferenceInitializer.initializeDefaultPreferences(),
especially DiagramConnectionsPreferencePage.initDefaults(store); call.

-----------------
Alex Shatalin
Re: Changing default values [message #185430 is a reply to message #185319] Mon, 05 May 2008 15:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aritz.galdos.iese.fraunhofer.de

Hi Alex and other people!!

Thank you for answering me, but I have more questions related to this.

I have been trying to understand the created code, but I have some doubts. I
guess that I have to override
DiagramConnectionsPreferencePage.initDefaults(store) method, but I only want
to have defaultly Rectangular instead of Oblique and I have been looking but
I don't see which is the value that indicates this.

Does anybody know? Thank you!!!!

Aritz


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e621d4c8ca7cc4441c1c36@news.eclipse.org...
> Hello Aritz,
>
> See generated DiagramPreferenceInitializer.initializeDefaultPreferences(),
> especially DiagramConnectionsPreferencePage.initDefaults(store); call.
>
> -----------------
> Alex Shatalin
>
>
Re: Changing default values [message #185481 is a reply to message #185430] Mon, 05 May 2008 16:32 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Aritz,

Try following implementation:

public static void initDefaults(IPreferenceStore preferenceStore) {
preferenceStore.setDefault(IPreferenceConstants.PREF_LINE_ST YLE, Routing.RECTILINEAR);
}

-----------------
Alex Shatalin
Re: Changing default values [message #185591 is a reply to message #185481] Tue, 06 May 2008 11:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aritz.galdos.iese.fraunhofer.de

Hello Alex and other people!!!

First of all, thank you Alex for answering me. I have make it like you told
me, but it doesn't work. I don't know if I do it ok. I add my code:
public class DiagramConnectionsPreferencePageOverride extends
DiagramConnectionsPreferencePage {

public DiagramConnectionsPreferencePageOverride(){

super();

}


public static void initDefaults(IPreferenceStore preferenceStore) {

preferenceStore.setDefault(IPreferenceConstants.PREF_LINE_ST YLE,
Routing.RECTILINEAR);

}


}

DiagramConnectionsPreferencePage is a generated class that extends from
ConnectionsPreferencePage, the gmf class.

I hope that some could help me!!!! Thank you in advance!!!



Aritz



"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e621d9d8ca7cf577b4a6a6@news.eclipse.org...
> Hello Aritz,
>
> Try following implementation:
>
> public static void initDefaults(IPreferenceStore preferenceStore) {
> preferenceStore.setDefault(IPreferenceConstants.PREF_LINE_ST YLE,
> Routing.RECTILINEAR);
> }
>
> -----------------
> Alex Shatalin
>
>
Re: Changing default values [message #185598 is a reply to message #185591] Tue, 06 May 2008 12:12 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Aritz,

> public static void initDefaults(IPreferenceStore preferenceStore) {
> preferenceStore.setDefault(IPreferenceConstants.PREF_LINE_ST YLE, Routing.RECTILINEAR);
> }

Was it called during your diagram editor execution? Did you modify this preference
in a UI aklready? (non-default value stored in preferenceStore).
Try executing the same code with clear workspace.

-----------------
Alex Shatalin
Re: Changing default values [message #185606 is a reply to message #185598] Tue, 06 May 2008 12:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: aritz.galdos.iese.fraunhofer.de

Hi again!!!

I am not sure if I understand you, but I explain you extendedly what is my
idea. So, like I have said befor, DiagramConnectionsPreferencePage is a
generated class that extends from ConnectionsPreferencePage, the gmf class.
I mean, the generated code of my editor contains
DiagramConnectionsPreferencePage class. I want to override it, because if I
regenerate my diagram's source code, I will lose my changes. Because of
that, I have createn a new plugin and there, I have created a my class which
I have copied before (DiagramConnectionsPreferencePageOverride).

So, I only want to have the same editor as the generated version but with
one difference. The relations have to be rectilinear instead of oblique.

Maybe, everything was clear before and you have answer me rightly, so if you
still think that the answer before is the correct one, can you explain it
better, please?

Thank you very much for everything!!!

Aritz



"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e621e198ca7d9a669360d4@news.eclipse.org...
> Hello Aritz,
>
>> public static void initDefaults(IPreferenceStore preferenceStore) {
>> preferenceStore.setDefault(IPreferenceConstants.PREF_LINE_ST YLE,
>> Routing.RECTILINEAR);
>> }
>
> Was it called during your diagram editor execution? Did you modify this
> preference in a UI aklready? (non-default value stored in
> preferenceStore).
> Try executing the same code with clear workspace.
>
> -----------------
> Alex Shatalin
>
>
Re: Changing default values [message #185613 is a reply to message #185606] Tue, 06 May 2008 12:52 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Aritz,

> code of my editor contains DiagramConnectionsPreferencePage class. I
> want to override it, because if I regenerate my diagram's source code,
Use "@genereated NOT" javadoc tag to protect your method from any changes
on next ode generation. I think it's better to just modify generated code.

-----------------
Alex Shatalin
Re: Changing default values [message #185628 is a reply to message #185613] Tue, 06 May 2008 13:24 Go to previous message
Eclipse UserFriend
Originally posted by: aritz.galdos.iese.fraunhofer.de

Hi!!

Thank you for the answer but I don't like too much using this Javadoc
because I have had some problems before. Because of that, I prefer to create
my code like I explain you before. Any other idea?

Thank you for answering so quick!!!!

Aritz


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e621e1f8ca7d9fe66541c2@news.eclipse.org...
> Hello Aritz,
>
>> code of my editor contains DiagramConnectionsPreferencePage class. I
>> want to override it, because if I regenerate my diagram's source code,
> Use "@genereated NOT" javadoc tag to protect your method from any changes
> on next ode generation. I think it's better to just modify generated code.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:G?F evaluation - general advice wanted
Next Topic:Autosize figure programmatically
Goto Forum:
  


Current Time: Thu Sep 19 11:04:41 GMT 2024

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

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

Back to the top