public Boolean getFlipX() { if (_flipX == null && _masterShape != null) { return _masterShape.getFlipX(); } return _flipX; }
/** * Returns a transform that can translate shape-local coordinates to the * coordinates of its parent shape */ protected AffineTransform getParentTransform() { // TODO: There's probably a better way to do this AffineTransform tr = new AffineTransform(); Double locX = getLocPinX(); Double locY = getLocPinY(); Boolean flipX = getFlipX(); Boolean flipY = getFlipY(); Double angle = getAngle(); tr.translate(-locX, -locY); tr.translate(getPinX(), getPinY()); // rotate about the origin if (angle != null && Math.abs(angle) > 0.001) { tr.rotate(angle, locX, locY); } // flip if necessary if (flipX != null && flipX) { tr.scale(-1, 1); tr.translate(-getWidth(), 0); } if (flipY != null && flipY) { tr.scale(1, -1); tr.translate(0, -getHeight()); } return tr; }
public Boolean getFlipX() { if (_flipX == null && _masterShape != null) { return _masterShape.getFlipX(); } return _flipX; }
/** * Returns a transform that can translate shape-local coordinates to the * coordinates of its parent shape */ protected AffineTransform getParentTransform() { // TODO: There's probably a better way to do this AffineTransform tr = new AffineTransform(); Double locX = getLocPinX(); Double locY = getLocPinY(); Boolean flipX = getFlipX(); Boolean flipY = getFlipY(); Double angle = getAngle(); tr.translate(-locX, -locY); tr.translate(getPinX(), getPinY()); // rotate about the origin if (angle != null && Math.abs(angle) > 0.001) { tr.rotate(angle, locX, locY); } // flip if necessary if (flipX != null && flipX) { tr.scale(-1, 1); tr.translate(-getWidth(), 0); } if (flipY != null && flipY) { tr.scale(1, -1); tr.translate(0, -getHeight()); } return tr; }