|How to change alignment of a node's external label? [message #1004689]
||Wed, 23 January 2013 17:10
| Stephen Slaboda
Registered: November 2012
I've followed the instructions at the end of this article, where I update the EditPart of the node with an external label, and it does move the label to where I tell it. However, the label always seems to be left-aligned. Is there a deterministic way to make the label lie at a different alignment (for example, I want my label to start below the southwest edge of the node, rather than end below the southeast edge of the node). My current settings of
BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH);
locator.setBorderItemOffset(new Dimension(0, -5));
put the label at an acceptable distance from the bottom of the node, but it aligns the end of the label to the southeast corner of the node.
I have tried using the size of the figure and the size of the BorderItemLocator to determine the correct offset, but at least in the addBorderItem method, the BorderItemLocator doesn't seem to have a size. I also noticed that in the locator a lot of updating is done regarding the X/Y coordinates, so I wonder if this is a very complicated task to handle?
Powered by FUDForum
. Page generated in 0.02283 seconds