Display.map

Maps a point from one coordinate system to another. When the control is null, coordinates are mapped to the display. <p> NOTE: On right-to-left platforms where the coordinate systems are mirrored, special care needs to be taken when mapping coordinates from one control to another to ensure the result is correctly mirrored.

Mapping a point that is the origin of a rectangle and then adding the width and height is not equivalent to mapping the rectangle. When one control is mirrored and the other is not, adding the width and height to a point that was mapped causes the rectangle to extend in the wrong direction. Mapping the entire rectangle instead of just one point causes both the origin and the corner of the rectangle to be mapped. </p>

@param from the source <code>Control</code> or <code>null</code> @param to the destination <code>Control</code> or <code>null</code> @param x coordinates to be mapped @param y coordinates to be mapped @return point with mapped coordinates

@exception IllegalArgumentException <ul> <li>ERROR_INVALID_ARGUMENT - if the Control from or the Control to have been disposed</li> </ul> @exception SWTException <ul> <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li> </ul>

@since 2.1.2

Meta