Package gov.nih.mipav.model.algorithms
Class ContourPlot.CompleteRenderer
java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.CompleteRenderer
- All Implemented Interfaces:
ContourPlot.AdaptableView,ContourPlot.PDFRenderer,ContourPlot.Renderer
- Enclosing class:
ContourPlot
public class ContourPlot.CompleteRenderer
extends Object
implements ContourPlot.Renderer, ContourPlot.AdaptableView
The
, a
method
the order of renderers can be changed.
ContourPlot.CompleteRenderer comprises a ContourPlot.LinesRenderer,
a
invalid reference
PointsRenderer
ContourPlot.TextRenderer and
a ContourPlot.TrianglesRenderer.
It thus can render the most important graphical elements for
a scientific 2D visualization (hence its name).
The order in which these Renderers are processed by default is:
ContourPlot.TrianglesContourPlot.Lines-
invalid reference
Curves ContourPlot.PointsContourPlot.Text
invalid reference
#setRenderOrder(int, int, int, int, int)
To add ContourPlot.Renderables to this Renderer either use the public attributes
triangles, lines,
,
invalid reference
#curves
, invalid reference
#pointstext
to directly access the desired renderer or use the addItemToRender(Renderable)
method.
- Author:
- hageldave
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanstatic final intprivate final ContourPlot.Renderer[]private final int[]final ContourPlot.TextRendererstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds the specified item to the corresponding renderer.booleanWhether this renderer is enabled or not.voidrenderFallback(Graphics2D g, Graphics2D p, int w, int h) Renders thisContourPlot.Renderer's 'scene'.voidrenderPDF(org.apache.pdfbox.pdmodel.PDDocument doc, org.apache.pdfbox.pdmodel.PDPage page, int x, int y, int w, int h) Renders this PDFRenderers contents, that is creating pdf elements and appending them to the specified page within the corresponding document.voidsetView(Rectangle2D rect) Sets the view matrix for each of the renderers
-
Field Details
-
lines
-
text
-
triangles
-
rendererLUT
-
TRI
public static final int TRI- See Also:
-
LIN
public static final int LIN- See Also:
-
TXT
public static final int TXT- See Also:
-
renderOrder
private final int[] renderOrder -
isEnabled
boolean isEnabled
-
-
Constructor Details
-
CompleteRenderer
public CompleteRenderer()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Description copied from interface:ContourPlot.RendererWhether this renderer is enabled or not. By default a renderer is enabled and will render uponorinvalid reference
#render(int, int, int, int). When disabled those methods return right away and will not render anything.invalid reference
#renderSVG(org.w3c.dom.Document, org.w3c.dom.Element, int, int)- Specified by:
isEnabledin interfaceContourPlot.Renderer- Returns:
- true when active
-
renderFallback
Description copied from interface:ContourPlot.RendererRenders thisContourPlot.Renderer's 'scene'. This is the fallback path in case OpenGL based rendering throughis not available.invalid reference
#render(int, int, int, int)- Specified by:
renderFallbackin interfaceContourPlot.Renderer- Parameters:
g- main graphics object for drawing onto the framebufferp- graphics object for drawing onto the picking framebuffer (invisible but used for picking)w- width of the current viewport in pixelsh- height of the current viewport in pixels
-
renderPDF
public void renderPDF(org.apache.pdfbox.pdmodel.PDDocument doc, org.apache.pdfbox.pdmodel.PDPage page, int x, int y, int w, int h) Description copied from interface:ContourPlot.PDFRendererRenders this PDFRenderers contents, that is creating pdf elements and appending them to the specified page within the corresponding document.- Specified by:
renderPDFin interfaceContourPlot.PDFRenderer- Parameters:
doc- the PDF document holding the pagepage- page in pdf doc to which elements are to be appendedx- x coordinate of the current viewporty- y coordinate of the current viewportw- width of the current viewporth- height of the current viewport
-
addItemToRender
Adds the specified item to the corresponding renderer. Only instances ofContourPlot.Triangles,ContourPlot.Lines,ContourPlot.PointsandContourPlot.Textare accepted, other item types result in anIllegalArgumentException.- Parameters:
item- to add- Returns:
- this for chaining
- Throws:
IllegalArgumentException- when unsupported type of item is specified.
-
setView
Sets the view matrix for each of the renderers- Specified by:
setViewin interfaceContourPlot.AdaptableView- Parameters:
rect- the view rectangle (can be null)
-