public double snapScale(double coef) { if (getBackingUrl() != null && !getBackingUrl().isEmpty()) { double powValue = Math.log(coef) / Math.log(2); Long lPowValue = Math.round(powValue); return Math.pow(2, lPowValue); } else { return coef; } }
public Point cartesian2Screen(Point2D.Double aPt) throws FactoryException, TransformException { Point2D.Double screenPt = new Point2D.Double(); cartesian2Screen.transform(aPt, screenPt); return new Point((int) Math.round(screenPt.getX()), (int) Math.round(screenPt.getY())); }