Class GLine

    • Constructor Detail

      • GLine

        public GLine​(double x,
                     double y,
                     double x2,
                     double y2,
                     Color col,
                     int lineWidth)
    • Method Detail

      • draw

        public void draw​(Graphics2D g)
        generate the shape to draw
        Specified by:
        draw in class GObject
        Parameters:
        g - the Graphics to paint
      • inShape

        public boolean inShape​(double mx,
                               double my)
        override the function since Line2D.contains(double, double) always return false Whether the given position is in this object
        Overrides:
        inShape in class GObject
        Parameters:
        mx - x
        my - y
        Returns:
        True if in the object