Package gov.nih.mipav.model.algorithms
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddItemToRender(T item) Adds an item to this renderer'sitemsToRenderlist.booleanWhether this renderer is enabled or not.booleanremoveItemToRender(T item) Removes an item from this renderer'sitemsToRenderlist.voidsetView(Rectangle2D view) Sets the view rectangle that is the range of coordinates to be projected onto the view port.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.PDFRenderer
renderPDFMethods inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.Renderer
renderFallback
-
Field Details
-
itemsToRender
-
view
-
isEnabled
protected boolean isEnabled
-
-
Constructor Details
-
GenericRenderer
public GenericRenderer()
-
-
Method Details
-
addItemToRender
Adds an item to this renderer'sitemsToRenderlist. The renderer will take care of callingduring itsinvalid reference
Renderable#initGL()method and will as well callinvalid reference
#render(int, int, int, int)ifinvalid reference
Renderable#updateGL(boolean)ContourPlot.Renderable.isDirty().- Parameters:
item- to add- Returns:
- this for chaining
-
removeItemToRender
Removes an item from this renderer'sitemsToRenderlist.- 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.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
-
getItemsToRender
- Returns:
- the list of items to render.
-
setView
Description copied from interface:ContourPlot.AdaptableViewSets 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:
setViewin interfaceContourPlot.AdaptableView- Parameters:
view- the view rectangle (can be null)
-