/** Set the target direct position to the specified value. */ public void setTarget(final DirectPosition point) { if (source instanceof DirectPosition2D) { ((DirectPosition2D) target).setLocation(point); } else { ((GeneralDirectPosition) target).setLocation(point); } }
/** Set the source direct position to the specified value. */ public void setSource(final DirectPosition point) { if (source instanceof DirectPosition2D) { ((DirectPosition2D) source).setLocation(point); } else { ((GeneralDirectPosition) source).setLocation(point); } }
/** * Returns the "real world" mouse's position. The coordinates are expressed * in Context's CoordinateSystem. * * @param dest A pre-allocated variable to store the mouse's location * in CoordinateSystems, can be set to <code>null</code>. * @return The mouse's location in CoordinateSystem coordinates. * @throws TransformException when transform is invalid. */ public GeneralDirectPosition getMapCoordinate(GeneralDirectPosition dest) throws TransformException { if (dest == null) { dest = new GeneralDirectPosition(getX(), getY()); } else { dest.setLocation(new Point2D.Double(getX(), getY())); } transform.transform(dest, dest); return dest; } }