public abstract class AbstractViewportManager extends Object
AbstractViewportManager
describes an element that occupies the
whole rendering ICanvas
or only a vertical slice of it.
The AbstractViewportManager
also provides a utility function for
debugging the slices, that is the ability to display a 10*10 grid for
checking the space occupied by the actual viewport definition.Modifier and Type | Field and Description |
---|---|
protected ViewportConfiguration |
lastViewPort |
protected ViewportMode |
mode |
protected float |
ratioHeight |
protected float |
ratioWidth |
protected int |
screenBottom |
protected boolean |
screenGridDisplayed |
protected int |
screenHeight |
protected int |
screenLeft |
protected int |
screenSquaredDim |
protected int |
screenWidth |
protected int |
screenXOffset |
protected int |
screenYOffset |
Constructor and Description |
---|
AbstractViewportManager() |
Modifier and Type | Method and Description |
---|---|
protected ViewportConfiguration |
applyViewport(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu)
Build and return a
ViewportConfiguration . |
ViewportConfiguration |
getLastViewPort() |
ViewportMode |
getMode() |
Rectangle |
getRectangle()
Returns the (x,y) offset that was applied to make this
AbstractViewportManager stand in the appropriate canvas part. and
the actual width and height of the viewport. |
protected void |
renderSubScreenGrid(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu)
Renders a grid on the defined sub screen.
|
void |
setScreenGridDisplayed(boolean status)
Set the status of the screen grid.
|
void |
setViewPort(int width,
int height)
Set the view port (size of the renderer).
|
void |
setViewPort(int width,
int height,
float left,
float right)
Set the view port (size of the renderer).
|
void |
setViewPort(ViewportConfiguration viewport) |
void |
setViewportMode(ViewportMode mode) |
protected ViewportConfiguration lastViewPort
protected int screenLeft
protected int screenBottom
protected int screenXOffset
protected int screenYOffset
protected int screenWidth
protected int screenHeight
protected int screenSquaredDim
protected boolean screenGridDisplayed
protected ViewportMode mode
protected float ratioWidth
protected float ratioHeight
public void setViewPort(int width, int height)
width
- the width of the target window.height
- the height of the target window.public ViewportMode getMode()
public void setViewportMode(ViewportMode mode)
public void setViewPort(int width, int height, float left, float right)
width
- the width of the target window.height
- the height of the target window.left
- the width's ratio where this subscreen starts in the target
window.right
- the width's ratio where this subscreen stops in the target
window.an
- IllegalArgumentException if right is not greater than left.public void setViewPort(ViewportConfiguration viewport)
public ViewportConfiguration getLastViewPort()
protected ViewportConfiguration applyViewport(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
ViewportConfiguration
. Uses gl to
gl
- glu
- public Rectangle getRectangle()
AbstractViewportManager
stand in the appropriate canvas part. and
the actual width and height of the viewport. Only relevant after a call
to applyViewPort
.public void setScreenGridDisplayed(boolean status)
status
- the grid is displayed if status is set to trueprotected void renderSubScreenGrid(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu)
Copyright © 2016. All rights reserved.