GeomGraph has public attributes radX and radY which contain the corner radius of the graph's bounding rectangle, used when determining the boundaryCurve for the graph.
radX and radY in GeomGraph are assigned 10 in the constructor. The constructor then immediately uses these values to construct rrect: RRect.
boundaryCurve cannot be altered directly: the setter throws an exception.
It can be altered by assigning boundingBox, but in this case it copies the corner radii from the existing RRect, which have previously been assigned 10.
So changing radX and radY after constructing the graph does not affect subsequence alterations of boundingBox: they continue to use the values embedded in the boundingBoxRRect.
This leaves no apparent API for altering the corner radii.
Expected behavior:
changing radX or radY after constructing a GeomGraph and then assigning boundingBox should create a boundaryCurve with the new radii.
or a more sophisticated API for either constructing GeomGraph with configurable corner radii
or assigning radX and radY invalidates the existing boundaryShape
or allow a direct assignment of rrect.
My current workaround uses the last method (which breaks encapsulation):
GeomGraph
has public attributesradX
andradY
which contain the corner radius of the graph's bounding rectangle, used when determining theboundaryCurve
for the graph.radX
andradY
inGeomGraph
are assigned10
in the constructor. The constructor then immediately uses these values to constructrrect: RRect
.boundaryCurve
cannot be altered directly: the setter throws an exception.boundingBox
, but in this case it copies the corner radii from the existingRRect
, which have previously been assigned10
.radX
andradY
after constructing the graph does not affect subsequence alterations ofboundingBox
: they continue to use the values embedded in theboundingBox
RRect
.This leaves no apparent API for altering the corner radii.
Expected behavior:
radX
orradY
after constructing aGeomGraph
and then assigningboundingBox
should create a boundaryCurve with the new radii.GeomGraph
with configurable corner radiiradX
andradY
invalidates the existingboundaryShape
rrect
.My current workaround uses the last method (which breaks encapsulation):