public class Viewport extends Object implements Java2DConverter.PointConverter
| Constructor and Description |
|---|
Viewport(LayerViewPanel panel) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ViewportListener l) |
com.vividsolutions.jts.geom.Envelope |
fullExtent() |
com.vividsolutions.jts.geom.Envelope |
getEnvelopeInModelCoordinates() |
Java2DConverter |
getJava2DConverter() |
AffineTransform |
getModelToViewTransform() |
Point2D |
getOriginInModelCoordinates() |
LayerViewPanel |
getPanel() |
double |
getScale() |
ZoomHistory |
getZoomHistory() |
void |
initialize(double newScale,
Point2D newViewOriginAsPerceivedByModel)
Set both values but repaint once.
|
static AffineTransform |
modelToViewTransform(double scale,
Point2D viewOriginAsPerceivedByModel,
double panelHeight) |
void |
removeListener(ViewportListener l) |
com.vividsolutions.jts.geom.Coordinate |
toModelCoordinate(Point2D viewPoint) |
com.vividsolutions.jts.geom.Envelope |
toModelEnvelope(double x1,
double x2,
double y1,
double y2) |
Point2D |
toModelPoint(Point2D viewPoint) |
Point2D |
toViewPoint(com.vividsolutions.jts.geom.Coordinate modelCoordinate) |
Point2D |
toViewPoint(Point2D modelPoint) |
Collection |
toViewPoints(Collection modelCoordinates) |
Rectangle2D |
toViewRectangle(com.vividsolutions.jts.geom.Envelope envelope) |
void |
update() |
void |
zoom(com.vividsolutions.jts.geom.Envelope modelEnvelope) |
void |
zoom(Point2D centreOfNewViewAsPerceivedByOldView,
double widthOfNewViewAsPerceivedByOldView,
double heightOfNewViewAsPerceivedByOldView)
Of widthOfNewViewAsPerceivedByOldView and heightOfNewViewAsPerceivedByOldView,
this method will choose the one producing the least zoom.
|
void |
zoomToFullExtent() |
void |
zoomToViewPoint(Point2D centreOfNewViewAsPerceivedByOldView,
double zoomFactor) |
public Viewport(LayerViewPanel panel)
public LayerViewPanel getPanel()
public void addListener(ViewportListener l)
public void removeListener(ViewportListener l)
public Java2DConverter getJava2DConverter()
public ZoomHistory getZoomHistory()
public void update()
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic static AffineTransform modelToViewTransform(double scale, Point2D viewOriginAsPerceivedByModel, double panelHeight)
public double getScale()
public void initialize(double newScale,
Point2D newViewOriginAsPerceivedByModel)
public Point2D getOriginInModelCoordinates()
public void zoom(Point2D centreOfNewViewAsPerceivedByOldView, double widthOfNewViewAsPerceivedByOldView, double heightOfNewViewAsPerceivedByOldView) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic Point2D toModelPoint(Point2D viewPoint) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic com.vividsolutions.jts.geom.Coordinate toModelCoordinate(Point2D viewPoint) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic Point2D toViewPoint(Point2D modelPoint) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic Point2D toViewPoint(com.vividsolutions.jts.geom.Coordinate modelCoordinate) throws NoninvertibleTransformException
toViewPoint in interface Java2DConverter.PointConverterNoninvertibleTransformExceptionpublic com.vividsolutions.jts.geom.Envelope toModelEnvelope(double x1,
double x2,
double y1,
double y2)
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic AffineTransform getModelToViewTransform() throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic com.vividsolutions.jts.geom.Envelope getEnvelopeInModelCoordinates()
public void zoom(com.vividsolutions.jts.geom.Envelope modelEnvelope)
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic void zoomToFullExtent()
throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic com.vividsolutions.jts.geom.Envelope fullExtent()
public void zoomToViewPoint(Point2D centreOfNewViewAsPerceivedByOldView, double zoomFactor) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic Collection toViewPoints(Collection modelCoordinates) throws NoninvertibleTransformException
NoninvertibleTransformExceptionpublic Rectangle2D toViewRectangle(com.vividsolutions.jts.geom.Envelope envelope) throws NoninvertibleTransformException
NoninvertibleTransformExceptionCopyright © 2015. All rights reserved.