|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.application.space.envsupport.observer.graphics.AbstractViewport
public abstract class AbstractViewport
| Nested Class Summary | |
|---|---|
protected class |
AbstractViewport.MouseController
|
| Field Summary | |
|---|---|
protected Vector2Double |
areaSize_
Maximum displayable area |
protected Color |
bgColor_
The background color. |
protected Canvas |
canvas_
Canvas for graphical output. |
protected Set |
drawObjects_
Known drawable Objects. |
protected IVector2 |
inversionFlag_
Axis inversion flag |
protected ILibraryService |
libService_
Library service for loading resources. |
protected SortedSet |
objectLayers_
Registered object layers. |
protected List |
objectList_
List of objects that should be drawn. |
protected float |
objShiftX_
Object shift x-coordinate. |
protected float |
objShiftY_
Object shift y-coordinate. |
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 IVector2 |
position_
Virtual Viewport position. |
protected Layer[] |
postLayers_
Layers applied after drawable rendering |
protected Layer[] |
preLayers_
Layers applied before drawable rendering |
protected boolean |
preserveAR_
Flag aspect ratio preservation. |
protected boolean |
rendering
Flag to indicate that rendering is in progress. |
protected Vector2Double |
size_
Size of the viewport without padding. |
| Constructor Summary | |
|---|---|
AbstractViewport(IPerspective perspective)
|
|
| Method Summary | |
|---|---|
void |
addViewportListener(IViewportListener listener)
Adds a IViewportListener |
IVector2 |
getAreaSize()
Gets the maximum displayable size. |
Canvas |
getCanvas()
Returns the canvas that is used for displaying the objects. |
IVector2 |
getCanvasSize()
Returns the size of the canvas as a vector. |
Rectangle |
getClippingBox()
Returns the clipping box. |
boolean |
getInvertX()
Returns true if the x-axis is inverted (right-left instead of left-right). |
boolean |
getInvertY()
Returns true if the y-axis is inverted (top-down instead of bottom-up). |
IVector2 |
getObjectShift()
Gets the shift of all objects. |
IVector2 |
getPaddedSize()
Returns the padded size |
IPerspective |
getPerspective()
Get the perspective. |
IVector2 |
getPixelSize()
Returns the size of a pixel. |
IVector2 |
getPosition()
Gets the position of the viewport. |
IVector2 |
getSize()
Gets the size of the display area. |
IVector2 |
getWorldCoordinates(int pixelX,
int pixelY)
Converts pixel coordinates into world coordinates |
boolean |
isShowing()
Checks if this IViewport is showing on screen. |
void |
refreshCanvasSize()
Refreshes the size of the canvas. |
void |
removeViewportListener(IViewportListener listener)
Removes a IViewportListener |
void |
setAreaSize(IVector2 areaSize)
Sets the maximum displayable size. |
void |
setBackground(Color bgColor)
Sets the background color. |
void |
setInvertX(boolean b)
If set to true, inverts the x-axis (right-left instead of left-right). |
void |
setInvertY(boolean b)
If set to true, inverts the y-axis (top-down instead of bottom-up). |
void |
setObjectList(List objectList)
Sets the current objects to draw. |
void |
setObjectShift(IVector2 objectShift)
Sets the shift of all objects. |
void |
setPosition(IVector2 pos)
Sets the position of the viewport. |
void |
setPostLayers(Layer[] layers)
Sets the post-layers for the viewport. |
void |
setPreLayers(Layer[] layers)
Sets the pre-layers for the viewport. |
void |
setPreserveAspectRation(boolean preserveAR)
Sets whether the viewport should preserve the aspect ratio of the size by padding. |
void |
setSize(IVector2 size)
Sets the size of the display area. |
void |
setZoomLimit(double zoomlimit)
Sets the maximum zoom. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jadex.application.space.envsupport.observer.graphics.IViewport |
|---|
dispose, drawPrimitive, refresh |
| Field Detail |
|---|
protected IVector2 inversionFlag_
protected Canvas canvas_
protected ILibraryService libService_
protected Color bgColor_
protected IVector2 position_
protected IVector2 pixPosition_
protected float objShiftX_
protected float objShiftY_
protected boolean preserveAR_
protected Vector2Double size_
protected Vector2Double areaSize_
protected Vector2Double paddedSize_
protected Set drawObjects_
protected SortedSet objectLayers_
protected List objectList_
protected Layer[] preLayers_
protected Layer[] postLayers_
protected IPerspective perspective
protected volatile boolean rendering
| Constructor Detail |
|---|
public AbstractViewport(IPerspective perspective)
| Method Detail |
|---|
public void setBackground(Color bgColor)
setBackground in interface IViewportbgColor - the background colorpublic void setObjectList(List objectList)
setObjectList in interface IViewportobjectList - objects that should be drawnpublic Canvas getCanvas()
getCanvas in interface IViewportpublic void setPreLayers(Layer[] layers)
setPreLayers in interface IViewportlayers - the pre-layerspublic void setPostLayers(Layer[] layers)
setPostLayers in interface IViewportlayers - the post-layerspublic IVector2 getSize()
getSize in interface IViewportpublic void setSize(IVector2 size)
setSize in interface IViewportsize - size of the display area, may be padded to preserve aspect
ratiopublic IVector2 getAreaSize()
getAreaSize in interface IViewportpublic void setAreaSize(IVector2 areaSize)
setAreaSize in interface IViewportareaSize - maximum area size.public IVector2 getPaddedSize()
public Rectangle getClippingBox()
public IVector2 getPixelSize()
public IVector2 getCanvasSize()
public void refreshCanvasSize()
refreshCanvasSize in interface IViewportpublic IVector2 getPosition()
getPosition in interface IViewportpublic void setPosition(IVector2 pos)
setPosition in interface IViewportpublic void setPreserveAspectRation(boolean preserveAR)
IViewport
setPreserveAspectRation in interface IViewportpreserveAR - true to preserve aspect ratio, false otherwisepublic boolean getInvertX()
getInvertX in interface IViewportpublic boolean getInvertY()
getInvertY in interface IViewportpublic void setInvertX(boolean b)
setInvertX in interface IViewportb - if true, inverts the x-axispublic void setInvertY(boolean b)
setInvertY in interface IViewportb - if true, inverts the y-axispublic IVector2 getObjectShift()
public void setObjectShift(IVector2 objectShift)
setObjectShift in interface IViewportpublic void setZoomLimit(double zoomlimit)
setZoomLimit in interface IViewportzoomlimit - the zoom limitpublic boolean isShowing()
isShowing in interface IViewportpublic void addViewportListener(IViewportListener listener)
addViewportListener in interface IViewportlistener - new listenerpublic void removeViewportListener(IViewportListener listener)
removeViewportListener in interface IViewportlistener - the listenerpublic IPerspective getPerspective()
getPerspective in interface IViewport
public IVector2 getWorldCoordinates(int pixelX,
int pixelY)
getWorldCoordinates in interface IViewportpixelX - pixel x-coordinatepixelY - pixel y-coordinate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||