Search in sources :

Example 6 with Locator

use of org.eclipse.draw2d.Locator in project archi by archimatetool.

the class AbstractLabelFigure method setUI.

@Override
protected void setUI() {
    setLayoutManager(new DelegatingLayout());
    Locator labelLocator = new Locator() {

        public void relocate(IFigure target) {
            Rectangle bounds = calculateTextControlBounds();
            if (bounds != null) {
                translateFromParent(bounds);
                target.setBounds(bounds);
            }
        }
    };
    add(getLabel(), labelLocator);
}
Also used : Locator(org.eclipse.draw2d.Locator) DelegatingLayout(org.eclipse.draw2d.DelegatingLayout) Rectangle(org.eclipse.draw2d.geometry.Rectangle) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

Locator (org.eclipse.draw2d.Locator)6 IFigure (org.eclipse.draw2d.IFigure)5 Rectangle (org.eclipse.draw2d.geometry.Rectangle)5 DelegatingLayout (org.eclipse.draw2d.DelegatingLayout)3 LineBorder (org.eclipse.draw2d.LineBorder)2 AbstractHandle (org.eclipse.gef.handles.AbstractHandle)2 HandleBounds (org.eclipse.gef.handles.HandleBounds)2 AbstractContainerFigure (com.archimatetool.editor.diagram.figures.AbstractContainerFigure)1 TextPositionDelegate (com.archimatetool.editor.diagram.figures.TextPositionDelegate)1 ConnectionLocator (org.eclipse.draw2d.ConnectionLocator)1 Figure (org.eclipse.draw2d.Figure)1 GridData (org.eclipse.draw2d.GridData)1 GridLayout (org.eclipse.draw2d.GridLayout)1 PrecisionRectangle (org.eclipse.draw2d.geometry.PrecisionRectangle)1 BlockFlow (org.eclipse.draw2d.text.BlockFlow)1 FlowPage (org.eclipse.draw2d.text.FlowPage)1 ParagraphTextLayout (org.eclipse.draw2d.text.ParagraphTextLayout)1 TextFlow (org.eclipse.draw2d.text.TextFlow)1