Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Cannot move ContainerShape
Cannot move ContainerShape [message #1719265] Wed, 06 January 2016 16:46 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
I rewrote part of my code to correct some issues and somehow ended up not being able to move my ContainerShape. All I am getting is the marquee rectangle when trying to select and move the shape. FeatureProvider's getMoveShapeFeature() is not being called when I try to move the shape, but is being called when I try to move shapes inside my container. Can anybody offer advice on what would cause this behavior or good place to debug?

Thanks,
Alex

[Updated on: Wed, 06 January 2016 16:53]

Report message to a moderator

Re: Cannot move ContainerShape [message #1719702 is a reply to message #1719265] Mon, 11 January 2016 15:12 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1898
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Alex,

hm, I can only guess, but maybe your container shape is not active?

HTH,
Michael
Re: Cannot move ContainerShape [message #1720171 is a reply to message #1719702] Thu, 14 January 2016 21:19 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
Michael,

No, the container shape is active.

Here is part of the code that was changed:

ContainerShape containerShape = peCreateService.createContainerShape(context.getTargetContainer(), true);
MapperUtil.addProperty(containerShape, MapperConstans.CONTAINER_TYPE, MapperConstans.INVISIBLE_CONTAINER_TYPE);

Rectangle invisibleContainer = createService.createInvisibleRectangle(containerShape);
gaService.setLocationAndSize(invisibleContainer, context.getX(), context.getY(), width, 60);
		
RoundedRectangle roundedRectangle = createService.createRoundedRectangle(invisibleContainer, 10, 10);
roundedRectangle.setBackground(manageColor(IColorConstant.WHITE));
roundedRectangle.setLineWidth(3);
//containerShape.setStyle(StyleUtil.getStyleForChannelComponentContainer(getDiagram()));
layoutService.setLocationAndSize(roundedRectangle, 5, 5, width-10, 50);
...
...
link(containerShape, context.getNewObject());
peCreateService.createChopboxAnchor(containerShape);
		
if(hasIncomingConnection()){
   createAnchor(containerShape, roundedRectangle, AnchorLocation.LEFT);
}
		
if(hasOutgoingConnection()){			
   createAnchor(containerShape, roundedRectangle, AnchorLocation.RIGHT);
}
		
layoutPictogramElement(containerShape);	
return containerShape;


And here is a video I recorded to further show the issue
http://i.imgur.com/b3Df2Oe.gif

As you can see I can't move the main container itself, but I can execute code inside MoveFeature when trying to move containers inside the main container.
Re: Cannot move ContainerShape [message #1720437 is a reply to message #1720171] Mon, 18 January 2016 16:08 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1898
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hm, do you have any special coding in your tool behavior provider?

Michael
Re: Cannot move ContainerShape [message #1720594 is a reply to message #1720437] Tue, 19 January 2016 15:22 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
Yes! That was the problem. I overrode getSelection() method in behavior provider and logic was messing up the selection of the main figure. Thank you for your help Michael!
Previous Topic:Call add feature from within a custom feature
Next Topic:Cancelling model changes done in a CustomFeature
Goto Forum:
  


Current Time: Wed Sep 26 08:56:28 GMT 2018

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

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

Back to the top