Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Dynamic Figure at runtime
Dynamic Figure at runtime [message #696226] Wed, 13 July 2011 14:26 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I want to set the figure dynamically at runtime. I use the following code to do so:

IFigure customFig = generateCustomFigure();

children.clear();
figure.getChildren().clear();
		
customFig.setParent(figure);
figure.getChildren().add(customFig);

refresh();
refreshVisuals();
performRequest(new Request(RequestConstants.REQ_REFRESH));


This shows my custom figure but does not remove the compartments of the edit part. At least the + and - buttons stay. How can I get rid of them? I want to have the edipart change its complete figure when a user selects an entry from the context menu.

Thanks,

Ralph
Re: Dynamic Figure at runtime [message #696241 is a reply to message #696226] Wed, 13 July 2011 14:55 Go to previous message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I found out that there is a difference between

children.clear();


//Clear all child editparts
while (children.size() > 0)
removeChild((EditPart)children.get(0));


The later one also removes the compartments.

Ralph
Previous Topic:GMF Tooling in Indigo
Next Topic:Figure Overlapping Problem
Goto Forum:
  


Current Time: Fri Feb 26 07:42:36 GMT 2021

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

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

Back to the top