Class Viewport
java.lang.Object
com.vividsolutions.jump.workbench.ui.Viewport
- All Implemented Interfaces:
Java2DConverter.PointConverter
Controls the area on the model being viewed by a LayerViewPanel.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidorg.locationtech.jts.geom.Envelopeorg.locationtech.jts.geom.EnvelopegetPanel()doublegetScale()voidinitialize(double newScale, Point2D newViewOriginAsPerceivedByModel) Set both values but repaint once.static AffineTransformmodelToViewTransform(double scale, Point2D viewOriginAsPerceivedByModel, double panelHeight) voidvoidsetJava2DConverter(Java2DConverter converter) org.locationtech.jts.geom.CoordinatetoModelCoordinate(Point2D viewPoint) org.locationtech.jts.geom.EnvelopetoModelEnvelope(double x1, double x2, double y1, double y2) toModelPoint(Point2D viewPoint) toViewPoint(Point2D modelPoint) toViewPoint(org.locationtech.jts.geom.Coordinate modelCoordinate) toViewPoints(Collection modelCoordinates) toViewRectangle(org.locationtech.jts.geom.Envelope envelope) voidupdate()voidzoom(Point2D centreOfNewViewAsPerceivedByOldView, double widthOfNewViewAsPerceivedByOldView, double heightOfNewViewAsPerceivedByOldView) Of widthOfNewViewAsPerceivedByOldView and heightOfNewViewAsPerceivedByOldView, this method will choose the one producing the least zoom.voidzoom(org.locationtech.jts.geom.Envelope modelEnvelope) voidvoidzoomToViewPoint(Point2D centreOfNewViewAsPerceivedByOldView, double zoomFactor)
-
Constructor Details
-
Viewport
-
-
Method Details
-
getPanel
-
addListener
-
removeListener
-
getJava2DConverter
-
setJava2DConverter
-
getZoomHistory
-
update
- Throws:
NoninvertibleTransformException
-
modelToViewTransform
public static AffineTransform modelToViewTransform(double scale, Point2D viewOriginAsPerceivedByModel, double panelHeight) -
getScale
public double getScale()- Specified by:
getScalein interfaceJava2DConverter.PointConverter
-
initialize
Set both values but repaint once. -
getOriginInModelCoordinates
-
zoom
public void zoom(Point2D centreOfNewViewAsPerceivedByOldView, double widthOfNewViewAsPerceivedByOldView, double heightOfNewViewAsPerceivedByOldView) throws NoninvertibleTransformException Of widthOfNewViewAsPerceivedByOldView and heightOfNewViewAsPerceivedByOldView, this method will choose the one producing the least zoom.- Throws:
NoninvertibleTransformException
-
toModelPoint
- Throws:
NoninvertibleTransformException
-
toModelCoordinate
public org.locationtech.jts.geom.Coordinate toModelCoordinate(Point2D viewPoint) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
toViewPoint
- Throws:
NoninvertibleTransformException
-
toViewPoint
public Point2D toViewPoint(org.locationtech.jts.geom.Coordinate modelCoordinate) throws NoninvertibleTransformException - Specified by:
toViewPointin interfaceJava2DConverter.PointConverter- Throws:
NoninvertibleTransformException
-
toModelEnvelope
public org.locationtech.jts.geom.Envelope toModelEnvelope(double x1, double x2, double y1, double y2) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
getModelToViewTransform
- Throws:
NoninvertibleTransformException
-
getEnvelopeInModelCoordinates
public org.locationtech.jts.geom.Envelope getEnvelopeInModelCoordinates()- Specified by:
getEnvelopeInModelCoordinatesin interfaceJava2DConverter.PointConverter
-
zoom
public void zoom(org.locationtech.jts.geom.Envelope modelEnvelope) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
zoomToFullExtent
- Throws:
NoninvertibleTransformException
-
fullExtent
public org.locationtech.jts.geom.Envelope fullExtent() -
zoomToViewPoint
public void zoomToViewPoint(Point2D centreOfNewViewAsPerceivedByOldView, double zoomFactor) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
toViewPoints
- Throws:
NoninvertibleTransformException
-
toViewRectangle
public Rectangle2D toViewRectangle(org.locationtech.jts.geom.Envelope envelope) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-