public void setBounds(Bounds rect) { this.shape = di.createBPMNShape(); shape.setId(Ids.bpmnShape(getId())); shape.setBpmnElement(baseElement); org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); Bound upperLeft = rect.getUpperLeft(); Bound lowerRight = rect.getLowerRight(); bounds.setX(upperLeft.getX().floatValue()); bounds.setY(upperLeft.getY().floatValue()); bounds.setWidth(lowerRight.getX().floatValue() - upperLeft.getX().floatValue()); bounds.setHeight(lowerRight.getY().floatValue() - upperLeft.getY().floatValue()); shape.setBounds(bounds); }
parser.nextToken(); parser.nextToken(); Bounds b = DcFactory.eINSTANCE.createBounds(); b.setX(x1); b.setY(y1);
private Bounds boundsOf(float x, float y, float width, float height) { Bounds bounds = dc.createBounds(); bounds.setX(x); bounds.setY(y); bounds.setWidth(width); bounds.setHeight(height); return bounds; } }
protected org.eclipse.dd.dc.Bounds getParentActivityBounds(org.eclipse.dd.dc.Bounds parentRect) { if (getShape().getBounds() == null) { throw new IllegalArgumentException( "Cannot set parent bounds if the child " + "has undefined bounds. Use setBounds() first."); } org.eclipse.dd.dc.Bounds relativeBounds = getShape().getBounds(); float x = relativeBounds.getX(); float y = relativeBounds.getY(); float width = relativeBounds.getWidth(); float height = relativeBounds.getHeight(); float parentX = parentRect.getX(); float parentY = parentRect.getY(); org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); bounds.setX(parentX + x - width / 2); bounds.setY(parentY + y - height / 2); bounds.setWidth(width); bounds.setHeight(height); return bounds; }
protected org.eclipse.dd.dc.Bounds getParentBounds(org.eclipse.dd.dc.Bounds parentRect) { if (getShape() == null) { throw new NullPointerException( "Shape is null:" + getElement().getId()); } if (getShape().getBounds() == null) { throw new IllegalArgumentException( "Cannot set parent bounds if the child " + "has undefined bounds. Use setBounds() first." + getElement().getId()); } org.eclipse.dd.dc.Bounds relativeBounds = getShape().getBounds(); float x = relativeBounds.getX(); float y = relativeBounds.getY(); float width = relativeBounds.getWidth(); float height = relativeBounds.getHeight(); float parentX = parentRect.getX(); float parentY = parentRect.getY(); org.eclipse.dd.dc.Bounds bounds = dc.createBounds(); bounds.setX(parentX + x); bounds.setY(parentY + y); bounds.setWidth(width); bounds.setHeight(height); return bounds; }