|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--graphics.Pointf
The Pointf
class represents a location in a
two-dimensional (x, y) coordinate space.
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 (x, y) 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 (x, y) 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 (x, y) coordinate space as a string. |
void |
translate(float x,
float y)
Translates this point, at location (x, y), 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 |
public float dotSize
public float x
public float y
Constructor Detail |
public Pointf()
x
- the x coordinate.y
- the y coordinate.public Pointf(float x, float y)
x
- the x coordinate.y
- the y coordinate.public Pointf(Pointf p)
Point
object.p
- a point.Method Detail |
public boolean equals(java.lang.Object obj)
Point
are equal if the values of their
x
and y
member fields, representing
their position in the coordinate space, are the same.equals
in class java.lang.Object
obj
- an object to be compared with this point.true
if the object to be compared is
an instance of Point
and has
the same values; false
otherwise.public java.awt.Point getLocation()
getLocation
method of Component
.getLocation
in class java.awt.Component
Component.getLocation()
,
Point.setLocation(java.awt.Point)
,
Point.setLocation(int, int)
public int hashCode()
hashCode
in class java.lang.Object
public void move(float x, float y)
setLocation(int, int)
.x
- the x coordinate of the new location.y
- the y coordinate of the new location.Component.setLocation(int, int)
public void setLocation(float x, float y)
This method is included for completeness, to parallel the
setLocation
method of Component
.
Its behavior is identical with move(int, int)
.
x
- the x coordinate of the new location.y
- the y coordinate of the new location.Component.setLocation(int, int)
,
Point.getLocation()
,
Point.move(int, int)
public void setLocation(Pointf p)
setLocation
method of Component
.p
- a point, the new location for this point.Component.setLocation(java.awt.Point)
,
Point.getLocation()
public java.lang.String toString()
toString
in class java.awt.Component
public void translate(float x, float y)
dx
along the x axis and dy
along the y axis so that it now represents the point
(x
+
dx
,
y
+
dy
).dx
- the distance to move this point
along the x axis.dy
- the distance to move this point
along the y axis.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |