public class Viewport extends java.lang.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() |
java.awt.geom.AffineTransform |
getModelToViewTransform() |
java.awt.geom.Point2D |
getOriginInModelCoordinates() |
LayerViewPanel |
getPanel() |
double |
getScale() |
ZoomHistory |
getZoomHistory() |
void |
initialize(double newScale,
java.awt.geom.Point2D newViewOriginAsPerceivedByModel)
Set both values but repaint once.
|
static java.awt.geom.AffineTransform |
modelToViewTransform(double scale,
java.awt.geom.Point2D viewOriginAsPerceivedByModel,
double panelHeight) |
void |
removeListener(ViewportListener l) |
void |
setJava2DConverter(Java2DConverter converter) |
com.vividsolutions.jts.geom.Coordinate |
toModelCoordinate(java.awt.geom.Point2D viewPoint) |
com.vividsolutions.jts.geom.Envelope |
toModelEnvelope(double x1,
double x2,
double y1,
double y2) |
java.awt.geom.Point2D |
toModelPoint(java.awt.geom.Point2D viewPoint) |
java.awt.geom.Point2D |
toViewPoint(com.vividsolutions.jts.geom.Coordinate modelCoordinate) |
java.awt.geom.Point2D |
toViewPoint(java.awt.geom.Point2D modelPoint) |
java.util.Collection |
toViewPoints(java.util.Collection modelCoordinates) |
java.awt.geom.Rectangle2D |
toViewRectangle(com.vividsolutions.jts.geom.Envelope envelope) |
void |
update() |
void |
zoom(com.vividsolutions.jts.geom.Envelope modelEnvelope) |
void |
zoom(java.awt.geom.Point2D centreOfNewViewAsPerceivedByOldView,
double widthOfNewViewAsPerceivedByOldView,
double heightOfNewViewAsPerceivedByOldView)
Of widthOfNewViewAsPerceivedByOldView and heightOfNewViewAsPerceivedByOldView,
this method will choose the one producing the least zoom.
|
void |
zoomToFullExtent() |
void |
zoomToViewPoint(java.awt.geom.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 void setJava2DConverter(Java2DConverter converter)
public ZoomHistory getZoomHistory()
public void update() throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public static java.awt.geom.AffineTransform modelToViewTransform(double scale, java.awt.geom.Point2D viewOriginAsPerceivedByModel, double panelHeight)
public double getScale()
getScale
in interface Java2DConverter.PointConverter
public void initialize(double newScale, java.awt.geom.Point2D newViewOriginAsPerceivedByModel)
public java.awt.geom.Point2D getOriginInModelCoordinates()
public void zoom(java.awt.geom.Point2D centreOfNewViewAsPerceivedByOldView, double widthOfNewViewAsPerceivedByOldView, double heightOfNewViewAsPerceivedByOldView) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.awt.geom.Point2D toModelPoint(java.awt.geom.Point2D viewPoint) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public com.vividsolutions.jts.geom.Coordinate toModelCoordinate(java.awt.geom.Point2D viewPoint) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.awt.geom.Point2D toViewPoint(java.awt.geom.Point2D modelPoint) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.awt.geom.Point2D toViewPoint(com.vividsolutions.jts.geom.Coordinate modelCoordinate) throws java.awt.geom.NoninvertibleTransformException
toViewPoint
in interface Java2DConverter.PointConverter
java.awt.geom.NoninvertibleTransformException
public com.vividsolutions.jts.geom.Envelope toModelEnvelope(double x1, double x2, double y1, double y2) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.awt.geom.AffineTransform getModelToViewTransform() throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public com.vividsolutions.jts.geom.Envelope getEnvelopeInModelCoordinates()
getEnvelopeInModelCoordinates
in interface Java2DConverter.PointConverter
public void zoom(com.vividsolutions.jts.geom.Envelope modelEnvelope) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public void zoomToFullExtent() throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public com.vividsolutions.jts.geom.Envelope fullExtent()
public void zoomToViewPoint(java.awt.geom.Point2D centreOfNewViewAsPerceivedByOldView, double zoomFactor) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.util.Collection toViewPoints(java.util.Collection modelCoordinates) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException
public java.awt.geom.Rectangle2D toViewRectangle(com.vividsolutions.jts.geom.Envelope envelope) throws java.awt.geom.NoninvertibleTransformException
java.awt.geom.NoninvertibleTransformException