Java Code Examples for org.eclipse.draw2d.geometry.Rectangle#getLocation()

The following examples show how to use org.eclipse.draw2d.geometry.Rectangle#getLocation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColumnConnectionAnchor.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public Point getLocation( Point reference )
	{
		Rectangle chopR = chopFigure.getBounds( )
				.getCropped( chopFigure.getInsets( ) );
		Point pos = chopR.getLocation( );
		chopFigure.translateToAbsolute( pos );
//		Rectangle startFigureR = this.getOwner( ).getBounds( );
		Point refPoint = getReferencePoint( );
		getOwner( ).translateToAbsolute( getReferencePoint( ) );
		int x = pos.x;
		if ( refPoint.x < reference.x )
		{
			x += chopR.width;
		}
		int y = getReferencePoint( ).y;
		if ( getOwner( ) instanceof TablePaneFigure )
		{
			y = chopFigure.getBounds( ).y + 10;
		}
		Point p = new Point( x, y );
		return p;

	}
 
Example 2
Source File: SWTBotTestUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public Point getLocationOfElementInDiagram(final SWTGefBot bot, final SWTBotGefEditor gmfEditor,
        final String elementName) {
    final IGraphicalEditPart gep = (IGraphicalEditPart) gmfEditor.getEditPart(elementName).parent().part();
    final IFigure figure = gep.getFigure();
    final Rectangle dest = figure.getBounds().getCopy();
    figure.translateToAbsolute(dest);
    return dest.getLocation();
}