Package Shapes

Class MyLine

java.lang.Object
Shapes.MyShape
Shapes.MyLine

public class MyLine
extends MyShape
represents line that can be drawn
Author:
Itay Finci
  • Field Summary

    Fields inherited from class Shapes.MyShape

    color, origin, stroke, target, thickness
  • Constructor Summary

    Constructors 
    Constructor Description
    MyLine​(java.awt.Point origin, java.awt.Point target, java.awt.Color color, int thickness)
    makes a new line
  • Method Summary

    Modifier and Type Method Description
    void draw​(java.awt.Graphics g)
    shapes will implement this method to be drawn

    Methods inherited from class java.lang.Object

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

    • MyLine

      public MyLine​(java.awt.Point origin, java.awt.Point target, java.awt.Color color, int thickness)
      makes a new line
      Parameters:
      origin - the origin point of the line
      target - the end point of the line
      color - the color of the line
      thickness - the line thickness
  • Method Details

    • draw

      public void draw​(java.awt.Graphics g)
      Description copied from class: MyShape
      shapes will implement this method to be drawn
      Specified by:
      draw in class MyShape
      Parameters:
      g - the graphics manager