|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.view.geoloc.Navigation
public class Navigation
Consider this a private inner class of NavigatedPanel. Handle display to world coordinate transformation, always linear. throw NewMapAreaEvent when MapArea changes allow setMapArea() to be called; this will also trigger a NewMapAreaEvent
| Constructor Summary | |
|---|---|
Navigation()
Create a new navigation. |
|
| Method Summary | |
|---|---|
void |
addNewMapAreaListener(NewMapAreaListener l)
Add a NewMapAreaListener. |
AffineTransform |
calcTransform(boolean rotate,
double displayX,
double displayY,
double displayWidth,
double displayHeight)
Calculate an affine transform based on the display size parameters - used for printing. |
ucar.unidata.geoloc.ProjectionRect |
getMapArea(ucar.unidata.geoloc.ProjectionRect rect)
Get current MapArea . |
double |
getScreenHeight()
Get the screen height |
double |
getScreenWidth()
Get the screen width |
AffineTransform |
getTransform()
Get the affine transform based on screen size and world bounding box |
void |
moveDown()
Move down |
void |
moveDown(double factor)
Move down |
void |
moveLeft()
Move left. |
void |
moveLeft(double factor)
Move left. |
void |
moveRight()
Move right. |
void |
moveRight(double factor)
Move right. |
void |
moveUp()
Move up. |
void |
moveUp(double factor)
Move up. |
void |
pan(double deltax,
double deltay)
Call this to change the center of the screen's world coordinates. |
void |
removeNewMapAreaListener(NewMapAreaListener l)
Remove a NewMapAreaListener. |
ucar.unidata.geoloc.ProjectionPointImpl |
screenToWorld(Point2D p)
Convert a display point to a world coordinate |
ucar.unidata.geoloc.ProjectionPointImpl |
screenToWorld(Point2D p,
ucar.unidata.geoloc.ProjectionPointImpl w)
Convert a display point to a world coordinate |
Rectangle2D |
screenToWorld(Rectangle2D screenRect)
Convert a display region to a world coordinate |
void |
setMapArea(Rectangle2D ma)
Set the map area |
void |
setScreenSize(double pwidth,
double pheight)
Set the screen size |
boolean |
wantRotate(double displayWidth,
double displayHeight)
Calculate if we want to rotate based on aspect ratio |
Point2D |
worldToScreen(ucar.unidata.geoloc.ProjectionPointImpl w)
Convert a world coordinate to a display point |
Point2D |
worldToScreen(ucar.unidata.geoloc.ProjectionPointImpl w,
Point2D p)
Convert a world coordinate to a display point |
Rectangle2D |
worldToScreen(Rectangle2D screenRect)
Convert a world coordinate to screen |
void |
zoom(double scale)
Zoom to a default scale. |
void |
zoom(double startx,
double starty,
double width,
double height)
Call this to zoom into a subset of the screen. |
void |
zoomIn()
Zoom in default amount. |
void |
zoomIn(double x,
double y)
Zoom in to a point. |
void |
zoomOut()
Zoom out default amount. |
void |
zoomOut(double x,
double y)
Zoom out from a point. |
void |
zoomPrevious()
Zoom to the previous zoom. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Navigation()
| Method Detail |
|---|
public void addNewMapAreaListener(NewMapAreaListener l)
NewMapAreaListener.
l - listener to addpublic void removeNewMapAreaListener(NewMapAreaListener l)
NewMapAreaListener.
l - listener to removepublic double getScreenWidth()
public double getScreenHeight()
public void setScreenSize(double pwidth,
double pheight)
pwidth - width (pixels)pheight - height (pixels)public AffineTransform getTransform()
public boolean wantRotate(double displayWidth,
double displayHeight)
displayWidth - width of displaydisplayHeight - height of display
public AffineTransform calcTransform(boolean rotate,
double displayX,
double displayY,
double displayWidth,
double displayHeight)
rotate - should the page be rotateddisplayX - upper right corner XdisplayY - upper right corner YdisplayWidth - display widthdisplayHeight - display height
public ucar.unidata.geoloc.ProjectionRect getMapArea(ucar.unidata.geoloc.ProjectionRect rect)
rect - place results here, or null to create new Object
public void setMapArea(Rectangle2D ma)
ma - new map areapublic Point2D worldToScreen(ucar.unidata.geoloc.ProjectionPointImpl w)
w - world coordinate
public Point2D worldToScreen(ucar.unidata.geoloc.ProjectionPointImpl w,
Point2D p)
w - world coordinatep - projection
public ucar.unidata.geoloc.ProjectionPointImpl screenToWorld(Point2D p,
ucar.unidata.geoloc.ProjectionPointImpl w)
p - display pointw - projection
public ucar.unidata.geoloc.ProjectionPointImpl screenToWorld(Point2D p)
p - display point
public Rectangle2D screenToWorld(Rectangle2D screenRect)
screenRect - display region
public Rectangle2D worldToScreen(Rectangle2D screenRect)
screenRect - world region
public void pan(double deltax,
double deltay)
deltax - display coordinate x shiftdeltay - display coordinate y shift
public void zoom(double startx,
double starty,
double width,
double height)
startx - upper left x box coordstarty - upper left y box coordwidth - width of boxheight - size of box
public void zoomIn(double x,
double y)
zoomIn()
x - x coordinate of pointy - y coordinate of point
public void zoomOut(double x,
double y)
zoomIn()
x - x coordinate of pointy - y coordinate of pointpublic void zoomIn()
public void zoomOut()
public void zoom(double scale)
scale - to zoompublic void moveDown()
public void moveDown(double factor)
factor - how much to movepublic void moveUp()
public void moveUp(double factor)
factor - how much to movepublic void moveRight()
public void moveRight(double factor)
factor - how much to movepublic void moveLeft()
public void moveLeft(double factor)
factor - how much to movepublic void zoomPrevious()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||