Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Graphiti Inactive Shapes(Graphiti Inactive Shapes)
Graphiti Inactive Shapes [message #1707094] Wed, 02 September 2015 09:21 Go to next message
Ken Mersado is currently offline Ken MersadoFriend
Messages: 19
Registered: October 2014
Junior Member
Hi All,

I was having this scenario. I have an active ContainerShape with 2 active Shape child. I can move the ContainerShape as well as its 2 child. When the child is move, the parent adjust its dimension to cover up the changes (so the child would still be inside the ContinarShape). Now, i implemented a custom feature that makes the child active and inactive so i can select the ContainerShape when i want to. When the child becomes active again and is move, it creates another child or rather an image of the move child is remained inside the ContainerShape.

Please see attached image for reference.

  • Attachment: samp.png
    (Size: 5.49KB, Downloaded 292 times)
Re: Graphiti Inactive Shapes [message #1707100 is a reply to message #1707094] Wed, 02 September 2015 10:33 Go to previous message
Ken Mersado is currently offline Ken MersadoFriend
Messages: 19
Registered: October 2014
Junior Member
Hi Everyone,

I already found a work around.

// Create a temporary holder of ContainerShape children
List<Shape> tempCopy = new ArrayList<Shape>();

// Add active shape to the temporary holder
for (Shape shape : ((ContainerShape) pictogramElement).getChildren()) {
		shape.setActive(true);
		tempCopy.add(shape);
}

// Clear the original children
((ContainerShape) pictogramElement).getChildren().clear();

// Add the a new separate copy of the children to the shape
for (Shape shape : tempCopy) {
	((ContainerShape) pictogramElement).getChildren().add(EcoreUtil.copy(shape));
}


In case there is a much pretty, easy, and accepted approach, please feel free to comment.
Previous Topic:How suitable is Graphiti for a visual expression builder?
Next Topic:Execute Feature on after GraphicalEditor Opens
Goto Forum:
  


Current Time: Sat Nov 09 00:48:28 GMT 2024

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

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

Back to the top