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 Viewport
true
, the model coordinate's Y-axis points downwards. Returns false
by default.public void setModelYAxisDown(boolean modelYAxisDown)
setModelYAxisDown
in interface Viewport
modelYAxisDown
- If true
, the model coordinate's Y-axis points downwards.public Rectangle getViewBounds()
getViewBounds
in interface Viewport
public void setViewBounds(Rectangle viewBounds)
setViewBounds
in interface Viewport
viewBounds
- The bounds in view coordinates.public AffineTransform getViewToModelTransform()
getViewToModelTransform
in interface Viewport
public AffineTransform getModelToViewTransform()
getModelToViewTransform
in interface Viewport
public double getOrientation()
getOrientation
in interface Viewport
public void setOrientation(double orientation)
Viewport
setOrientation
in interface Viewport
orientation
- the new orientation angle in radianspublic double getOffsetX()
getOffsetX
in interface Viewport
public double getOffsetY()
getOffsetY
in interface Viewport
public void setOffset(double offsetX, double offsetY)
Viewport
public void moveViewDelta(double deltaX, double deltaY)
Viewport
moveViewDelta
in interface Viewport
deltaX
- the X delta in view coordinatesdeltaY
- the Y delta in view coordinatespublic double getZoomFactor()
Viewport
getZoomFactor
in interface Viewport
public void setZoomFactor(double zoomFactor)
Viewport
setZoomFactor
in interface Viewport
zoomFactor
- The new zoom factor, must be greater than zero.Viewport.getZoomFactor()
public void zoom(Rectangle2D modelBounds)
Viewport
public void setZoomFactor(double zoomFactor, double modelCenterX, double modelCenterY)
Viewport
setZoomFactor
in interface Viewport
zoomFactor
- 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)
Viewport
addListener
in interface Viewport
listener
- The listener.public void removeListener(ViewportListener listener)
Viewport
removeListener
in interface Viewport
listener
- The listener.public ViewportListener[] getListeners()
Viewport
getListeners
in interface Viewport
public void setTransform(Viewport other)
Viewport
setTransform
in interface Viewport
other
- The view port to synchronize with.protected void fireViewportChanged(boolean orientationChanged)
Copyright © 2014–2017 European Space Agency (ESA). All rights reserved.