Class Point


public class Point extends Shape
One more points in the plot.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static char[]
    The marks of point.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Point(double[][] points, char mark, Color color)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Point
    of(double[][] points)
    Creates a Point with circle mark and black color.
    static Point
    of(double[][] points, char mark)
    Creates a Point with black color.
    static Point
    of(double[][] points, Color color)
    Creates a Point with circle mark.
    void
    Draws the shape.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MARKS

      public static char[] MARKS
      The marks of point.
  • Constructor Details

    • Point

      public Point(double[][] points, char mark, Color color)
      Constructor.
      Parameters:
      points - an n-by-2 or n-by-3 matrix that are the coordinates of points.
      mark - the mark of points.
      • . : dot
      • + : +
      • - : -
      • | : |
      • * : star
      • x : x
      • o : circle
      • O : large circle
      • @ : solid circle
      • # : large solid circle
      • s : square
      • S : large square
      • q : solid square
      • Q : large solid square
      • others : dot
      color - the color of points.
  • Method Details

    • paint

      public void paint(Graphics g)
      Description copied from class: Shape
      Draws the shape.
      Specified by:
      paint in class Shape
    • of

      public static Point of(double[][] points)
      Creates a Point with circle mark and black color.
    • of

      public static Point of(double[][] points, Color color)
      Creates a Point with circle mark.
    • of

      public static Point of(double[][] points, char mark)
      Creates a Point with black color.