public HashMap<Direction, Point> getIntersectionPoints() { HashMap<Direction, Point> ip = new HashMap<Direction, Point>(); ip.put(Direction.NE, new Point(connectorStart.getAbsoluteLeft(), connectorStart.getAbsoluteTop())); ip.put(Direction.SE, new Point(connectorEnd.getAbsoluteLeft(), connectorEnd.getAbsoluteTop())); return ip; }
public IPoint getNorthWestPoint() { Point p = new Point(this.getAbsoluteLeft(), this.getAbsoluteTop()); return p; }
public IPoint getNorthWestPoint() { Point p = new Point(this.getAbsoluteLeft(), this.getAbsoluteTop()); return p; }
@Override public IPoint getNorthWestPoint() { return new Point(this.getAbsoluteLeft(),this.getAbsoluteTop()); }
public IPoint getSouthEastPoint() { return new Point(this.getAbsoluteLeft() + 10,this.getAbsoluteTop()+10); }
public IPoint getNorthWestPoint() { return new Point(this.getAbsoluteLeft()-10,this.getAbsoluteTop()-10); }
public HashMap<Direction, Point> getIntersectionPoints() { HashMap<Direction,Point> points = new HashMap<Direction,Point>(); //top left point Point tlp = new Point(getAbsoluteLeft(), getAbsoluteTop()); //top top right point Point trp = new Point(getAbsoluteLeft()+getWidth(),getAbsoluteTop()); //btm left point Point blp = new Point(getAbsoluteLeft(),getAbsoluteTop()+getHeight()); //btm top right point Point brp = new Point(getAbsoluteLeft()+getWidth(), getAbsoluteTop()+getHeight()); //middle point Point mp = new Point(getAbsoluteLeft()+(getWidth()/2),getAbsoluteTop()+(getHeight()/2)); points.put(Direction.NW, tlp); points.put(Direction.NE,trp); points.put(Direction.SW,blp); points.put(Direction.SE,brp); points.put(Direction.CENTER, mp); return points; }
@Override public IPoint getSouthEastPoint() { return new Point(this.getAbsoluteLeft() + this.getWidth(),this.getAbsoluteLeft() + this.getHeight()); }
public IPoint getSouthEastPoint() { Point p = new Point(this.getAbsoluteLeft()+this.getWidth(), this.getAbsoluteTop()+this.getHeight()); return p; }
public IPoint getSouthEastPoint() { Point p = new Point(this.getAbsoluteLeft()+this.getWidth(), this.getAbsoluteTop()+this.getHeight()); return p; }
public Point getIntesectionPointFromLinearFn(LinearFunction fn1,LinearFunction fn2){ float a = fn2.getA() - fn1.getA(); float b = fn1.getB() - fn2.getB(); float x = b/a; float y = fn1.getFx(x); return new Point(x, y); }
int smallesty = elements.get(0).getAbsoluteTop(); Point nwPoint = new Point(elements.get(0).getAbsoluteLeft() - elements.get(0).getContainer().getAbsoluteLeft() , elements.get(0).getAbsoluteTop() - elements.get(0).getContainer().getAbsoluteTop()); nwPoint = new Point(s.getAbsoluteLeft()-s.getContainer().getAbsoluteLeft(), nwPoint.getY()); nwPoint = new Point(nwPoint.getX(), s.getAbsoluteTop()-s.getContainer().getAbsoluteTop());
@Override public void onDoubleClick(DoubleClickEvent event) { //select actual connector HashMap<String,ISelectable> selectedElements = new HashMap<String,ISelectable>(); selectedElements.put(connector.getId(), connector); connector.getUIPanel().setSelectedElements(selectedElements); Point p = new Point(mouseX+connector.getUIPanel().getScrollLeft()+Window.getScrollLeft()-connector.getUIPanel().getAbsoluteLeft(), mouseY+connector.getUIPanel().getScrollTop()+Window.getScrollTop()-connector.getUIPanel().getAbsoluteTop()); Point p2 = new Point(mouseX,mouseY); ClosestPoints closestPoints = getClosestPoints(p2); connector.fireEvent(new AddWayPointEvent(p, closestPoints .getMinPoint(), closestPoints.getMaxPoint())); } });
Region uipanelRegion = new Region(new Point(panel.getAbsoluteLeft(),panel.getAbsoluteTop()) ,new Point(panel.getAbsoluteLeft()+panel.getClientWidth(), panel.getAbsoluteTop()+panel.getClientHeight())); boolean uiPanelRegionContainsMouse = uipanelRegion.contains(new Point(arg0.getClientX()+Window.getScrollLeft(),arg0.getClientY()+Window.getScrollTop()));
public ClosestPoints getClosestPoints(Point point) { IConnectorPoint minPoint = this.connector.getConnectorStartPoint(); IConnectorPoint currentPoint = minPoint; while (currentPoint.getNextPoint() != null) { Point previousPoint = new Point(currentPoint.getAbsoluteLeft(),currentPoint.getAbsoluteTop()); Point nextPoint = new Point(currentPoint.getNextPoint().getAbsoluteLeft(),currentPoint.getNextPoint().getAbsoluteTop()); Region r = new Region(previousPoint,nextPoint); if (r.contains(point)){ minPoint = currentPoint; break; } currentPoint = currentPoint.getNextPoint(); } IConnectorPoint maxPoint = minPoint.getNextPoint(); ClosestPoints closesPoints = new ClosestPoints(minPoint, maxPoint); return closesPoints; }
int greatesty = (int) (randomS.getAbsoluteTop() + randomS.getHeight()); Point sePoint = new Point((randomS.getAbsoluteLeft()+randomS.getWidth())-randomS.getContainer().getAbsoluteLeft(), (randomS.getAbsoluteTop()+randomS.getHeight())-randomS.getContainer().getAbsoluteTop()); sePoint = new Point((s.getAbsoluteLeft()+s.getWidth())-s.getContainer().getAbsoluteLeft(), sePoint.getY()); sePoint = new Point(sePoint.getX(), (s.getAbsoluteTop()+s.getHeight())-s.getContainer().getAbsoluteTop());