| Constructor and Description |
|---|
DefaultViewport() |
DefaultViewport(boolean modelYAxisDown) |
DefaultViewport(Rectangle viewBounds) |
DefaultViewport(Rectangle viewBounds,
boolean modelYAxisDown) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ViewportListener listener)
Adds a change listener to this viewport.
|
Viewport |
clone()
Creates a clone of this viewport.
|
protected void |
fireViewportChanged(boolean orientationChanged) |
ViewportListener[] |
getListeners()
Gets all listeners added to this viewport.
|
AffineTransform |
getModelToViewTransform() |
double |
getOffsetX() |
double |
getOffsetY() |
double |
getOrientation() |
Rectangle |
getViewBounds() |
AffineTransform |
getViewToModelTransform() |
double |
getZoomFactor()
Gets the zoom factor.
|
boolean |
isModelYAxisDown() |
void |
moveViewDelta(double deltaX,
double deltaY)
Moves the model CS by translating it into the opposite direction of the given
vector in view coordinates.
|
void |
removeListener(ViewportListener listener)
Removes a change listener from this viewport.
|
void |
setModelYAxisDown(boolean modelYAxisDown) |
void |
setOffset(double offsetX,
double offsetY)
Sets the viewport's absolute offset in model coordinates.
|
void |
setOrientation(double orientation)
Sets the orientation angle relative to the viewport bound's center point.
|
void |
setTransform(Viewport other)
Modifies this viewport so that it matches the given one.
|
void |
setViewBounds(Rectangle viewBounds) |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor relative to the viewport bound's center point.
|
void |
setZoomFactor(double zoomFactor,
double modelCenterX,
double modelCenterY)
Zooms to the given point given in model coordinates.
|
String |
toString() |
void |
zoom(Rectangle2D modelBounds)
Zooms to the given area given in model coordinates.
|
public DefaultViewport()
public DefaultViewport(Rectangle viewBounds)
public DefaultViewport(boolean modelYAxisDown)
public DefaultViewport(Rectangle viewBounds, boolean modelYAxisDown)
public boolean isModelYAxisDown()
isModelYAxisDown in interface Viewporttrue, the model coordinate's Y-axis points downwards. Returns false by default.public void setModelYAxisDown(boolean modelYAxisDown)
setModelYAxisDown in interface ViewportmodelYAxisDown - If true, the model coordinate's Y-axis points downwards.public Rectangle getViewBounds()
getViewBounds in interface Viewportpublic void setViewBounds(Rectangle viewBounds)
setViewBounds in interface ViewportviewBounds - The bounds in view coordinates.public AffineTransform getViewToModelTransform()
getViewToModelTransform in interface Viewportpublic AffineTransform getModelToViewTransform()
getModelToViewTransform in interface Viewportpublic double getOrientation()
getOrientation in interface Viewportpublic void setOrientation(double orientation)
ViewportsetOrientation in interface Viewportorientation - the new orientation angle in radianspublic double getOffsetX()
getOffsetX in interface Viewportpublic double getOffsetY()
getOffsetY in interface Viewportpublic void setOffset(double offsetX,
double offsetY)
Viewportpublic void moveViewDelta(double deltaX,
double deltaY)
ViewportmoveViewDelta in interface ViewportdeltaX - the X delta in view coordinatesdeltaY - the Y delta in view coordinatespublic double getZoomFactor()
ViewportgetZoomFactor in interface Viewportpublic void setZoomFactor(double zoomFactor)
ViewportsetZoomFactor in interface ViewportzoomFactor - The new zoom factor, must be greater than zero.Viewport.getZoomFactor()public void zoom(Rectangle2D modelBounds)
Viewportpublic void setZoomFactor(double zoomFactor,
double modelCenterX,
double modelCenterY)
ViewportsetZoomFactor in interface ViewportzoomFactor - The new zoom factor, must be greater than zero.modelCenterX - New X of the view's center point in model coordinates.modelCenterY - New Y of the view's center point in model coordinates.public void addListener(ViewportListener listener)
ViewportaddListener in interface Viewportlistener - The listener.public void removeListener(ViewportListener listener)
ViewportremoveListener in interface Viewportlistener - The listener.public ViewportListener[] getListeners()
ViewportgetListeners in interface Viewportpublic void setTransform(Viewport other)
ViewportsetTransform in interface Viewportother - The view port to synchronize with.protected void fireViewportChanged(boolean orientationChanged)
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.