Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EuGENia] Problem customizing the GMF editor
[EuGENia] Problem customizing the GMF editor [message #1063243] Wed, 12 June 2013 19:27 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi,

I have been following the article "Customizing a GMF editor generated by
EuGENia" and trying to set @gmf.compartment(layout="list".. .

But seems like it is not working. I attached the error as picture

can anyone help me to solve this ?

my emf part;
@gmf.node(label="displayName", figure="rounded", label.icon="true")
class ContentType extends ContentUnit {
  attr String group;
  @gmf.link(target.decoration="closedarrow", style="solid", width="2")
  ref ContentType parentContentType;
  @gmf.compartment(layout="list", collapsible="true")
  val Field[*] ownedField;
}

@gmf.node(label = "displayName")
class View extends ContentUnit {
  attr ViewType type;
  @gmf.compartment(layout="list", collapsible="false")
  val ViewField[*] ownedViewField;
}



and my Ecore2GMF.eol part;


var compartmentFigureName = "ContentTypeOwnedFieldCompartmentFigure";
changeCompartmentStyleForFields(compartmentFigureName);

compartmentFigureName = "ViewOwnedViewFieldCompartmentFigure";
changeCompartmentStyleForFields(compartmentFigureName);

operation changeCompartmentStyleForFields(compartmentFigureName:String){
	--For ownedField For List

	-- Find the compartment figure
	var listOwnedFieldCompartmentFigure = GmfGraph!Rectangle.all.selectOne(r|r.name = compartmentFigureName);

	-- ... and add a stack layout to it
	listOwnedFieldCompartmentFigure.layout = new GmfGraph!StackLayout;

	--For Text

	-- Find the Text figure
	var fieldFigure = GmfGraph!Rectangle.all.selectOne(r|r.name = 'TextFieldFigure');

	-- ... delete its border
	delete fieldFigure.border;

	-- ... set its outline to false
	fieldFigure.outline = false;

	-- ... and add a preferred size to it
	var preferredSize = new GmfGraph!Dimension;
	preferredSize.dx = 120;
	preferredSize.dy = 16;
	fieldFigure.maximumSize = preferredSize;

	--For Number

	--Find the Number figure
	fieldFigure = GmfGraph!Rectangle.all.selectOne(r|r.name = 'NumberFieldFigure');

	-- ... delete its border
	delete fieldFigure.border;

	-- ... set its outline to false
	fieldFigure.outline = false;

	-- ... and add a preferred size to it
	var preferredSize = new GmfGraph!Dimension;
	preferredSize.dx = 120;
	preferredSize.dy = 16;
	fieldFigure.maximumSize = preferredSize;

	--For Boolean

	--Find the Boolean figure
	fieldFigure = GmfGraph!Rectangle.all.selectOne(r|r.name = 'BooleanFieldFigure');

	-- ... delete its border
	delete fieldFigure.border;

	-- ... set its outline to false
	fieldFigure.outline = false;

	-- ... and add a preferred size to it
	var preferredSize = new GmfGraph!Dimension;
	preferredSize.dx = 120;
	preferredSize.dy = 16;
	fieldFigure.maximumSize = preferredSize;
	
	--For User

	--Find the User figure
	fieldFigure = GmfGraph!Rectangle.all.selectOne(r|r.name = 'UserFieldFigure');

	-- ... delete its border
	delete fieldFigure.border;

	-- ... set its outline to false
	fieldFigure.outline = false;

	-- ... and add a preferred size to it
	var preferredSize = new GmfGraph!Dimension;
	preferredSize.dx = 120;
	preferredSize.dy = 16;
	fieldFigure.maximumSize = preferredSize;
--*****************************************--
	
	--For ViewField
		
	--Find the View figure
	fieldFigure = GmfGraph!RoundedRectangle.all.selectOne(r|r.name = 'ViewFieldFigure');
	
	-- ... delete its border
	delete fieldFigure.border;

	-- ... set its outline to false
	fieldFigure.outline = false;

	-- ... and add a preferred size to it
	var preferredSize = new GmfGraph!Dimension;
	preferredSize.dx = 120;
	preferredSize.dy = 16;
	fieldFigure.maximumSize = preferredSize;


Regards,
  • Attachment: stack2.png
    (Size: 192.57KB, Downloaded 139 times)
  • Attachment: stackError.png
    (Size: 231.62KB, Downloaded 134 times)

[Updated on: Wed, 12 June 2013 19:31]

Report message to a moderator

Re: [EuGENia] Problem customizing the GMF editor [message #1063325 is a reply to message #1063243] Thu, 13 June 2013 00:35 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi,

If I understand correctly, Eugenia and the polishing transformation produce the expected .gmfmap model, which however does not produce the desired visualisation. If this is the case, I'd suggest posting a question to the GMF forum.

Cheers,
Dimitris
Previous Topic:Nodes with inital names
Next Topic:Metamodel/model evolution advice please
Goto Forum:
  


Current Time: Fri Apr 19 11:37:42 GMT 2024

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

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

Back to the top