java.lang.Object
org.jhotdraw8.draw.css.value.CssPoint2D
Represents a point with x, y values specified as
CssSizes.- Author:
- Werner Randelshofer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCssPoint2D(double x, double y) CssPoint2D(double x, double y, String units) CssPoint2D(javafx.geometry.Point2D p) CssPoint2D(CssSize x, CssSize y) -
Method Summary
Modifier and TypeMethodDescriptionadd(CssPoint2D that) booleanjavafx.geometry.Point2Dstatic javafx.geometry.Point2DgetPointInBounds(CssPoint2D p, javafx.geometry.Bounds bounds) Gets a point that was given in relative coordinates to a bounds.getX()getY()inthashCode()subtract(CssPoint2D that) toString()
-
Field Details
-
ZERO
-
-
Constructor Details
-
CssPoint2D
-
CssPoint2D
-
CssPoint2D
public CssPoint2D() -
CssPoint2D
public CssPoint2D(double x, double y) -
CssPoint2D
public CssPoint2D(javafx.geometry.Point2D p)
-
-
Method Details
-
equals
-
getX
-
getY
-
hashCode
public int hashCode() -
toString
-
getConvertedValue
public javafx.geometry.Point2D getConvertedValue() -
subtract
-
add
-
getPointInBounds
Gets a point that was given in relative coordinates to a bounds.If the x- or y-coordinate of the point is given as a percentage, then the returned point is
bounds.minX + p.x/100 * bounds.width,bounds.minY + p.y/100 * bounds.height.If the x- or y-coordinate of the point is given with default units, then the returned point is
bounds.minX + p.x * bounds.width,bounds.minY + p.y * bounds.height.Otherwise the returned point is
bounds.minX + p.x,bounds.minY + p.y.- Parameters:
p- point in relative coordinatesbounds- the bounds- Returns:
- point in absolute coordinates
-