Class Canvas2D

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Canvas2D extends JPanel

Swing JPanel instance where everything is drawn.

Version:
$Id: $Id
Author:
pastthepixels
See Also:
  • Field Details

  • Constructor Details

    • Canvas2D

      public Canvas2D()
  • Method Details

    • setScene

      public void setScene(Scene scene)

      Setter for the field scene.

      Parameters:
      scene - a Scene object
    • hasScene

      public boolean hasScene()

      Returns true if the value scene is not null.

      Returns:
      a boolean
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • drawAll

      public void drawAll()

      Forces the canvas to re-draw itself.