|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.image.gui.ImageCoordinateConverter
public class ImageCoordinateConverter
This utility class may be used by classes that display images to convert between different coordinate systems, optionally including world coordinates. Methods are available for converting between the following coordinate systems:
Field Summary |
---|
Fields inherited from interface jsky.coords.CoordinateConverter |
---|
CANVAS, IMAGE, SCREEN, USER, WORLD |
Constructor Summary | |
---|---|
ImageCoordinateConverter(BasicImageDisplay imageDisplay)
|
Method Summary | |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Register to receive change events from this object whenever the the WCS information is changed. |
void |
assertWCS()
Throw an exception is WCS information is not available |
void |
canvasToImageCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to image coordinates. |
void |
canvasToScreenCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to screen coordinates. |
void |
canvasToUserCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to user coordinates. |
void |
canvasToWorldCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given canvas coordinates to world coordinates degrees in the equinox of the current image. |
void |
convertCoords(java.awt.geom.Point2D.Double p,
int inType,
int outType,
boolean isDistance)
Convert the given coordinates from inType to outType. |
protected void |
fireChange()
Notify any listeners of a change in the WCS information. |
void |
flip(java.awt.geom.Point2D.Double p)
Flip the x,y coordinates of the given point based on the current settings. |
double |
getEquinox()
Return the equinox used for coordinates (usually the equionx of the image) |
double |
getHeight()
Return the height in pixels |
double |
getHeightInDeg()
Return the height in deg |
java.awt.geom.Point2D.Double |
getImageCenter()
Return the center coordinates in image pixels. |
BasicImageDisplay |
getImageDisplay()
Return the target image display |
java.awt.geom.Point2D.Double |
getWCSCenter()
Return the center RA,Dec coordinates in degrees. |
double |
getWidth()
Return the width in pixels |
double |
getWidthInDeg()
Return the width in deg |
void |
imageToCanvasCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to canvas coordinates. |
void |
imageToScreenCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to screen coordinates. |
void |
imageToUserCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to user coordinates. |
void |
imageToWorldCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given image coordinates to world coordinates degrees in the equinox of the current image. |
boolean |
isWCS()
Return true if world coordinates conversion is available. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Stop receiving change events from this object. |
void |
rotate(java.awt.geom.Point2D.Double p,
int factor)
Rotate the given point about the image center by the current rotation angle, multiplied by the given factor. |
void |
screenToCanvasCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to canvas coordinates. |
void |
screenToImageCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to image coordinates. |
void |
screenToUserCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to user coordinates. |
void |
screenToWorldCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given screen coordinates to world coordinates degrees in the equinox of the current image. |
void |
userToCanvasCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to canvas coordinates. |
void |
userToImageCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to image coordinates. |
void |
userToScreenCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to screen coordinates. |
void |
userToWorldCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given user coordinates to world coordinates degrees in the equinox of the current image. |
void |
worldToCanvasCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to canvas coordinates. |
void |
worldToImageCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to image coordinates. |
void |
worldToScreenCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to screen coordinates. |
void |
worldToUserCoords(java.awt.geom.Point2D.Double p,
boolean isDistance)
Convert the given world coordinates (degrees, in the equinox of the current image) to user coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageCoordinateConverter(BasicImageDisplay imageDisplay)
Method Detail |
---|
public BasicImageDisplay getImageDisplay()
public void addChangeListener(javax.swing.event.ChangeListener l)
public void removeChangeListener(javax.swing.event.ChangeListener l)
protected void fireChange()
public boolean isWCS()
isWCS
in interface WorldCoordinateConverter
public java.awt.geom.Point2D.Double getWCSCenter()
getWCSCenter
in interface WorldCoordinateConverter
public java.awt.geom.Point2D.Double getImageCenter()
getImageCenter
in interface WorldCoordinateConverter
public double getEquinox()
getEquinox
in interface WorldCoordinateConverter
public double getWidthInDeg()
getWidthInDeg
in interface WorldCoordinateConverter
public double getHeightInDeg()
getHeightInDeg
in interface WorldCoordinateConverter
public double getWidth()
getWidth
in interface WorldCoordinateConverter
public double getHeight()
getHeight
in interface WorldCoordinateConverter
public void convertCoords(java.awt.geom.Point2D.Double p, int inType, int outType, boolean isDistance)
convertCoords
in interface CoordinateConverter
p
- The point to convert.inType
- the type of the input coordinatesoutType
- the type of the output coordinatesisDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToImageCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
canvasToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToImageCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
userToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToUserCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
canvasToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToCanvasCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
userToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToCanvasCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
imageToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToUserCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
imageToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToScreenCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
canvasToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToCanvasCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
screenToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToImageCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
screenToImageCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToScreenCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
imageToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToUserCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
screenToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToScreenCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
userToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void imageToWorldCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
imageToWorldCoords
in interface WorldCoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void screenToWorldCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
screenToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void canvasToWorldCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
canvasToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void userToWorldCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
userToWorldCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToImageCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
worldToImageCoords
in interface WorldCoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToCanvasCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
worldToCanvasCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToScreenCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
worldToScreenCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void worldToUserCoords(java.awt.geom.Point2D.Double p, boolean isDistance)
worldToUserCoords
in interface CoordinateConverter
p
- The point to convert.isDistance
- True if p should be interpreted as a distance instead
of a point.public void flip(java.awt.geom.Point2D.Double p)
public void rotate(java.awt.geom.Point2D.Double p, int factor)
p
- the point to rotatefactor
- set to 1 to rotate, -1 to undo the rotationpublic void assertWCS()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |