+ private Rectangle2D calculateBounds(Rectangle2D rect) {
+ Point2D calcPoint = DistrictNetworkNodeUtils.calculatePoint2D(vertex.getPoint(), point);
+ AffineTransform at = NodeUtil.getLocalToGlobalTransform(this);
+ at.concatenate(MapScalingTransform.INSTANCE);
+ double x = calcPoint.getX();
+ double y = calcPoint.getY();
+ double scaleRecip = DistrictNetworkNodeUtils.calculateScaleRecip(at);
+ double widthh = width * scaleRecip * nodeSize;
+ double heighth = height * scaleRecip * nodeSize;
+ if (rect == null)
+ rect = new Rectangle2D.Double();
+ rect.setRect(x - widthh/2, y - heighth/2, widthh, heighth);
+ return rect;