Class Fenetre

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class Fenetre extends Canvas
2D window allowing to draw line segments and points
See Also:
  • Field Details

  • Constructor Details

    • Fenetre

      public Fenetre()
      Creates a new Fenetre and shows it immediately.
    • Fenetre

      public Fenetre(boolean setVisible)
      Creates a new Fenetre and shows it only if setVisible == true (recommended when one wants to update the Fenetre's data structures before showing it).
    • Fenetre

      public Fenetre(String title)
      Creates a new Fenetre with a given title.
    • Fenetre

      public Fenetre(BufferedImage bimg, String title)
      Creates a new Fenetre with a given title and background image.
  • Method Details

    • update

      protected void update(double x, double y)
      Update of the bounding box
    • boundingBox

      public double[] boundingBox()
      Get bounding box coordinates
    • clearWindow

      public void clearWindow()
      Remove all points and segments from the window
    • ajoutePoint

      public void ajoutePoint(double x, double y)
    • addLabel

      public void addLabel(String label, Point_2 p)
      Draw a text label at a given position
    • addPoints

      public void addPoints(Point_2[] points)
    • addPoint

      public void addPoint(Point_2 point)
      Add a 2D point to the window
    • addPoints

      public void addPoints(Collection<Point_2> points)
      Add a collection of 2D points
    • addGenericPoints

      public void addGenericPoints(Collection<Point_> points)
      Add a collection of (generic) points
    • addSegments

      public void addSegments(Collection<Point_2[]> segments)
    • addFatSegments

      public void addFatSegments(Collection<Point_2[]> segments)
    • addTriangle

      public void addTriangle(Point_2[] points)
      Add the three segments of a triangle
    • addTriangles

      public void addTriangles(Collection<Point_2[]> triangles)
      Add a list of triangles
    • addSegment

      public void addSegment(Point_2 p1, Point_2 p2)
      Add a segment
    • addColoredSegment

      public void addColoredSegment(Point_2 p1, Point_2 p2, Color c)
      Draw a segment with a given color
    • addFatSegment

      public void addFatSegment(Point_2 p1, Point_2 p2)
    • addPolyhedronEdges

      public void addPolyhedronEdges(Polyhedron_3<Point_2> polyhedron)
      Draw all halfedges of a planar Polyhedron (half-edge DS)
    • addPolyhedronColoredEdges

      public void addPolyhedronColoredEdges(Polyhedron_3<Point_2> polyhedron, Color[] colors)
    • addColoredSegments

      public void addColoredSegments(Collection<Point_2[]> segments, Color[] colors)
    • ajouteSegment

      public void ajouteSegment(double x1, double y1, double x2, double y2)
    • addColoredSegment

      public void addColoredSegment(double x1, double y1, double x2, double y2, Color c)
    • addFatSegment

      public void addFatSegment(double x1, double y1, double x2, double y2)
    • paint

      void paint(Graphics2D g, Point2D p, Color c)
      Draw a point on the canvas
    • setTransform

      protected void setTransform(Graphics2D g)
    • paintNoTransform

      protected void paintNoTransform(Graphics2D g)
    • paint

      public void paint(Graphics graphics)
      Overrides:
      paint in class Canvas
    • displayImage

      public void displayImage(Graphics2D g, BufferedImage bimg, int x, int y)
    • setVisible

      public void setVisible()
      Shows the Fenetre.
    • main

      public static void main(String[] args)