Placing figure in top-right corner of another

Posted by Ivan Dubrov on Stack Overflow See other posts from Stack Overflow or by Ivan Dubrov
Published on 2010-03-19T09:20:08Z Indexed on 2010/03/19 16:01 UTC
Read the original article Hit count: 406

Filed under:
|
|

I want child figure (org.eclipse.draw2d.Figure) to be relative to the top-right corner of the parent (I want place some small icon, which will be ImageFigure, to be 12 pixels from top and right borders). Is there an existing layout manager that can layout child this way?

The org.eclipse.draw2d.XYLayout is not capable of measuring position relative to corner other than top-left.

Of course, I can:

  1. Write layout manager myself
  2. Layout children figure every time bounds are changed for the parent (in parent layout() method).

However, I would like to know if some existing layout manager provides that functionality.

© Stack Overflow or respective owner

Related posts about gef

Related posts about draw2d