private void computeAndaddToRootPanel() { // compute size and position of current marker int x; int y; int width; int height; if (selectedElements.size() > 0) { Point nwPoint = Util.getInstance().getNWPointFromElements(selectedElements); Point sePoint = Util.getInstance().getSEPointFromElements(selectedElements); x = (int) nwPoint.getX(); y = (int) nwPoint.getY(); width = (int) (sePoint.getX() - nwPoint.getX()); height= (int) (sePoint.getY() - nwPoint.getY()); this.setPixelSize(width, height); uiPanel.setSelectionMarker(this, x+uiPanel.getScrollLeft(), y+uiPanel.getScrollTop()); } }
Point targetCenterPoint = new Point(target.getAbsoluteLeft()+(target.getWidth()/2),target.getAbsoluteTop()+(target.getHeight()/2)); Point sourceIntersectionPoint = Util.getInstance().getClosestIntersectionPointForRectangle(sourceCenterPoint, targetCenterPoint, source.getAbsoluteLeft(), source.getAbsoluteTop(), (int)source.getWidth(), (int)source.getHeight()); Point targetIntersectionPoint = Util.getInstance().getClosestIntersectionPointForRectangle(targetCenterPoint, sourceCenterPoint, target.getAbsoluteLeft(), target.getAbsoluteTop(), (int)target.getWidth(), (int)target.getHeight()); sourceDistances.add(new MagnetDistance(m, Util.getInstance().getDistance(sourceIntersectionPoint.getX(), sourceIntersectionPoint.getY(), m.getAbsoluteLeft(), m.getAbsoluteTop()))); targetDistances.add(new MagnetDistance(m, Util.getInstance().getDistance(targetIntersectionPoint.getX(), targetIntersectionPoint.getY(), m.getAbsoluteLeft(), m.getAbsoluteTop())));
Point nwPoint = Util.getInstance().getNWPointFromElements(elementsView); Point sePoint = Util.getInstance().getSEPointFromElements(elementsView);
public Region(IPoint iPoint,IPoint iPoint2) { Direction direction = Util.getInstance().getDirection((Point)iPoint,(Point)iPoint2);
Point intersectionPoint = Util.getInstance().getClosestIntersectionPointForRectangle( p1, p2,