bound SVG

Tom Eugelink tbee at tbee.org
Sat Oct 27 13:14:00 PDT 2012


I hoped to be able to switch from a bar to a full rectangle by just using CSS, but I can't set the width in CSS. I could use two rectangles, but I'm also blocked on the fact that the color is set explicitly in the code (setFill), with two rectangles I need to set both fills, but I can't make one of then go away in the CSS - unless scary solitions with translate maybe. BTW, in my agenda (where I need to do something similar) I simply assign a style class and let that handle the presentation. Then I could simply have declared either color "transparent". I feel that the conference example is not using JavaFX's features to the max :-)

Tom


On 2012-10-27 21:30, Scott Palmer wrote:
> Ah, I see what you are doing now.  But if you really Bly have simple rectangles, why do you need SVG at all?  Can't you accomplish what you are after with multiple backgrounds and borders?
>
> Scott
>
> On 2012-10-27, at 1:17 PM, Tom Eugelink <tbee at tbee.org> wrote:
>
>> Hm. Yes. But that is not what I need to get what I want; it would also scale the width proportionally. I think I'm aiming too high; like with HTML you do need some hooks to hang the styling on.
>>
>> Tom
>>
>>
>>
>>
>> On 2012-10-27 18:07, Scott Palmer wrote:
>>> -fx-scale-shape
>>>
>>> Scott
>>>
>>> On 2012-10-27, at 10:57 AM, Tom Eugelink <tbee at tbee.org> wrote:
>>>
>>>> I'm trying to modify the JavaFX conference demo application in order to demonstrate CSS styling on Wednesday's JFall. I find that a lot of the stuff is hardcoded and not easily skinnable, so I'm trying to make some pinpoint changes in order to improve this.
>>>>
>>>> Since my attempt is to make it more "metro" (simple straight colored rectangles is about all that my design skills can handle) I'm trying to move some of the drawing instructions out into CSS using SVG. However, some of the nodes have dynamic dimensions (width or height), and I would like to have my SVG instructions scale with that.
>>>>
>>>> So instead of: M0,0 L10,0 L10,10 L0,10 L0,0 Z
>>>>
>>>> I would like to use something like: M0,0 L{width},0 L{width},10 L0,10 L0,0 Z
>>>>
>>>> Is this possible? Or only by using some kind of template engine and reloading the CSS?
>>>>
>>>> Tom
>>>>



More information about the openjfx-dev mailing list