Rectangle

Methods
11
Fields
4

Getting one

Rectangle.new(…)
WidgetItem.new(…):getCanvasBounds()
WidgetItem.new(…):getDraggingCanvasBounds()

Methods

MethodReturnsDescription
getSize()DimensionThe size, as a new Dimension.
getLocation()PointThe corner, as a new Point.
setLocation(number, number)()(Rectangle, number, number) -> (): Move the corner to x, y.
setLocation(Point)()
setSize(number, number)()(Rectangle, number, number) -> (): Resize.
setSize(Dimension)()
setBounds(number, number, number, number)()Set every field.
add(number, number)()(Rectangle, number, number) -> (): Grow to include the point, as AWT's add.
add(Point)()
add(Rectangle)()
translate(number, number)()Move by dx, dy, clamped as AWT clamps.
grow(number, number)()Grow by h on the left and right and v top and bottom.
intersection(Rectangle)RectangleThe overlap, as a new rectangle (empty, with AWT's negative size, when there is none).
union(Rectangle)RectangleThe smallest rectangle holding both.
new(number, number, number, number)Rectangle(number, number, number, number) -> Rectangle: The rectangle at x, y, width by height.
new(number, number)Rectangle
new(Point)Rectangle
new(Dimension)Rectangle
new(Rectangle)Rectangle
new()Rectangle

Fields

FieldTypeDescription
xnumberThe x, AWT's field.
ynumberThe y, AWT's field.
widthnumberThe width, AWT's field.
heightnumberThe height, AWT's field.

Returned by

MethodReturnsDescription
Component.getBoundsRectangleThe bounds in the parent, as a new Rectangle.
Graphics.getClipBoundsRectangle?The clip's bounds in user space, or nil with none.
JList.getCellBoundsRectangle?The bounds of the cells of rows index0 to index1 (their union), or nil when either row is outside the model.
JViewport.getViewRectRectangleThe visible part of the view, in view coordinates.
LayoutableRenderableEntity.getBoundsRectangle?getBounds(): where the last render put it (nil for a TooltipComponent).
Overlay.getBoundsRectangleWhere it was last drawn: location and the size render answered. A copy.
Overlay.getParentBoundsRectangle?The area dragging keeps it inside, or nil for the canvas. Nil; override it.
RectangleClass.newRectangle(number, number, number, number) -> Rectangle: The rectangle at x, y, width by height.
Shape.getBoundsRectangleThe integer bounding rectangle: the exact bounds with their edges rounded outward to whole pixels.
Widget.getBoundsRectangleThe canvas area the widget covers: [getCanvasLocation] (the draw record once the layer points install, the layout before) and its laid-ou…
WidgetItem.getCanvasBoundsRectangle(WidgetItem) -> Rectangle: Where it is drawn, the drag included. The same Rectangle while the item is drawn there (and a new one once a…
WidgetItem.getDraggingCanvasBoundsRectangle?Where it is drawn while dragged, nil when it is not: the same Rectangle getCanvasBounds() hands out while it is dragged.

Method details

setLocation

setLocation: ((Rectangle, number, number) -> ()) & ((Rectangle, Point) -> ())

(Rectangle, number, number) -> (): Move the corner to x, y.

(Rectangle, Point) -> (): Move the corner to p.

add

add: ((Rectangle, number, number) -> ()) & ((Rectangle, Point) -> ()) & ((Rectangle, Rectangle) -> ())

(Rectangle, number, number) -> (): Grow to include the point, as AWT's add.

(Rectangle, Point) -> (): Grow to include p.

(Rectangle, Rectangle) -> (): Grow to include r.

translate

translate: (Rectangle, number, number) -> ()

Move by dx, dy, clamped as AWT clamps.

grow

grow: (Rectangle, number, number) -> ()

Grow by h on the left and right and v top and bottom.

new

new: ((number, number, number, number) -> Rectangle) & ((number, number) -> Rectangle) & ((Point) -> Rectangle) & ((Dimension) -> Rectangle) & ((Rectangle) -> Rectangle) & (() -> Rectangle)

(number, number, number, number) -> Rectangle: The rectangle at x, y, width by height.

(number, number) -> Rectangle: A width by height rectangle at the origin.

(Point) -> Rectangle: An empty rectangle at p.

(Dimension) -> Rectangle: A rectangle of size d at the origin.

(Rectangle) -> Rectangle: A copy of r.

() -> Rectangle: The empty rectangle at the origin.