Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Collapse/expand
Collapse/expand [message #900357] Mon, 06 August 2012 15:27 Go to next message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Hi everyone.

There are any examples of collapse/expand behaviour implementation?
it that possible?

Thanks
Re: Collapse/expand [message #900459 is a reply to message #900357] Tue, 07 August 2012 07:56 Go to previous messageGo to next message
Miriam Baran is currently offline Miriam BaranFriend
Messages: 16
Registered: May 2012
Junior Member
Hi,
I implemented such a behavior. You will need a custom Feature for this. Decide of a default collapsed size. First you will remember the initial size in properties of your pictogram-element
		PictogramElement pe = moduleShape;
		int width = pe.getGraphicsAlgorithm().getWidth();
		int height = pe.getGraphicsAlgorithm().getHeight();		
		Graphiti.getPeService().setPropertyValue(pe, "initial_width", String.valueOf(width));
		Graphiti.getPeService().setPropertyValue(pe, "initial_height", String.valueOf(height));
		Graphiti.getPeService().setPropertyValue(pe, "isCollapsed", "true");

then resize it
                ResizeShapeContext context1 = new ResizeShapeContext(moduleShape);
		context1.setSize(100, 100);
		context1.setLocation(moduleShape.getGraphicsAlgorithm().getX(), moduleShape.getGraphicsAlgorithm().getY());
		IResizeShapeFeature rsf = getFeatureProvider().getResizeShapeFeature(context1);
		if (rsf.canExecute(context1)) {
			rsf.execute(context1);
		}
		addConnectionOccurences(moduleShape);

and set its children invisible if you need to. Good Luck
Re: Collapse/expand [message #900552 is a reply to message #900459] Tue, 07 August 2012 13:46 Go to previous message
Rui Domingues is currently offline Rui DominguesFriend
Messages: 194
Registered: October 2010
Senior Member
Thanks for replying. I'm gonna try.
Previous Topic:Cannot modify resource set without a write transaction
Next Topic:DirectEditing in two or more texts
Goto Forum:
  


Current Time: Fri Apr 26 17:42:14 GMT 2024

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

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

Back to the top