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); }
private static org.eclipse.dd.dc.Point pointOf(double x, double y) { org.eclipse.dd.dc.Point pt = dc.createPoint(); pt.setX((float) x); pt.setY((float) y); return pt; } }
parser.nextToken(); parser.nextToken(); Bounds b = DcFactory.eINSTANCE.createBounds(); b.setX(x1); b.setY(y1); parser.nextToken(); Integer y = parser.getIntValue(); Point point = DcFactory.eINSTANCE.createPoint(); point.setX(x); point.setY(y);
private Point pointOf(float x, float y) { Point point = dc.createPoint(); point.setX(x); point.setY(y); return point; }
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; } }
private static Point pointOf(double x, double y) { Point point = dc.createPoint(); point.setX((float) x); point.setY((float) y); return point; } }
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; }
private void createBpmnEdgeForAssociation(BpmnDiFactory factory, BPMNPlane plane, Association association) { BPMNEdge edge = factory.createBPMNEdge(); edge.setBpmnElement(association); DcFactory dcFactory = DcFactory.eINSTANCE; Point point = dcFactory.createPoint(); Bounds sourceBounds = _bounds.get(association.getSourceRef().getId()); point.setX(sourceBounds.getX() + (sourceBounds.getWidth() / 2)); point.setY(sourceBounds.getY() + (sourceBounds.getHeight() / 2)); edge.getWaypoint().add(point); List<Point> dockers = _dockers.get(association.getId()); for (int i = 1; i < dockers.size() - 1; i++) { edge.getWaypoint().add(dockers.get(i)); } point = dcFactory.createPoint(); Bounds targetBounds = _bounds.get(association.getTargetRef().getId()); point.setX(targetBounds.getX() + (targetBounds.getWidth() / 2)); point.setY(targetBounds.getY() + (targetBounds.getHeight() / 2)); edge.getWaypoint().add(point); plane.getPlaneElement().add(edge); }
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; }
edge.setBpmnElement(sequenceFlow); DcFactory dcFactory = DcFactory.eINSTANCE; Point point = dcFactory.createPoint(); List<Point> dockers = _dockers.get(sequenceFlow.getId()); if (sequenceFlow.getSourceRef() != null) { edge.getWaypoint().add(dockers.get(i)); point = dcFactory.createPoint(); if (sequenceFlow.getTargetRef() != null) { Bounds targetBounds = _bounds.get(sequenceFlow.getTargetRef().getId());