graphics
Class Pointf

java.lang.Object
  |
  +--java.awt.Component
        |
        +--graphics.Pointf
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Pointf
extends java.awt.Component
implements java.io.Serializable

The Pointf class represents a location in a two-dimensional (xy) coordinate space.

Since:
Kahindu 2.4
Version:
1.0, 1/6/99
Author:
Douglas Lyon
See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
 float dotSize
           
 float x
           
 float y
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Pointf()
          Constructs and initializes a point at the origin (0, 0) of the coordinate space.
Pointf(float x, float y)
          Constructs and initializes a point at the specified (xy) location in the coordinate space.
Pointf(Pointf p)
          Constructs and initializes a point with the same location as the specified Point object.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Determines whether two points are equal.
 java.awt.Point getLocation()
          Returns the location of this point.
 int hashCode()
          Returns the hashcode for this point.
 void move(float x, float y)
          Moves this point to the specificed location in the (xy) coordinate plane.
 void setLocation(float x, float y)
          Changes the point to have the specificed location.
 void setLocation(Pointf p)
          Sets the location of the point to the specificed location.
 java.lang.String toString()
          Returns a representation of this point and its location in the (xy) coordinate space as a string.
 void translate(float x, float y)
          Translates this point, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy).
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

dotSize

public float dotSize

x

public float x

y

public float y
Constructor Detail

Pointf

public Pointf()
Constructs and initializes a point at the origin (0, 0) of the coordinate space.
Parameters:
x - the x coordinate.
y - the y coordinate.
Since:
Kahindu 2.4

Pointf

public Pointf(float x,
              float y)
Constructs and initializes a point at the specified (xy) location in the coordinate space.
Parameters:
x - the x coordinate.
y - the y coordinate.
Since:
Kahindu 2.4

Pointf

public Pointf(Pointf p)
Constructs and initializes a point with the same location as the specified Point object.
Parameters:
p - a point.
Since:
Kahindu 2.4
Method Detail

equals

public boolean equals(java.lang.Object obj)
Determines whether two points are equal. Two instances of Point are equal if the values of their x and y member fields, representing their position in the coordinate space, are the same.
Overrides:
equals in class java.lang.Object
Parameters:
obj - an object to be compared with this point.
Returns:
true if the object to be compared is an instance of Point and has the same values; false otherwise.
Since:
kahindu 2.4

getLocation

public java.awt.Point getLocation()
Returns the location of this point. This method is included for completeness, to parallel the getLocation method of Component.
Overrides:
getLocation in class java.awt.Component
Returns:
a copy of this point, at the same location.
Since:
Kahindu 2.4
See Also:
Component.getLocation(), Point.setLocation(java.awt.Point), Point.setLocation(int, int)

hashCode

public int hashCode()
Returns the hashcode for this point.
Overrides:
hashCode in class java.lang.Object
Returns:
a hash code for this point.
Since:
Kahindu 2.4

move

public void move(float x,
                 float y)
Moves this point to the specificed location in the (xy) coordinate plane. This method is identical with setLocation(int, int).
Parameters:
x - the x coordinate of the new location.
y - the y coordinate of the new location.
Since:
Kahindu 2.4
See Also:
Component.setLocation(int, int)

setLocation

public void setLocation(float x,
                        float y)
Changes the point to have the specificed location.

This method is included for completeness, to parallel the setLocation method of Component. Its behavior is identical with move(int, int).

Parameters:
x - the x coordinate of the new location.
y - the y coordinate of the new location.
Since:
Kahindu 2.4
See Also:
Component.setLocation(int, int), Point.getLocation(), Point.move(int, int)

setLocation

public void setLocation(Pointf p)
Sets the location of the point to the specificed location. This method is included for completeness, to parallel the setLocation method of Component.
Parameters:
p - a point, the new location for this point.
Since:
Kahindu 2.4
See Also:
Component.setLocation(java.awt.Point), Point.getLocation()

toString

public java.lang.String toString()
Returns a representation of this point and its location in the (xy) coordinate space as a string.
Overrides:
toString in class java.awt.Component
Returns:
a string representation of this point, including the values of its member fields.
Since:
kahindu 2.4

translate

public void translate(float x,
                      float y)
Translates this point, at location (xy), by dx along the x axis and dy along the y axis so that it now represents the point (x + dx, y + dy).
Parameters:
dx - the distance to move this point along the x axis.
dy - the distance to move this point along the y axis.
Since:
Kahindu 2.4