jview
Interface NormalizedCoordinates

All Known Subinterfaces:
UserCoordinates
All Known Implementing Classes:
JAltAzTelescope, JBoxedCanvas, JCameraCanvas, JDataCanvas, JExpressionCanvas, JFilterWheel, JFitsCanvas, JFrameCanvas, JGuiderCanvas, JGuiderOffsets, JNight, JNormalizedCanvas, JQuadrants, JSkyCanvas, JSkyGrid, JTargetHistory, JTrackingFrequencies, JViewportCanvas, JWeatherCanvas

public interface NormalizedCoordinates

Classes that implement this interface must know hoe to provide on-screen coordinates to normalized coordinates and vice versa. The methods should return fast, as this is the interface from a customized mouse cursor to an component.


Method Summary
 Rectangle getArea()
          Returns the size and position of the on-screen location of the drawable canvas.
 Point2D getNormalized(Point screen)
          Converts from screen pixels into normalized space.
 Rectangle2D getNormalizedRect(Rectangle screen)
          Converts a rectangular area from screen pixel into normalized space.
 Point getScreen(Point2D normalized)
          Converts normalized coordinates into on-screen coordinates.
 Rectangle getScreenRect(Rectangle2D normalized)
          Converts a rectangular area from normalized coordinates into screen pixel.
 Rectangle2D getViewport()
          Returns the part of the normalized coordinate space that is currently visible.
 boolean isNormalizedOnScreen(Point2D visible)
          Test if this normalized pixel is related to a on-screen pixel that is within the drawable region.
 boolean isScreenInNormalized(Point cursor)
          Test, if a given screen point is within the currently visible normalized coordinate space.
 

Method Detail

getArea

Rectangle getArea()
Returns the size and position of the on-screen location of the drawable canvas. This is the area, where normalized objects are drawn.

See Also:
Zoomable

getViewport

Rectangle2D getViewport()
Returns the part of the normalized coordinate space that is currently visible.

See Also:
Zoomable

getNormalized

Point2D getNormalized(Point screen)
Converts from screen pixels into normalized space. Thus, the input type is a pure Point object, while the return value is a Point2D object.

Parameters:
screen - A point on the screen.
Returns:
This point in normalized space, 0≤x,y&le1.

getScreen

Point getScreen(Point2D normalized)
Converts normalized coordinates into on-screen coordinates. Thus, the input type is a Point2D object, while we return a Point object.

Parameters:
normalized - A point in normalized space, 0≤x,y&le1.
Returns:
This point on the screen.

getNormalizedRect

Rectangle2D getNormalizedRect(Rectangle screen)
Converts a rectangular area from screen pixel into normalized space. Thus, the input is a Rectangle object, whilst the return value is a Rectangle2D object.

Parameters:
screen - A rectangle on the screen.
Returns:
This rectangle in normalized coordinate space.

getScreenRect

Rectangle getScreenRect(Rectangle2D normalized)
Converts a rectangular area from normalized coordinates into screen pixel. Thus, the input is a Rectangle2D object, whilst the return value is a Rectangle object.

Parameters:
normalized - A rectangle in normalized coordinate space.
Returns:
This rectangle on the screen.

isScreenInNormalized

boolean isScreenInNormalized(Point cursor)
Test, if a given screen point is within the currently visible normalized coordinate space. This is useful for testing if a cursor hot-point is visible.

Parameters:
cursor - A point on the screen.

isNormalizedOnScreen

boolean isNormalizedOnScreen(Point2D visible)
Test if this normalized pixel is related to a on-screen pixel that is within the drawable region.

Parameters:
visible - A point in normalized space, 0≤x,y&le1.