Class Viewer2D


public abstract class Viewer2D extends Viewer
A viewer that displays a 2D environment. It uses a CanvasDrawerGUI to draw the environment on a canvas.
  • Constructor Details

    • Viewer2D

      public Viewer2D()
  • Method Details

    • onActivation

      protected void onActivation()
      On activation.
      Overrides:
      onActivation in class Viewer
    • getGraphics

      protected GraphicsContext getGraphics()
      Gets the graphics context to draw on the canvas.
      Returns:
      the graphics context to draw on the canvas.
    • render

      public void render()
      Redefines so that the paint over mode is taken into account.
      Specified by:
      render in class Viewer
    • getGUI

      public CanvasDrawerGUI getGUI()
      Redefines to benefit from automatic casting.
      Overrides:
      getGUI in class Viewer
      Returns:
      the GUI of this viewer
    • setPaintOver

      public void setPaintOver(boolean paintOver)
      Sets the paint over mode. When paint over mode is enabled, the canvas is not cleared before rendering.
      Parameters:
      paintOver - the paintOver to set
    • isPaintOver

      public boolean isPaintOver()
      Returns the paint over mode.
      Returns:
      true if the paint over mode is enabled