public class ViewportJ2D extends AbstractViewport implements java.awt.event.ComponentListener
AbstractViewport.MouseController
areaSize_, bgColor_, canvas_, drawObjects_, inversionFlag_, objectLayers_, objectList_, objShiftX_, objShiftY_, paddedSize_, perspective, pixPosition_, position_, postLayers_, preLayers_, preserveAR_, rendering, size_, spacecontroller
Constructor and Description |
---|
ViewportJ2D(IPerspective persp,
java.lang.ClassLoader classloader)
Creates a new Viewport.
|
Modifier and Type | Method and Description |
---|---|
void |
componentHidden(java.awt.event.ComponentEvent e) |
void |
componentMoved(java.awt.event.ComponentEvent e) |
void |
componentResized(java.awt.event.ComponentEvent e) |
void |
componentShown(java.awt.event.ComponentEvent e) |
void |
dispose()
Disposes the Viewport.
|
void |
drawPrimitive(DrawableCombiner dc,
Primitive primitive,
java.lang.Object obj)
Draws a primitive
|
java.awt.Graphics2D |
getContext() |
java.awt.geom.AffineTransform |
getDefaultTransform()
Returns the default transform.
|
java.awt.image.BufferedImage |
getImage(java.lang.String path)
Returns an image for texturing
|
java.awt.geom.AffineTransform |
getImageTransform(int sizeX,
int sizeY)
Sets up the image transform.
|
void |
refresh()
Refreshes the viewport.
|
addViewportListener, getAreaSize, getCanvas, getCanvasSize, getClippingBox, getInvertX, getInvertY, getObjectShift, getPaddedSize, getPerspective, getPixelSize, getPosition, getSize, getSpaceController, getSpaceController, getWorldCoordinates, isShowing, refreshCanvasSize, removeViewportListener, setAreaSize, setBackground, setInvertX, setInvertY, setObjectList, setObjectShift, setPosition, setPostLayers, setPreLayers, setPreserveAspectRation, setSize, setZoomLimit
public ViewportJ2D(IPerspective persp, java.lang.ClassLoader classloader)
layerObject
- object holding properties for pre/postlayerslibService
- the library servicepublic java.awt.image.BufferedImage getImage(java.lang.String path)
path
- resource path of the imagepublic void refresh()
IViewport
public java.awt.Graphics2D getContext()
public java.awt.geom.AffineTransform getDefaultTransform()
public java.awt.geom.AffineTransform getImageTransform(int sizeX, int sizeY)
sizeX
- image x-sizesizeY
- image y-sizepublic void drawPrimitive(DrawableCombiner dc, Primitive primitive, java.lang.Object obj)
drawPrimitive
in interface IViewport
dc
- The combiner.primitive
- The primitive.obj
- The object being drawn.public void componentHidden(java.awt.event.ComponentEvent e)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent e)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent e)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent e)
componentShown
in interface java.awt.event.ComponentListener