API REVIEW REQUEST: Public API for Backgrounds and Borders on Region

David Grieve david.grieve at oracle.com
Mon Aug 27 09:08:01 PDT 2012

I'm confused by Radii and BorderRadii. 

I expected Radii to just be for one corner, not all four. 

When I saw BorderRadii, I almost expected this to be a circular border, not a rounded rectangle. Maybe calling it CornerRadii would be more illustrative of its purpose. 

I also expected BorderRadii to use Radii as in "BorderRadii topLeft, topRight, bottomLeft, bottomRight;" I like this better because it has symmetry with insets and padding (top, left, bottom, right) and the CSS for the radii could/should follow the rules for padding when less than four values are specified (i.e., if no right, right = top; if no bottom, bottom = top; if no left, left = right). Except that you'd want the opposite corner to be rotated 180 so the corners mirror each other. 

If "as percentage" is false, then BorderRadii(10) and Radii(10) are the same thing. Isn't Radii just BorderRadii where "as percentage" is false and horizontal radius == vertical radius? 

Imagine if Radii were just the radii of a circle and you could specify the values in terms of an Arc(radius, start_angle, end_angle), then you're not locked into horizontal and vertical. For example, a rounded upper-left corner would be Radii(new Arc(10, 90, 180)). Probably overkill for Region. 

On Aug 25, 2012, at 2:36 PM, Richard Bair wrote:

> Hi,
> I have been working on some API for Java 8, which would expose as public API what has been private since we released JavaFX 2.0 (with modification). There has been @treatasprivate API on Region since 2.0 and this has to be removed & replaced. One reason is that as part of the Java 8 release requirements we're supposed to provide all the API our Controls use in their implementation as public API so that any 3rd party Control can be written using all public API (ie: all our Controls need to rely on public API instead of private internal hacks). Second, as we move towards proposing a JSR, we're obviously going to have to remove & replace all the impl_ @treatasprivate details with public or private API since the impl_ methods will never make it through a JSR into the standard.
> As such, I have filed: http://javafx-jira.kenai.com/browse/RT-24506. I have attached to the issue the new API / implementations.

David Grieve | Principal Member of Technical Staff
Mobile: +16033121013 
Oracle Java Client UI and Tools
Durham, NH 03824 
 Oracle is committed to developing practices and products that help protect the environment

More information about the openjfx-dev mailing list