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; }
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; }
diagramBounds.setY(minY); diagramBounds.setWidth(maxX - minX); diagramBounds.setHeight(maxY - minY); return diagramBounds;
diagramBoundsImage.setY((double) marginTop); diagramBoundsImage.setWidth((double) (width - marginRight - marginLeft)); diagramBoundsImage.setHeight((double) (height - marginBottom - marginTop)); return diagramBoundsImage;
diagramBounds.setY(minY); diagramBounds.setWidth(maxX - minX); diagramBounds.setHeight(maxY - minY); return diagramBounds;
diagramBounds.setY(minY); diagramBounds.setWidth(maxX - minX); diagramBounds.setHeight(maxY - minY); return diagramBounds;
diagramBoundsImage.setY((double) marginTop); diagramBoundsImage.setWidth((double) (width - marginRight - marginLeft)); diagramBoundsImage.setHeight((double) (height - marginBottom - marginTop)); return diagramBoundsImage;
diagramBoundsImage.setY((double) marginTop); diagramBoundsImage.setWidth((double) (width - marginRight - marginLeft)); diagramBoundsImage.setHeight((double) (height - marginBottom - marginTop)); return diagramBoundsImage;
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 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; }