@OpenApiAll
public class ContainerShape
extends java.lang.Object
Constructor and Description |
---|
ContainerShape() |
Modifier and Type | Method and Description |
---|---|
void |
addEllipse(java.awt.Rectangle el)
Add ellipse.
|
void |
addShape(Line line)
Add line.
|
void |
addShape(java.awt.Polygon polygon)
Add Polygon.
|
void |
addShape(java.awt.Rectangle rect)
Add rectangle shape.
|
void |
addShape(java.awt.geom.RoundRectangle2D rect)
Add rectangle shape.
|
static ContainerShape |
createPolygonContainerShape(ContainerShape shape,
int[] x,
int[] y)
Creates container shape from polygon points.
|
static ContainerShape |
createPolygonContainerShape(int[] x,
int[] y)
Creates container shape from polygon points.
|
java.util.List<java.awt.Rectangle> |
getEllipses()
Returns contained ellipses
|
java.util.List<Line> |
getLines()
Returns contained lines.
|
java.util.List<java.awt.Polygon> |
getPolygons()
Returns polygons
|
java.util.List<java.awt.Rectangle> |
getRectangles()
Returns contained rectangles.
|
java.util.List<java.awt.geom.RoundRectangle2D> |
getRoundRectangles()
Returns round rectangles
|
java.awt.Point |
intersection(int ax,
int ay,
int bx,
int by)
Computes the intersection of this shape (intersection with any of contained shapes) with the specified line.
|
java.awt.Point |
intersection(java.awt.Point a,
java.awt.Point b) |
boolean |
intersects(java.awt.Rectangle bounds)
Indicates if container shape intersects with specified bounds.
|
@CheckForNull public java.awt.Point intersection(java.awt.Point a, java.awt.Point b)
@CheckForNull public java.awt.Point intersection(int ax, int ay, int bx, int by)
ax
- first point of lineay
- first point of linebx
- second point of lineby
- second point of linepublic void addShape(java.awt.Rectangle rect)
public void addShape(java.awt.geom.RoundRectangle2D rect)
public void addShape(Line line)
public void addEllipse(java.awt.Rectangle el)
public void addShape(java.awt.Polygon polygon)
public java.util.List<java.awt.Rectangle> getEllipses()
public java.util.List<java.awt.Rectangle> getRectangles()
public java.util.List<Line> getLines()
public java.util.List<java.awt.geom.RoundRectangle2D> getRoundRectangles()
public java.util.List<java.awt.Polygon> getPolygons()
public static ContainerShape createPolygonContainerShape(int[] x, int[] y)
x
- array of x coordinates.y
- array of y coordinates.public static ContainerShape createPolygonContainerShape(ContainerShape shape, int[] x, int[] y)
shape
- container shape to modify.x
- array of x coordinates.y
- array of y coordinates.public boolean intersects(java.awt.Rectangle bounds)
bounds
- bounds to check.