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 ContourPlot.CompleteRenderer comprises a ContourPlot.LinesRenderer, a
invalid reference
PointsRenderer
, a 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:

  1. ContourPlot.Triangles
  2. ContourPlot.Lines
  3. invalid reference
    Curves
  4. ContourPlot.Points
  5. ContourPlot.Text
This implies that Lines will be drawn over Triangles, Curves over Lines, Points over Curves, and Text over Points. Using the
invalid reference
#setRenderOrder(int, int, int, int, int)
method the order of renderers can be changed.

To add ContourPlot.Renderables to this Renderer either use the public attributes triangles, lines,

invalid reference
#curves
,
invalid reference
#points
, text to directly access the desired renderer or use the addItemToRender(Renderable) method.
Author:
hageldave
  • Field Details

  • Constructor Details

    • CompleteRenderer

      public CompleteRenderer()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Description copied from interface: ContourPlot.Renderer
      Whether this renderer is enabled or not. By default a renderer is enabled and will render upon
      invalid reference
      #render(int, int, int, int)
      or
      invalid reference
      #renderSVG(org.w3c.dom.Document, org.w3c.dom.Element, int, int)
      . When disabled those methods return right away and will not render anything.
      Specified by:
      isEnabled in interface ContourPlot.Renderer
      Returns:
      true when active
    • renderFallback

      public void renderFallback(Graphics2D g, Graphics2D p, int w, int h)
      Description copied from interface: ContourPlot.Renderer
      Renders this ContourPlot.Renderer's 'scene'. This is the fallback path in case OpenGL based rendering through
      invalid reference
      #render(int, int, int, int)
      is not available.
      Specified by:
      renderFallback in interface ContourPlot.Renderer
      Parameters:
      g - main graphics object for drawing onto the framebuffer
      p - graphics object for drawing onto the picking framebuffer (invisible but used for picking)
      w - width of the current viewport in pixels
      h - 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.PDFRenderer
      Renders this PDFRenderers contents, that is creating pdf elements and appending them to the specified page within the corresponding document.
      Specified by:
      renderPDF in interface ContourPlot.PDFRenderer
      Parameters:
      doc - the PDF document holding the page
      page - page in pdf doc to which elements are to be appended
      x - x coordinate of the current viewport
      y - y coordinate of the current viewport
      w - width of the current viewport
      h - height of the current viewport
    • addItemToRender

      Adds the specified item to the corresponding renderer. Only instances of ContourPlot.Triangles, ContourPlot.Lines, ContourPlot.Points and ContourPlot.Text are accepted, other item types result in an IllegalArgumentException.
      Parameters:
      item - to add
      Returns:
      this for chaining
      Throws:
      IllegalArgumentException - when unsupported type of item is specified.
    • setView

      public void setView(Rectangle2D rect)
      Sets the view matrix for each of the renderers
      Specified by:
      setView in interface ContourPlot.AdaptableView
      Parameters:
      rect - the view rectangle (can be null)