JTP
Class Square

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by JTP.Square
All Implemented Interfaces:
Shape, Serializable, Cloneable

public class Square
extends Rectangle

This is a subclass of Rectangle. Main use of this class is for button images (most of which are square in this interface implementation)

Author:
V.Termanis
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float
 
Field Summary
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
Square(int x, int y, int size)
          Constructs a new Rectangle whose upper-left corner is specified as (x,y) and whose width and height are equal
 
Method Summary
 void setSize(int size)
          Sets the size of this Rectangle to the specified width and height.
 
Methods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, union
 
Methods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

Square

public Square(int x,
              int y,
              int size)
Constructs a new Rectangle whose upper-left corner is specified as (x,y) and whose width and height are equal

Parameters:
x - the specified X coordinate
y - the specified Y coordinate
size - the width and height of the Square
Method Detail

setSize

public void setSize(int size)
Sets the size of this Rectangle to the specified width and height.

Parameters:
size - the new width and height for this Square