return new BoundingBox(x, y, minCol - y, minRow - x);
double startX = maxX - width; rectBounds.add(new BoundingBox(textBounds.getMinX() + startX, textBounds.getMinY() + startY, width, temp.getLayoutBounds().getHeight()));
if (!maximized) { originalBox = new BoundingBox(primaryStage.getX(), primaryStage.getY(), primaryStage.getWidth(), primaryStage.getHeight()); primaryStage.getHeight()).get(0); Rectangle2D bounds = screen.getVisualBounds(); maximizedBox = new BoundingBox(bounds.getMinX(), bounds.getMinY(), bounds.getWidth(),
public static Bounds intersection(Bounds b1, Bounds b2) { Rectangle r1 = toRectangle(b1); Rectangle r2 = toRectangle(b2); Rectangle i = r1.intersection(r2); return new BoundingBox(i.getMinX(), i.getMinY(), i.getWidth(), i.getHeight()); }
private static Bounds extendLeft(Bounds b, double w) { if(w == 0) { return b; } else { return new BoundingBox( b.getMinX() - w, b.getMinY(), b.getWidth() + w, b.getHeight()); } }
/** * Computes new bounds based on translated X and Y * of an entity. * * @param x entity x * @param y entity y * @return computed bounds */ public Bounds translate(double x, double y) { return new BoundingBox(x + bounds.getMinX(), y + bounds.getMinY(), bounds.getWidth(), bounds.getHeight()); }
/** * Computes new bounds based on translated X and Y * of an entity. * * @param x entity x * @param y entity y * @return computed bounds */ public Bounds translate(double x, double y) { return new BoundingBox(x + bounds.getMinX(), y + bounds.getMinY(), bounds.getWidth(), bounds.getHeight()); }
private static Bounds changeY(Bounds original, double amount) { return new BoundingBox(original.getMinX(), original.getMinY() + amount, original.getWidth(), original.getHeight()); }
private static Bounds changeX(Bounds original, double amount) { return new BoundingBox(original.getMinX() + amount, original.getMinY(), original.getWidth(), original.getHeight()); }
private static Bounds changeY(Bounds original, double amount) { return new BoundingBox(original.getMinX(), original.getMinY() + amount, original.getWidth(), original.getHeight()); }
private static Bounds changeHeight(Bounds original, double amount) { return new BoundingBox(original.getMinX(), original.getMinY(), original.getWidth(), original.getHeight() + amount); }
private static Bounds changeWidth(Bounds original, double amount) { return new BoundingBox(original.getMinX(), original.getMinY(), original.getWidth() + amount, original.getHeight()); }
/** * Computes new bounds based on translated X and Y * of an entity with X axis being flipped. * * @param x entity x * @param y entity y * @param entityWidth entity width * @return computed bounds */ public Bounds translateXFlipped(double x, double y, double entityWidth) { return new BoundingBox(x + entityWidth - bounds.getMinX() - bounds.getWidth(), y + bounds.getMinY(), bounds.getWidth(), bounds.getHeight()); }
public void saveFullScreenBounds() { Stage stage = undecorator.getStage(); savedFullScreenBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight()); }
public void saveBounds() { Stage stage = undecorator.getStage(); savedBounds = new BoundingBox(stage.getX(), stage.getY(), stage.getWidth(), stage.getHeight()); }
/** * Computes new bounds based on translated X and Y * of an entity with X axis being flipped. * * @param x entity x * @param y entity y * @param entityWidth entity width * @return computed bounds */ public Bounds translateXFlipped(double x, double y, double entityWidth) { return new BoundingBox(x + entityWidth - bounds.getMinX() - bounds.getWidth(), y + bounds.getMinY(), bounds.getWidth(), bounds.getHeight()); }
boolean isInsideStateIcon(Point2D point) { BoundingBox bounds = new BoundingBox(expandedStateLabel.getLayoutX(), expandedStateLabel.getLayoutY(), expandedStateLabel.getWidth(), expandedStateLabel.getHeight()); return bounds.contains(point); }
/** * Creates a hit box with given name, local origin (top-left) and shape. * * @param name name of the hit box * @param localOrigin origin of hit box * @param shape bounding shape */ public HitBox(String name, Point2D localOrigin, BoundingShape shape) { this.name = name; this.shape = shape; this.bounds = new BoundingBox(localOrigin.getX(), localOrigin.getY(), shape.getSize().getWidth(), shape.getSize().getHeight()); }
/** * Creates a hit box with given name, local origin (top-left) and shape. * * @param name name of the hit box * @param localOrigin origin of hit box * @param shape bounding shape */ public HitBox(String name, Point2D localOrigin, BoundingShape shape) { this.name = name; this.shape = shape; this.bounds = new BoundingBox(localOrigin.getX(), localOrigin.getY(), shape.getSize().getWidth(), shape.getSize().getHeight()); }
private static Bounds sceneBoundsToScreenBounds( Bounds sceneBounds, Scene scene ) { Window window = targetWindow( scene.getWindow() ); BoundingBox b = new BoundingBox( window.getX() + scene.getX() + sceneBounds.getMinX(), window.getY() + scene.getY() + sceneBounds.getMinY(), sceneBounds.getWidth(), sceneBounds.getHeight() ); return b; }