Example usage for Java org.eclipse.jface.util Geometry fields, constructors, methods, implement or subclass
The text is from its open source code.
Rectangle | add(Rectangle rect1, Rectangle rect2) Returns a new Rectangle whose x, y, width, and height is the sum of the x, y, width, and height values of both rectangles respectively. |
Point | add(Point point1, Point point2) Adds two points as 2d vectors. |
Point | centerPoint(Rectangle rect) Returns the point in the center of the given rectangle. |
Point | copy(Point toCopy) Returns a copy of the given point |
Rectangle | copy(Rectangle toCopy) Returns a copy of the given rectangle |
Rectangle | createDiffRectangle(int left, int right, int top, int bottom) Returns a rectangle which, when added to another rectangle, will expand each side by the given number of units. |
Rectangle | createRectangle(Point position, Point size) Returns a new rectangle with the given position and dimensions, expressed as points. |
int | distanceSquared(Point p1, Point p2) Returns the square of the distance between two points. |
Point | divide(Point toDivide, int scalar) Divides both coordinates of the given point by the given scalar. |
void | expand(Rectangle rect, int left, int right, int top, int bottom) Moves each edge of the given rectangle outward by the given amount. |
void | flipXY(Point toFlip) Swaps the X and Y coordinates of the given point. |
void | flipXY(Rectangle toFlip) Swaps the X and Y coordinates of the given rectangle, along with the height and width. |
int | getClosestSide(Rectangle boundary, Point toTest) Returns the edge of the given rectangle is closest to the given point. |
int | getCoordinate(Point toMeasure, boolean width) Returns the x or y coordinates of the given point. |
int | getCoordinate(Rectangle toMeasure, boolean width) Returns the x or y coordinates of the given rectangle. |
int | getDimension(Rectangle toMeasure, boolean width) Returns the height or width of the given rectangle. |
Rectangle | getExtrudedEdge(Rectangle toExtrude, int size, int orientation) Extrudes the given edge inward by the given distance. |
Point | getLocation(Rectangle toQuery) Returns the x,y position of the given rectangle. |
int | getOppositeSide(int swtDirectionConstant) Returns the opposite of the given direction. |
Point | getSize(Rectangle rectangle) Returns the size of the rectangle, as a Point |
boolean | isHorizontal(int swtSideConstant) Returns true iff the given SWT side constant corresponds to a horizontal side of a rectangle. |
Point | max(Point p1, Point p2) Returns a new point whose coordinates are the maximum of the coordinates of the given points |
Point | min(Point p1, Point p2) Returns a new point whose coordinates are the minimum of the coordinates of the given points |
void | moveInside(Rectangle inner, Rectangle outer) Repositions the 'inner' rectangle to lie completely within the bounds of the 'outer' rectangle if possible. |
void | set(Point result, Point toCopy) Sets result equal to toCopy |
void | set(Rectangle result, Rectangle toCopy) Sets result equal to toCopy |
void | setDimension(Rectangle toSet, boolean width, int newCoordinate) Sets one dimension of the given rectangle. |
Rectangle | subtract(Rectangle rect1, Rectangle rect2) Returns a new difference Rectangle whose x, y, width, and height are equal to the difference of the corresponding attributes from the given rectangles Example: Compute the margins for a given Composite, and apply those same margins to a new GridLayout |
Point | subtract(Point point1, Point point2) Performs vector subtraction on two points. |
Rectangle | toControl(Control coordinateSystem, Rectangle toConvert) Converts the given rectangle from display coordinates to the local coordinate system of the given object into display coordinates. |
Rectangle | toDisplay(Control coordinateSystem, Rectangle toConvert) Converts the given rectangle from the local coordinate system of the given object into display coordinates. |