Interface Bounds2DComponent
- All Known Implementing Classes:
AbstractVisionShape
,PathBasedVisionShape
,ShapeGroup
public interface Bounds2DComponent
An interface that marks a component that wants to handle its own bounding box, rather than use the bounding box from
Swing/JComponent. Components that implement this interface will always have their swing bounds be the same
size as their parent, but then their Bounds2D property will be used to control their size instead.
-
Method Summary
Modifier and TypeMethodDescriptionCalculate the component's size, creating a new rectangle instance and returning it.Calculates the smallest rectangle that encloses the component.void
setBoundingRect
(Rectangle2D rect) Change the size of this component.void
setOriginalBounds
(Rectangle2D rect)
-
Method Details
-
getBoundingRect
Rectangle2D getBoundingRect()Calculate the component's size, creating a new rectangle instance and returning it. -
getBoundingRect
Calculates the smallest rectangle that encloses the component.- Parameters:
rv
- The "return value" rectangle. May be null, in which case a new rectangle will be returned.- Returns:
- A rectangle (rv if it was not null) containing the current bounds, relative to the shape's nearest non-group parent.
-
setBoundingRect
Change the size of this component. -
getOriginalBounds
Rectangle2D getOriginalBounds() -
setOriginalBounds
-