element
Class RoundRect

java.lang.Object
  |
  +--element.Rect
        |
        +--element.RoundRect

public class RoundRect
extends Rect

Copyright (c) 1997 McGraw-Hill All Rights Reserved.

Permission to use, copy, modify, and distribute this software and its documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies. Please refer to the file "copyright.html" for further important copyright and licensing information.

MCGRAW-HILL MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. MCGRAW-HILL SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.


Field Summary
protected  int cornerHeight
           
protected  int cornerWidth
           
 
Fields inherited from class element.Rect
height, left, top, width
 
Constructor Summary
RoundRect()
          post: constructs a trivial rectangle at origin
RoundRect(int x, int y, int w, int h)
          pre: w >= 0, h >= 0
post: constructs rectangle with top left at (x,y)
width w, height h
RoundRect(int x, int y, int w, int h, int cw, int ch)
          pre: w >= 0, h >= 0
post: constructs rectangle with top left at (x,y)
width w, height h
RoundRect(Pt p, Pt q)
           
RoundRect(Rect r, int cw, int ch)
          post: constructs a rounded rectangle
RoundRect(RoundRect r)
           
 
Method Summary
 void clearOn(DrawingWindow d)
          Erase rectangle from the drawing window d.
 java.lang.Object clone()
          post: returns a distinct copy of the Object
 boolean contains(Pt p)
          Returns true if p is contained within rectangle
 int cornerHeight()
           
 void cornerHeight(int ch)
           
 int cornerWidth()
           
 void cornerWidth(int cw)
           
 void drawOn(DrawingWindow d)
          Draw (in the current mode) the rectangle on the drawing window
 boolean equals(java.lang.Object other)
          post: returns true if two round rects are equal
 void fillOn(DrawingWindow d)
          Draw a filled rectangle (in the current mode) on drawing window d.
 int hashCode()
          post: returns suitable hash code
 java.lang.String toString()
          post: returns a string representation of Object
 
Methods inherited from class element.Rect
bottom, bottom, center, center, extend, height, height, left, left, move, moveTo, moveTo, Rectangle, right, right, top, top, width, width
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cornerWidth

protected int cornerWidth

cornerHeight

protected int cornerHeight
Constructor Detail

RoundRect

public RoundRect()
post: constructs a trivial rectangle at origin

RoundRect

public RoundRect(Pt p,
                 Pt q)
Parameters:
p -  
q -  

RoundRect

public RoundRect(Rect r,
                 int cw,
                 int ch)
post: constructs a rounded rectangle
Parameters:
r -  
cw -  
ch -  

RoundRect

public RoundRect(int x,
                 int y,
                 int w,
                 int h,
                 int cw,
                 int ch)
pre: w >= 0, h >= 0
post: constructs rectangle with top left at (x,y)
width w, height h
Parameters:
x -  
y -  
w -  
h -  
cw -  
ch -  

RoundRect

public RoundRect(int x,
                 int y,
                 int w,
                 int h)
pre: w >= 0, h >= 0
post: constructs rectangle with top left at (x,y)
width w, height h
Parameters:
x -  
y -  
w -  
h -  

RoundRect

public RoundRect(RoundRect r)
Parameters:
r -  
Method Detail

cornerWidth

public int cornerWidth()
Returns:
 

cornerHeight

public int cornerHeight()
Returns:
 

cornerWidth

public void cornerWidth(int cw)
Parameters:
cw -  

cornerHeight

public void cornerHeight(int ch)
Parameters:
ch -  

contains

public boolean contains(Pt p)
Description copied from class: Rect
Returns true if p is contained within rectangle
Overrides:
contains in class Rect
Parameters:
p -  
Returns:
 

fillOn

public void fillOn(DrawingWindow d)
Description copied from class: Rect
Draw a filled rectangle (in the current mode) on drawing window d.
Overrides:
fillOn in class Rect
Parameters:
d -  

clearOn

public void clearOn(DrawingWindow d)
Description copied from class: Rect
Erase rectangle from the drawing window d.
Overrides:
clearOn in class Rect
Parameters:
d -  

drawOn

public void drawOn(DrawingWindow d)
Description copied from class: Rect
Draw (in the current mode) the rectangle on the drawing window
Overrides:
drawOn in class Rect
Parameters:
d -  

hashCode

public int hashCode()
post: returns suitable hash code
Overrides:
hashCode in class Rect
Returns:
 

equals

public boolean equals(java.lang.Object other)
post: returns true if two round rects are equal
Overrides:
equals in class Rect
Parameters:
other -  
Returns:
 

clone

public java.lang.Object clone()
post: returns a distinct copy of the Object
Overrides:
clone in class Rect
Returns:
 

toString

public java.lang.String toString()
post: returns a string representation of Object
Overrides:
toString in class Rect
Returns: