wheels.users
Class Rectangle

java.lang.Object
  extended bywheels.etc.AbstractGraphic
      extended bywheels.users.Shape
          extended bywheels.users.RectangularShape
              extended bywheels.users.Rectangle
All Implemented Interfaces:
AdvancedColorable, Colorable, CustomGraphic, Locatable, Rotatable, Sizeable

public class Rectangle
extends RectangularShape

Subclass of RectangularShape that draws a rectangle.

Author:
Sanders & van Dam. Object-Oriented Programming in Java.

Field Summary
 
Fields inherited from class wheels.users.Shape
_dp, _shape, DEFAULT_COLOR
 
Constructor Summary
Rectangle()
          Creates a rectangle with dimensions DEFAULT_WIDTH x DEFAULT_HEIGHT and color DEFAULT_COLOR, located in the center of the wheels.users.Frame's DrawingPanel.
Rectangle(Color c)
          Creates a rectangle with default dimension and location in the wheels.users.Frame's DrawingPanel, but with the specified color.
Rectangle(DrawingPanel dp)
          Creates a rectangle in the passed-in drawing panel.
Rectangle(int degrees)
          Creates a rectangle with default location, dimension, and color in the wheels.users.Frame's DrawingPanel, but at rotation degrees
Rectangle(int x, int y)
          Creates a rectangle with default dimension and color in the wheels.users.Frame's DrawingPanel, but at location (x, y).
 
Methods inherited from class wheels.users.RectangularShape
actualPaint, getBounds, getFillColor, getFrameColor, getFrameThickness, getHeight, getLocation, getSize, getWidth, getXLocation, getYLocation, setColor, setFillColor, setFrameColor, setFrameThickness, setLocation, setLocation, setSize, setSize
 
Methods inherited from class wheels.users.Shape
contains, getColor, getRotation, hide, paint, setRotation, show
 
Methods inherited from class wheels.etc.AbstractGraphic
mouseClicked, mouseDragged, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wheels.Colorable
getColor
 

Constructor Detail

Rectangle

public Rectangle()
Creates a rectangle with dimensions DEFAULT_WIDTH x DEFAULT_HEIGHT and color DEFAULT_COLOR, located in the center of the wheels.users.Frame's DrawingPanel.


Rectangle

public Rectangle(Color c)
Creates a rectangle with default dimension and location in the wheels.users.Frame's DrawingPanel, but with the specified color.


Rectangle

public Rectangle(int x,
                 int y)
Creates a rectangle with default dimension and color in the wheels.users.Frame's DrawingPanel, but at location (x, y).


Rectangle

public Rectangle(int degrees)
Creates a rectangle with default location, dimension, and color in the wheels.users.Frame's DrawingPanel, but at rotation degrees


Rectangle

public Rectangle(DrawingPanel dp)
Creates a rectangle in the passed-in drawing panel. In this constructor, dimension is 0x0, location (0, 0), and the color is the same as the DrawingPanel's by default.