Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Jeff Higgins Newsgroups: comp.lang.java.programmer Subject: Re: Is the API of JavaFX pixel-based? Date: Tue, 03 Feb 2015 14:43:18 -0500 Organization: A noiseless patient Spider Lines: 50 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 3 Feb 2015 19:46:32 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="c50a9e5d554cfaba13eda1c71e805135"; logging-data="21246"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ORnO+Do6R1XKEJ1mdc1AEaiRzNg39JVE=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0 In-Reply-To: Cancel-Lock: sha1:ERJoiL2CAUnavFWc/xljT3a/XVg= Xref: csiph.com comp.lang.java.programmer:31035 On 02/03/2015 11:41 AM, Stefan Ram wrote: > Jeff Higgins writes: >> This is all achievable with JavaFX as with any GUI APIs that >> I'm familiar with. It may not be "out of the box" behavior. >> Can you point to a GUI API with such default behavior? > > As you wrote: HTML+JavaScript should have it as a default. > > Otherwise, I'm not a GUI specialist, I only know rudiments > of some toolkits. > > Maybe someone knows a JavaFX tutorial in the spirit of > »No magic pixel value« programming. > > In my own tutorial, I already avoid magic pixel values. > Here is a program from my own tutorial: > > public final class Main extends javafx.application.Application > { public void start( final javafx.stage.Stage primaryStage ) > { final javafx.scene.layout.VBox vbox = new javafx.scene.layout.VBox(); > final javafx.scene.control.TextField text = new javafx.scene.control.TextField( "text" ); > vbox.getChildren().add( text ); > final javafx.scene.control.TextField text1 = new javafx.scene.control.TextField( "text1" ); > vbox.getChildren().add( text1 ); > primaryStage.setScene( new javafx.scene.Scene( vbox )); > primaryStage.show(); }} > > Looking at the Golovin-Sivtsev Table, (at the left) I'm able to make out most of the Landolt C optotypes in the seventh line at my normal viewing distance. At some point, some "magic" numbers will be necessary - size of device pixel, a SWAG at the visual acuity of a perhaps "standard" viewer, another SWAG at perhaps a "standard" viewing distance, guestimates of "standard" device and environment light levels - not sure what else. Then after all that you can give a gui designer free rein to use relative placements and sizes. Looking back over this and other newsgroups concerning GUIs - it seems to me that some are real particular about absolute control over layout, sizing, coloring, etc, etc, and would hate programming in the style you ask for. And then others like you wish for.