protected DiagramNode parseBounds(Element boundsElement) { DiagramNode bounds = new DiagramNode(); bounds.setX(Double.valueOf(boundsElement.getAttribute("x"))); bounds.setY(Double.valueOf(boundsElement.getAttribute("y"))); bounds.setWidth(Double.valueOf(boundsElement.getAttribute("width"))); bounds.setHeight(Double.valueOf(boundsElement.getAttribute("height"))); return bounds; }
protected DiagramNode parseBounds(Element boundsElement) { DiagramNode bounds = new DiagramNode(); bounds.setX(Double.valueOf(boundsElement.getAttribute("x"))); bounds.setY(Double.valueOf(boundsElement.getAttribute("y"))); bounds.setWidth(Double.valueOf(boundsElement.getAttribute("width"))); bounds.setHeight(Double.valueOf(boundsElement.getAttribute("height"))); return bounds; }
DiagramNode diagramBounds = new DiagramNode("BPMNDiagram"); diagramBounds.setX(minX); diagramBounds.setY(minY);
DiagramNode diagramBounds = new DiagramNode("BPMNDiagram"); diagramBounds.setX(minX); diagramBounds.setY(minY);
DiagramNode diagramBoundsImage = new DiagramNode(); diagramBoundsImage.setX((double) marginLeft); diagramBoundsImage.setY((double) marginTop);
DiagramNode diagramBoundsImage = new DiagramNode(); diagramBoundsImage.setX((double) marginLeft); diagramBoundsImage.setY((double) marginTop);
protected DiagramNode transformBoundsForImage(DiagramNode diagramBoundsImage, DiagramNode diagramBoundsXml, DiagramNode elementBounds) { double scalingFactorX = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); double scalingFactorY = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); DiagramNode elementBoundsForImage = new DiagramNode(elementBounds.getId()); elementBoundsForImage.setX((double) Math.round((elementBounds.getX() - diagramBoundsXml.getX()) * scalingFactorX + diagramBoundsImage.getX())); elementBoundsForImage.setY((double) Math.round((elementBounds.getY() - diagramBoundsXml.getY()) * scalingFactorY + diagramBoundsImage.getY())); elementBoundsForImage.setWidth((double) Math.round(elementBounds.getWidth() * scalingFactorX)); elementBoundsForImage.setHeight((double) Math.round(elementBounds.getHeight() * scalingFactorY)); return elementBoundsForImage; }
protected DiagramNode transformBoundsForImage(DiagramNode diagramBoundsImage, DiagramNode diagramBoundsXml, DiagramNode elementBounds) { double scalingFactorX = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); double scalingFactorY = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); DiagramNode elementBoundsForImage = new DiagramNode(elementBounds.getId()); elementBoundsForImage.setX((double) Math.round((elementBounds.getX() - diagramBoundsXml.getX()) * scalingFactorX + diagramBoundsImage.getX())); elementBoundsForImage.setY((double) Math.round((elementBounds.getY() - diagramBoundsXml.getY()) * scalingFactorY + diagramBoundsImage.getY())); elementBoundsForImage.setWidth((double) Math.round(elementBounds.getWidth() * scalingFactorX)); elementBoundsForImage.setHeight((double) Math.round(elementBounds.getHeight() * scalingFactorY)); return elementBoundsForImage; }
protected DiagramNode parseBounds(Element boundsElement) { DiagramNode bounds = new DiagramNode(); bounds.setX(Double.valueOf(boundsElement.getAttribute("x"))); bounds.setY(Double.valueOf(boundsElement.getAttribute("y"))); bounds.setWidth(Double.valueOf(boundsElement.getAttribute("width"))); bounds.setHeight(Double.valueOf(boundsElement.getAttribute("height"))); return bounds; }
DiagramNode diagramBounds = new DiagramNode("BPMNDiagram"); diagramBounds.setX(minX); diagramBounds.setY(minY);
DiagramNode diagramBoundsImage = new DiagramNode(); diagramBoundsImage.setX((double) marginLeft); diagramBoundsImage.setY((double) marginTop);
protected DiagramNode transformBoundsForImage(DiagramNode diagramBoundsImage, DiagramNode diagramBoundsXml, DiagramNode elementBounds) { double scalingFactorX = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); double scalingFactorY = diagramBoundsImage.getWidth() / diagramBoundsXml.getWidth(); DiagramNode elementBoundsForImage = new DiagramNode(elementBounds.getId()); elementBoundsForImage.setX((double) Math.round((elementBounds.getX() - diagramBoundsXml.getX()) * scalingFactorX + diagramBoundsImage.getX())); elementBoundsForImage.setY((double) Math.round((elementBounds.getY() - diagramBoundsXml.getY()) * scalingFactorY + diagramBoundsImage.getY())); elementBoundsForImage.setWidth((double) Math.round(elementBounds.getWidth() * scalingFactorX)); elementBoundsForImage.setHeight((double) Math.round(elementBounds.getHeight() * scalingFactorY)); return elementBoundsForImage; }