Package Shapes

Class MyRectangle

java.lang.Object

public class MyRectangle
extends MyBoundedShape
a rectangle shape class that knows how to draw the rectangle
Author:
Itay Finci
  • Field Summary

    Fields inherited from class Shapes.MyShape

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

    Constructors 
    Constructor Description
    MyRectangle​(java.awt.Point origin, java.awt.Point target, java.awt.Color color, boolean isFilled, int thickness)
    makes new rectangle
  • 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 Shapes.MyBoundedShape

    calculateHeight, calculateWidth, findStart, isFilled

    Methods inherited from class java.lang.Object

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

    • MyRectangle

      public MyRectangle​(java.awt.Point origin, java.awt.Point target, java.awt.Color color, boolean isFilled, int thickness)
      makes new rectangle
      Parameters:
      origin - the origin of the rectangle
      target - the end of the rectangle
      color - the color of the rectangle
      isFilled - if the rectangle is filled or outlined
      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