Class AbstractJ2DRenderer
- java.lang.Object
-
- jadex.extension.envsupport.observer.graphics.java2d.AbstractJ2DRenderer
-
- All Implemented Interfaces:
IJ2DRenderer
- Direct Known Subclasses:
EllipseJ2DRenderer
,RectangleJ2DRenderer
,RegularPolygonJ2DRenderer
,TexturedRectangleJ2DRenderer
,TriangleJ2DRenderer
public abstract class AbstractJ2DRenderer extends java.lang.Object implements IJ2DRenderer
-
-
Constructor Summary
Constructors Constructor Description AbstractJ2DRenderer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
draw(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, ViewportJ2D vp)
Draws the primitive.void
prepareAndExecuteDraw(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, ViewportJ2D vp)
Prepares the object for rendering to a Java2D viewportstatic boolean
setupDCMatrix(DrawableCombiner dc, java.lang.Object obj, boolean enablePos, boolean enableSize, boolean enableRot, ViewportJ2D vp)
Sets the basic matrix for the combiner, call can be skipped if alternative draw method is required.protected boolean
setupMatrix(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, java.awt.Graphics2D g, IViewport vp)
Sets up the transformation matrix before drawing.
-
-
-
Method Detail
-
prepareAndExecuteDraw
public final void prepareAndExecuteDraw(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, ViewportJ2D vp)
Prepares the object for rendering to a Java2D viewport- Specified by:
prepareAndExecuteDraw
in interfaceIJ2DRenderer
- Parameters:
dc
- the DrawableCombiner drawing the objectprimitive
- the primitive being drawnobj
- the object being drawnvp
- the viewport
-
setupDCMatrix
public static final boolean setupDCMatrix(DrawableCombiner dc, java.lang.Object obj, boolean enablePos, boolean enableSize, boolean enableRot, ViewportJ2D vp)
Sets the basic matrix for the combiner, call can be skipped if alternative draw method is required.- Parameters:
obj
- object being drawng
- the viewport contextenablePos
- enables position setupenableSize
- enables size setupenableRot
- enables rotation setup
-
setupMatrix
protected boolean setupMatrix(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, java.awt.Graphics2D g, IViewport vp)
Sets up the transformation matrix before drawing.- Parameters:
obj
- object being drawng
- graphics context- Returns:
- true, if the setup was successful
-
draw
public abstract void draw(DrawableCombiner dc, Primitive primitive, java.lang.Object obj, ViewportJ2D vp)
Draws the primitive.- Specified by:
draw
in interfaceIJ2DRenderer
- Parameters:
dc
- the DrawableCombiner drawing the objectprimitive
- the primitive being drawnobj
- the object being drawnvp
- the viewport
-
-