Skip to main content



      Home
Home » Modeling » Graphiti » Collapse/expand
Collapse/expand [message #900357] Mon, 06 August 2012 11:27 Go to next message
Eclipse UserFriend
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 03:56 Go to previous messageGo to next message
Eclipse UserFriend
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 09:46 Go to previous message
Eclipse UserFriend
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: Sun Jul 13 18:04:29 EDT 2025

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

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

Back to the top