XAffineTransform.round(at, 1e-6); LOGGER.log(Level.FINE, "Optimizing the warp into an affine transformation: {0}", at); return new WarpAffine(at);
/** * Checks the transformation is a pure scale/translate instance (using a tolerance) * @param transform * @return */ private boolean isScaleTranslate(MathTransform transform) { if(!(transform instanceof AffineTransform)) return false; final AffineTransform at = new AffineTransform((AffineTransform) transform); XAffineTransform.round(at, EPS); final double rotation= XAffineTransform.getRotation(at); final boolean retVal =(Math.abs(rotation)==0); return retVal; }
XAffineTransform.round(gridToWorldTransform, ROTATION_EPS); final double rotation = XAffineTransform.getRotation(gridToWorldTransform); if (swapXY == -1)
XAffineTransform.round(logical); transform(logical);
/** * Changes the {@linkplain #zoom} by applying an affine transform. The {@code change} transform * must express a change in logical units, for example, a translation in metres. This method is * conceptually similar to the following code: * * <pre> * {@link #zoom}.{@link AffineTransform#concatenate(AffineTransform) concatenate}(change); * {@link #fireZoomChanged(AffineTransform) fireZoomChanged}(change); * {@link #repaint() repaint}({@link #getZoomableBounds getZoomableBounds}(null)); * </pre> * * @param change The zoom change, as an affine transform in logical coordinates. If * {@code change} is the identity transform, then this method does nothing and * listeners are not notified. */ public void transform(final AffineTransform change) { if (!change.isIdentity()) { zoom.concatenate(change); XAffineTransform.round(zoom); fireZoomChanged(change); repaint(getZoomableBounds()); zoomIsReset = false; } }
change.translate((mask & TRANSLATE_X) != 0 ? -source.getCenterX() : 0, (mask & TRANSLATE_Y) != 0 ? -source.getCenterY() : 0); XAffineTransform.round(change); return change;
XAffineTransform.round(change); transform(change);
XAffineTransform.round(gridToWorldTransform, ROTATION_EPS); final double rotation = XAffineTransform .getRotation(gridToWorldTransform);
XAffineTransform.round(gridToWorldTransform, ROTATION_EPS); final double rotation = XAffineTransform .getRotation(gridToWorldTransform);