[8u40] API review: (RT-38192) CSS support for Region as graphicProperty on Labeled
Tom Schindl
tom.schindl at bestsolution.at
Thu Aug 7 08:54:23 UTC 2014
Hi,
To me this looks like a none breaking change or do I miss something?
Still why not getting more generic and provide FXML as the graphic
syntax, the URI could be able to detect this as well, the FXMLLoader
naturally should never ever be load a controller when it is used from
inside an CSS.
Now on the syntax would it be better instead of defining svg-path to
work with protocols like browsers are doing it today (see data-urls).
We'd have then:
* file:
* http:
* ...
* data:scenegraph/svg-path;....
* data:scenegraph/fxml;....
Tom
On 07.08.14 00:59, David Grieve wrote:
> In as much as CSS styles can be considered API, I propose the following
> CSS API change for Labeled's -fx-graphic property. This will allow an
> SVG path to be used as the value on Labeled's -fx-graphic property. See
> https://javafx-jira.kenai.com/browse/RT-38192
>
> Proposed CSS API for Labeled:
>
> Allow -fx-graphic to be either a uri or an svg-path
>
> -fx-graphic: [ <uri> | <svg-path> ]
>
> If -fx-graphic is a svg-path, a Region will be set as the Labeled's
> graphicProperty. This Region will be given the style-class 'graphic'.
>
> Example:
>
> .button { -fx-graphic: "M2,0 L5,4 L8,0 L10,0 L10,2 L6,5 L10,8 L10,10
> L8,10 L5,6 L2,10 L0,10 L0,8 L4,5 L0,2 L0,0 Z"; }
> .button > .graphic { -fx-background-fill: red; -fx-min-width: 10;
> -fx-min-height: 10; }
More information about the openjfx-dev
mailing list