element
Class Pt

java.lang.Object
  |
  +--element.Pt

public class Pt
extends java.lang.Object
implements Drawable

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.


Constructor Summary
Pt()
           
Pt(int x, int y)
           
Pt(Pt p)
           
 
Method Summary
 int bottom()
          Return the bottom coordinate of the bounding box of the object
 void bottom(int y)
           
 Pt center()
          Return the center of the object
 void center(Pt p)
          Reset the center of the object to be at point p.
 void clearOn(DrawingWindow d)
          Erase a filled version of this object (in the current mode) on a drawing window
 java.lang.Object clone()
           
 boolean contains(Pt that)
           
 void drawOn(DrawingWindow d)
          Draw this object (in the current mode) on a drawing window
 boolean equals(java.lang.Object p)
           
 void fillOn(DrawingWindow d)
          Draw a filled version of this object (in the current mode) on a drawing window
 int hashCode()
           
 int height()
          Return the height of the bounding box of the object
 int left()
          Return the leftmost coordinate of bounding box of object
 void left(int x)
           
 void move(int dx, int dy)
           
 void moveTo(int x, int y)
           
 void moveTo(Pt p)
           
 int right()
          Return the rightmost coordinate of the bounding box of the object
 void right(int x)
           
 int top()
          Return the top coordinate of the bounding box of the object
 void top(int y)
           
 java.lang.String toString()
           
 int width()
          Return the width of the bounding box of the object
 int x()
           
 void x(int x)
           
 int y()
           
 void y(int newy)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pt

public Pt()

Pt

public Pt(Pt p)
Parameters:
p -  

Pt

public Pt(int x,
          int y)
Parameters:
x -  
y -  
Method Detail

x

public int x()
Returns:
 

y

public int y()
Returns:
 

x

public void x(int x)
Parameters:
x - the new horizontal coordinate

y

public void y(int newy)
Parameters:
newy -  

left

public int left()
Description copied from interface: Drawable
Return the leftmost coordinate of bounding box of object
Specified by:
left in interface Drawable
Returns:
 

right

public int right()
Description copied from interface: Drawable
Return the rightmost coordinate of the bounding box of the object
Specified by:
right in interface Drawable
Returns:
 

top

public int top()
Description copied from interface: Drawable
Return the top coordinate of the bounding box of the object
Specified by:
top in interface Drawable
Returns:
 

bottom

public int bottom()
Description copied from interface: Drawable
Return the bottom coordinate of the bounding box of the object
Specified by:
bottom in interface Drawable
Returns:
 

left

public void left(int x)
Parameters:
x -  

right

public void right(int x)
Parameters:
x -  

top

public void top(int y)
Parameters:
y -  

bottom

public void bottom(int y)
Parameters:
y -  

width

public int width()
Description copied from interface: Drawable
Return the width of the bounding box of the object
Specified by:
width in interface Drawable
Returns:
 

height

public int height()
Description copied from interface: Drawable
Return the height of the bounding box of the object
Specified by:
height in interface Drawable
Returns:
 

contains

public boolean contains(Pt that)
Parameters:
that -  

center

public Pt center()
Description copied from interface: Drawable
Return the center of the object
Specified by:
center in interface Drawable
Tags copied from interface: Drawable
Returns:
the center of the object

center

public void center(Pt p)
Description copied from interface: Drawable
Reset the center of the object to be at point p. Dimensions remain unchanged
Specified by:
center in interface Drawable
Parameters:
p -  

move

public void move(int dx,
                 int dy)
Parameters:
dx -  
dy -  

moveTo

public void moveTo(int x,
                   int y)
Parameters:
x -  
y -  

moveTo

public void moveTo(Pt p)
Parameters:
p -  

fillOn

public void fillOn(DrawingWindow d)
Description copied from interface: Drawable
Draw a filled version of this object (in the current mode) on a drawing window
Specified by:
fillOn in interface Drawable
Parameters:
d -  

clearOn

public void clearOn(DrawingWindow d)
Description copied from interface: Drawable
Erase a filled version of this object (in the current mode) on a drawing window
Specified by:
clearOn in interface Drawable
Parameters:
d -  

drawOn

public void drawOn(DrawingWindow d)
Description copied from interface: Drawable
Draw this object (in the current mode) on a drawing window
Specified by:
drawOn in interface Drawable
Parameters:
d -  

equals

public boolean equals(java.lang.Object p)
Overrides:
equals in class java.lang.Object
Parameters:
p -  
Returns:
 

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
Returns:
 

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
 

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns: