Class AWTImageViewport

java.lang.Object
org.jzy3d.plot3d.rendering.view.AbstractViewportManager
org.jzy3d.plot3d.rendering.view.AWTImageViewport
All Implemented Interfaces:
IImageViewport
Direct Known Subclasses:
AWTLegend

public class AWTImageViewport extends AbstractViewportManager implements IImageViewport
A AWTImageViewport allows displaying a 2d Image within an OpenGL viewport.
Author:
Martin Pernollet
  • Field Details

    • imageData

      protected ByteBuffer imageData
    • image

      protected BufferedImage image
    • imageHeight

      protected int imageHeight
    • imageWidth

      protected int imageWidth
    • margin

      protected Margin margin
    • pixelScale

      protected Coord2d pixelScale
  • Constructor Details

    • AWTImageViewport

      public AWTImageViewport()
  • Method Details

    • render

      public void render(IPainter painter)
      Description copied from interface: IImageViewport
      Renders the picture into the window, according to the viewport settings. If the picture is bigger than the viewport, it is simply centered in it, otherwise, it is scaled in order to fit into the viewport.
      Specified by:
      render in interface IImageViewport
    • renderImage

      protected void renderImage(IPainter painter)
    • computeLayout

      protected AWTImageViewport.ImageLayout computeLayout(IPainter painter)
      Compute the position of the image in this viewport based on the image dimensions, the viewport dimensions and the margin.
    • updatePixelScale

      public void updatePixelScale(Coord2d pixelScale)
      Update internal pixel scale knowledge. Called by render loop and provided by painter's view. May be overrided to update the image.
      Specified by:
      updatePixelScale in interface IImageViewport
    • getPixelScale

      public Coord2d getPixelScale()
      Specified by:
      getPixelScale in interface IImageViewport
    • setImage

      public void setImage(BufferedImage image, int width, int height)
      Set the Image that will be displayed by the layer.
      Parameters:
      image -
    • setImage

      public void setImage(BufferedImage image, int width, int height, ByteBuffer buffer)
    • setImage

      public void setImage(BufferedImage image)
    • getImage

      public BufferedImage getImage()
      Return the image rendered by the AWTImageViewport
    • getMinimumDimension

      public Dimension getMinimumDimension()
      Return the minimum size for this graphic.
      Specified by:
      getMinimumDimension in interface IImageViewport
    • getMargin

      public Margin getMargin()
    • setMargin

      public void setMargin(Margin margin)