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; }

Reply via email to