Java Code Examples for org.eclipse.draw2d.geometry.Rectangle#getBottom()
The following examples show how to use
org.eclipse.draw2d.geometry.Rectangle#getBottom() .
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: RailroadView.java From xtext-eclipse with Eclipse Public License 2.0 | 6 votes |
public void reveal(IFigure figure) { Viewport viewport = canvas.getViewport(); Rectangle viewportBounds = viewport.getBounds().getCopy(); viewportBounds.translate(viewport.getViewLocation()); Rectangle figureBounds = figure.getBounds().getCopy(); figure.translateToAbsolute(figureBounds); figureBounds.translate(viewport.getViewLocation()); if (!viewportBounds.contains(figureBounds)) { int newX = viewportBounds.x; int newY = viewportBounds.y; if(viewportBounds.x > figureBounds.x) { newX = figureBounds.x; } else if(viewportBounds.x + viewportBounds.getRight().x < figureBounds.getRight().x) { newX = figureBounds.getRight().x - viewportBounds.width; } if(viewportBounds.y > figureBounds.y) { newY = figureBounds.y; } else if(viewportBounds.getBottom().y < figureBounds.getBottom().y) { newY = figureBounds.getBottom().y - viewportBounds.height; } canvas.scrollSmoothTo(newX, newY); } }
Example 2
Source File: SubprocessCollapseHandle.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
public void relocate(IFigure target) { Rectangle theBounds = getOwnerFigure().getParent().getBounds().getCopy(); getOwnerFigure().translateToAbsolute(theBounds); target.translateToRelative(theBounds); Point loc = theBounds.getBottom(); double zoom = zoomManager.getZoom() ; loc.translate(Math.round((float)zoom*-5), Math.round((float)zoom*-20)) ; target.setLocation(loc); }
Example 3
Source File: ProcessLinkAnchor.java From olca-app with Mozilla Public License 2.0 | 5 votes |
@Override public Point getLocation(Point reference) { int horizontalTranslation = 0; Rectangle r = getOwner().getBounds().getCopy(); r.translate(horizontalTranslation, recipient ? -1 : 0); getOwner().translateToAbsolute(r); Point result = null; if (recipient) result = r.getBottom(); else result = r.getTop(); return result; }