Class ContourPlot.GenericRenderer<T extends ContourPlot.Renderable>

java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.GenericRenderer<T>
All Implemented Interfaces:
ContourPlot.AdaptableView, ContourPlot.PDFRenderer, ContourPlot.Renderer
Direct Known Subclasses:
ContourPlot.LinesRenderer, ContourPlot.TextRenderer, ContourPlot.TrianglesRenderer
Enclosing class:
ContourPlot

public abstract class ContourPlot.GenericRenderer<T extends ContourPlot.Renderable> extends Object implements ContourPlot.Renderer, ContourPlot.AdaptableView
  • Field Details

  • Constructor Details

    • GenericRenderer

      public GenericRenderer()
  • Method Details

    • addItemToRender

      public ContourPlot.GenericRenderer<T> addItemToRender(T item)
      Adds an item to this renderer's itemsToRender list. The renderer will take care of calling
      invalid reference
      Renderable#initGL()
      during its
      invalid reference
      #render(int, int, int, int)
      method and will as well call
      invalid reference
      Renderable#updateGL(boolean)
      if ContourPlot.Renderable.isDirty().
      Parameters:
      item - to add
      Returns:
      this for chaining
    • removeItemToRender

      public boolean removeItemToRender(T item)
      Removes an item from this renderer's itemsToRender list.
      Parameters:
      item - to remove
      Returns:
      true when successfully removed, else false (e.g. when not contained in list)
    • 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
    • getItemsToRender

      public LinkedList<T> getItemsToRender()
      Returns:
      the list of items to render.
    • setView

      public void setView(Rectangle2D view)
      Description copied from interface: ContourPlot.AdaptableView
      Sets the view rectangle that is the range of coordinates to be projected onto the view port.

      For example when setting a view rectangle of (x=-1,y=-1,w=2,h=2) given a viewport of size (w=100,h=100), then a point with coordinates (x=0,y=0) will be projected to (x=50,y=50) on the viewport. A point with coordinates (x=-1,y=-1) will be projected to (x=0,y=0).

      When setting the view rectangle to null, then no projection is happening and the coordinates are mapped directly to view port coordinates. E.g. coordinates (40,40) will be (40,40) on the viewport, as if the view rectangles size was coupled to the viewport size.

      Specified by:
      setView in interface ContourPlot.AdaptableView
      Parameters:
      view - the view rectangle (can be null)