Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » BoxRelativeAnchor.setRelativeWidth / BoxRelativeAnchor.setRelativeHeight(Interaction between Graphiti.getGaService().setLocationAndSize and BoxRelativeAnchor.setRelativeWidth / BoxRelativeAnchor.setRelativeHeight)
BoxRelativeAnchor.setRelativeWidth / BoxRelativeAnchor.setRelativeHeight [message #685780] Sun, 19 June 2011 23:30 Go to next message
M  is currently offline M Friend
Messages: 4
Registered: June 2011
Junior Member
I'm attempting to create BoxRelativeAnchors for a series of ContainerShapes that are a 3 or 4 steps down a hierarchy of ContainerShapes.

only the top level containerShape is active, the rest are not.

I'm trying to place the BoxRelativeAnchors, and so far I cannot seem to work out what .setRelativeHeight and .setRelativeWidth actually do. I'm using .setLocationAndSize to locate the anchors relative to the ContainerShape that is active, as I know that the inactive ContainerShape do not provide their own co-ord. system.

Can someone explain what .setRelativeHeight and .setRelativeWidth actually do? I've looked through the example in the Graphiti help, but it doesn't give me much of a clue how to do more complex positioning.

Thanks
Re: BoxRelativeAnchor.setRelativeWidth / BoxRelativeAnchor.setRelativeHeight [message #686476 is a reply to message #685780] Wed, 22 June 2011 10:07 Go to previous messageGo to next message
Felix Velasco is currently offline Felix VelascoFriend
Messages: 43
Registered: July 2009
Member
Try thinking of them as "setRelativeHorizontalPosition" and "setRelativeVerticalPosition", from 0.0 to 1.0
 (Width,Height)
 0.0,0.0                                1.0,0.0
  ---------------------------------------
  |                                     |
  |                                     |
  |0.0,0,5                              |1.0,0.5
  |                                     |
  |                                     |
  ---------------------------------------
 0.0,1.0                                1.0,1.0



Regards,
FĂ©lix
Re: BoxRelativeAnchor.setRelativeWidth / BoxRelativeAnchor.setRelativeHeight [message #688154 is a reply to message #686476] Fri, 24 June 2011 03:23 Go to previous message
M  is currently offline M Friend
Messages: 4
Registered: June 2011
Junior Member
Thanks Felix. I now get the idea of how the .setRelative... methods work.

Are they a replacement or used with .setLocationAndSize?
Previous Topic:Graphiti Release 0.8.0 is available for download
Next Topic:ToolBehaviorProvider .setSelectionFor methods only used on hover?
Goto Forum:
  


Current Time: Sat Jul 11 05:26:25 GMT 2020

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

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

Back to the top