public class Viewport extends Object implements PointTransformation
Constructor and Description |
---|
Viewport(GeometryEditPanel panel) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsInModel(Coordinate p) |
PrecisionModel |
getGridPrecisionModel()
Gets a PrecisionModel corresponding to the grid size.
|
double |
getGridSizeModel() |
double |
getHeightInView() |
Point2D |
getLowerLeftCornerInModel() |
Envelope |
getModelEnv() |
AffineTransform |
getModelToViewTransform() |
double |
getScale() |
NumberFormat |
getScaleFormat() |
Envelope |
getViewEnv() |
double |
getWidthInView() |
int |
gridMagnitudeModel()
Gets the magnitude (power of 10)
for the basic grid size.
|
boolean |
intersectsInModel(Envelope env) |
double |
toModel(double viewDist)
Converts a distance in the view to a distance in the model.
|
Point2D |
toModel(Point2D viewPt) |
Coordinate |
toModelCoordinate(Point2D viewPt) |
Point2D |
toView(Coordinate modelCoordinate) |
double |
toView(double modelDist)
Converts a distance in the model to a distance in the view.
|
Point2D |
toView(Point2D modelPt) |
Point2D |
toView(Point2D modelPt,
Point2D viewPt) |
void |
transform(Coordinate modelCoordinate,
Point2D point)
Transforms a
Coordinate into a Java2D Point . |
void |
update(Dimension viewSize) |
void |
zoom(Envelope zoomEnv) |
void |
zoom(Point2D zoomPt,
double zoomScale)
Zoom to a point, ensuring that the zoom point remains in the same screen location.
|
void |
zoomPan(double dx,
double dy) |
void |
zoomToInitialExtent() |
public Viewport(GeometryEditPanel panel)
public Envelope getModelEnv()
public Envelope getViewEnv()
public double getScale()
public NumberFormat getScaleFormat()
public boolean intersectsInModel(Envelope env)
public Coordinate toModelCoordinate(Point2D viewPt)
public void transform(Coordinate modelCoordinate, Point2D point)
PointTransformation
Coordinate
into a Java2D Point
.transform
in interface PointTransformation
modelCoordinate
- the source Coordinatepoint
- the destination Pointpublic Point2D toView(Coordinate modelCoordinate)
public double toModel(double viewDist)
viewDist
- public double toView(double modelDist)
modelDist
- public void update(Dimension viewSize)
public AffineTransform getModelToViewTransform()
public void zoomToInitialExtent()
public void zoom(Envelope zoomEnv)
public void zoomPan(double dx, double dy)
public void zoom(Point2D zoomPt, double zoomScale)
zoomPt
- zoomFactor
- public Point2D getLowerLeftCornerInModel()
public double getHeightInView()
public double getWidthInView()
public boolean containsInModel(Coordinate p)
public int gridMagnitudeModel()
public PrecisionModel getGridPrecisionModel()
public double getGridSizeModel()
Copyright © 2018. All rights reserved.