Skip to main content



      Home
Home » Modeling » Graphiti » Graphiti Inactive Shapes(Graphiti Inactive Shapes)
Graphiti Inactive Shapes [message #1707094] Wed, 02 September 2015 05:21 Go to next message
Eclipse UserFriend
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 313 times)
Re: Graphiti Inactive Shapes [message #1707100 is a reply to message #1707094] Wed, 02 September 2015 06:33 Go to previous message
Eclipse UserFriend
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: Thu May 15 16:44:29 EDT 2025

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

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

Back to the top