Class AbstractViewport3d
- java.lang.Object
-
- jadex.extension.envsupport.observer.graphics.AbstractViewport3d
-
- All Implemented Interfaces:
IViewport3d
public abstract class AbstractViewport3d extends java.lang.Object implements IViewport3d
-
-
Field Summary
Fields Modifier and Type Field Description protected IVector3
areaSize_
Maximum displayable areaprotected java.awt.Canvas
canvas_
Canvas for graphical output.protected java.util.Set<java.lang.Object>
drawObjects_
Known drawable Objects.protected Vector2Double
paddedSize_
Real size of the viewport including padding.protected IPerspective
perspective
IPropertyObject holding properties for layers.protected IVector2
pixPosition_
Pixel-corrected viewport position.protected IVector3
position_
Virtual Viewport position.protected boolean
preserveAR_
Flag aspect ratio preservation.protected boolean
rendering
Flag to indicate that rendering is in progress.protected Vector3Double
size_
Size of the viewport without padding.protected ISpaceController
spacecontroller
The Space Controller
-
Constructor Summary
Constructors Constructor Description AbstractViewport3d(IPerspective perspective, IVector3 areasize, boolean isGrid, boolean shader, java.lang.String camera, ISpaceController spaceController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addViewportListener(IViewportListener listener)
Adds a IViewportListenerIVector3
getAreaSize()
Gets the maximum displayable size.IVector3
getAreaSize3d()
Gets the maximum displayable size.java.lang.String
getCamera()
java.awt.Canvas
getCanvas()
Returns the canvas that is used for displaying the objects.IVector2
getCanvasSize()
Returns the size of the canvas as a vector.IVector2
getPaddedSize()
Returns the padded sizeIPerspective
getPerspective()
Get the perspective.IVector3
getPosition()
Gets the position of the viewport.IVector3
getSize()
Gets the size of the display area.ISpaceController
getSpaceController()
void
getSpaceController(ISpaceController spacecontroller)
void
isGridSpace(boolean isGrid)
boolean
isShader()
boolean
isShowing()
Checks if this IViewport is showing on screen.void
removeViewportListener(IViewportListener listener)
Removes a IViewportListenervoid
setAreaSize(IVector3 areaSize)
Sets the maximum displayable size.void
setCamera(java.lang.String camera)
void
setShader(boolean shader)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jadex.extension.envsupport.observer.graphics.IViewport3d
getMarker, getSelected, pauseApp, refresh, setSelected, startApp, stopApp
-
-
-
-
Field Detail
-
spacecontroller
protected ISpaceController spacecontroller
The Space Controller
-
canvas_
protected java.awt.Canvas canvas_
Canvas for graphical output.
-
size_
protected Vector3Double size_
Size of the viewport without padding.
-
preserveAR_
protected boolean preserveAR_
Flag aspect ratio preservation.
-
areaSize_
protected IVector3 areaSize_
Maximum displayable area
-
paddedSize_
protected Vector2Double paddedSize_
Real size of the viewport including padding.
-
drawObjects_
protected java.util.Set<java.lang.Object> drawObjects_
Known drawable Objects.
-
position_
protected IVector3 position_
Virtual Viewport position.
-
pixPosition_
protected IVector2 pixPosition_
Pixel-corrected viewport position.
-
perspective
protected IPerspective perspective
IPropertyObject holding properties for layers.
-
rendering
protected volatile boolean rendering
Flag to indicate that rendering is in progress.
-
-
Constructor Detail
-
AbstractViewport3d
public AbstractViewport3d(IPerspective perspective, IVector3 areasize, boolean isGrid, boolean shader, java.lang.String camera, ISpaceController spaceController)
-
-
Method Detail
-
getCanvas
public java.awt.Canvas getCanvas()
Returns the canvas that is used for displaying the objects.- Specified by:
getCanvas
in interfaceIViewport3d
-
getSize
public IVector3 getSize()
Gets the size of the display area.- Returns:
- size of the display area, may be padded to preserve aspect ratio
-
getAreaSize
public IVector3 getAreaSize()
Gets the maximum displayable size.- Specified by:
getAreaSize
in interfaceIViewport3d
- Returns:
- maximum area size.
-
getAreaSize3d
public IVector3 getAreaSize3d()
Gets the maximum displayable size.- Returns:
- maximum area size.
-
setAreaSize
public void setAreaSize(IVector3 areaSize)
Sets the maximum displayable size.- Specified by:
setAreaSize
in interfaceIViewport3d
- Parameters:
areaSize
- maximum area size.
-
getPaddedSize
public IVector2 getPaddedSize()
Returns the padded size- Returns:
- padded size
-
getCanvasSize
public IVector2 getCanvasSize()
Returns the size of the canvas as a vector.- Returns:
- size of the canvas in pixel
-
getPosition
public IVector3 getPosition()
Gets the position of the viewport.
-
isShowing
public boolean isShowing()
Checks if this IViewport is showing on screen.- Returns:
- true if the IViewport is showing, false otherwise
-
addViewportListener
public void addViewportListener(IViewportListener listener)
Adds a IViewportListener- Parameters:
listener
- new listener
-
removeViewportListener
public void removeViewportListener(IViewportListener listener)
Removes a IViewportListener- Parameters:
listener
- the listener
-
getPerspective
public IPerspective getPerspective()
Get the perspective.- Specified by:
getPerspective
in interfaceIViewport3d
- Returns:
- The perspective.
-
isGridSpace
public void isGridSpace(boolean isGrid)
- Specified by:
isGridSpace
in interfaceIViewport3d
-
isShader
public boolean isShader()
-
setShader
public void setShader(boolean shader)
-
getCamera
public java.lang.String getCamera()
-
setCamera
public void setCamera(java.lang.String camera)
-
getSpaceController
public ISpaceController getSpaceController()
- Specified by:
getSpaceController
in interfaceIViewport3d
- Returns:
- the spacecontroller
-
getSpaceController
public void getSpaceController(ISpaceController spacecontroller)
-
-