public void getSourceMatrix(final double[] aSource) { PNode.this.getTransformReference(true).getMatrix(aSource); } };
/** * Offset this node relative to the parents coordinate system, and is NOT * effected by this nodes current scale or rotation. This is implemented by * directly adding dx to the m02 position and dy to the m12 position in the * affine transform. * * @param dx amount to add to this nodes current x Offset * @param dy amount to add to this nodes current y Offset */ public void offset(final double dx, final double dy) { getTransformReference(true); setOffset(transform.getTranslateX() + dx, transform.getTranslateY() + dy); }
/** * Transform this nodes transform by the given transform. * * @param aTransform the transform to apply. */ public void transformBy(final AffineTransform aTransform) { getTransformReference(true).concatenate(aTransform); invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, transform); }
final PAffineTransform at = new PAffineTransform(getTransformReference(true)); at.translate(dx, dy); return animateToTransform(at, millis);
/** * Scale this nodes transform by the given amount about the specified point. * This will affect this node and all of its descendants. * * @param scale the amount to scale by * @param x the x coordinate of the point around which to scale * @param y the y coordinate of the point around which to scale */ public void scaleAboutPoint(final double scale, final double x, final double y) { getTransformReference(true).scaleAboutPoint(scale, x, y); invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, transform); }
/** * Rotates this node by theta (in radians) about the given point. This will * affect this node and all its descendants. * * @param theta the amount to rotate by in radians * @param x the x coordinate of the point around which to rotate * @param y the y coordinate of the point around which to rotate */ public void rotateAboutPoint(final double theta, final double x, final double y) { getTransformReference(true).rotate(theta, x, y); invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, transform); }
/** * Translate this node's transform by the given amount, using the standard * affine transform translate method. This translation effects this node and * all of its descendants. * * @param dx amount to add to this nodes current x translation * @param dy amount to add to this nodes current y translation */ public void translate(final double dx, final double dy) { getTransformReference(true).translate(dx, dy); invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, transform); }
/** * Set the transform applied to this node. * * @param transform the new transform value */ public void setTransform(final AffineTransform transform) { if (transform == null) { this.transform = null; } else { getTransformReference(true).setTransform(transform); } invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, this.transform); }
/** * Set the offset that is being applied to this node by its transform. This * offset effects this node and all of its descendants and is specified in * the nodes parent coordinate system. This directly sets the values of the * m02 and m12 positions in the affine transform. Unlike "PNode.translate()" * it is not effected by the transforms scale. * * @param x amount of x offset * @param y amount of y offset */ public void setOffset(final double x, final double y) { getTransformReference(true).setOffset(x, y); invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_TRANSFORM, PROPERTY_TRANSFORM, null, transform); }