3 ms·
Some GUI toolkits have adopted these patterns. In JavaFX events bubble/capture in the same way as on the web. JavaFX has CSS which styles its equivalent of th
by thu2111 7y ago
Some GUI toolkits have adopted these patterns.
In JavaFX events bubble/capture in the same way as on the web.
JavaFX has CSS which styles its equivalent of the DOM (the scene graph). User defined components can extend CSS if they want.
JavaFX nodes can all be styled with style/styleClass attributes. But the JavaFX DOM is superior to the web DOM: it has layout management nodes, every property is observable and bindable in a unified manner, and there's a more principled approach to handling collections.
- c-smile 7y agoEverything that you can do in JavaFX you can do in WWW platform too and with surprisingly small set of features. > every property is observable and bindable in a unified manner Yep, see: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver https://developer.mozilla.org/en-US/docs/Web/API/MutationObs... In Sciter I went even further, in CSS there you can define widget { prototype: MyWidget url(widgets/mine.tis); ... } widget[mode="editable"] { prototype: MyEditableWidget url(widgets/mine.tis); ... } and so to have dynamic subclassing of the same DOM element: depending on attribute value the same DOM subtree element may have different classes - controllers. Good luck with that in Java.
- pjmlp 7y agoEasy, because in Java I have the complete graphics stack at my control, so I can extend the nodes programmatically and even ensure that hardware accelerated rendering takes indeed place without Z layer tricks and hope for the best. While with CSS, when was Houdini supposed to be available actually?
- thu2111 7y agoWhy would you do that rather than just bind the editable property to something though? I don't actually see CSS the language as anything to be especially proud of, although the borders/box/cascade design can be useful. Great that the DOM API got this basic thing at some point. Now how do you define observable properties on non-DOM objects? The whole thing is just a pile of special case hacks really.