Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31031

Re: Is the API of JavaFX pixel-based?

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 <jeff@invalid.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Is the API of JavaFX pixel-based?
Date Tue, 03 Feb 2015 10:59:40 -0500
Organization A noiseless patient Spider
Lines 51
Message-ID <maqrfe$qei$1@dont-email.me> (permalink)
References <pixels-20150203115719@ram.dialup.fu-berlin.de> <maqnh5$8v4$1@dont-email.me> <tutorial-20150203161247@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Tue, 3 Feb 2015 16:02:54 +0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="c50a9e5d554cfaba13eda1c71e805135"; logging-data="27090"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ku4raIbIIv4mpPY3EhuJa54VG/ZwEB1o="
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.4.0
In-Reply-To <tutorial-20150203161247@ram.dialup.fu-berlin.de>
Cancel-Lock sha1:iijlRhhgRSea8W2aKLTXfU5tpFw=
Xref csiph.com comp.lang.java.programmer:31031

Show key headers only | View raw


On 02/03/2015 10:16 AM, Stefan Ram wrote:
> Jeff Higgins <jeff@invalid.invalid> writes:
>> Can you point to the specific tutorial you mention?
>
>    I refer to code like:
>
> Scene s = new Scene( r, 360, 120, Color.rgb( 0, 0, 0, 0 ));
>
>    . It is not obvious how the author arrived at those
>    values »360« and »120«.
>
>    The Scene contains some text fields stacked one above
>    the other. What I would prefer instead would be a call
>    like:
>
> Scene s = new Scene( r, Color.rgb( 0, 0, 0, 0 ));
>
>    The textfields would have a default font that is
>    readable (but not excessively high as in a heading).
>    Symbolic constants are Ok, like »PARAGRAPH_FONT«,
>    »HEADING_FONT«.
>
>    The pixel height of that default font depends on the
>    run-time environment and does not have to be known
>    to the programmer. Then, the height of the textfield
>    would be adjusted to the height of this font, while
>    the width is given by the programmer in »m«s (»10«
>    means, wide as 10 »m« letters in that font).
>
>    The width and height of all the containers and,
>    ultimatively of the scene, is calculated bottom-up
>    from those values. They are not known to the
>    programmer, because they are calculated as late
>    as run time.
>
>    In programming, we were taught early to avoid
>    »magic constants« in source code (such as »360«
>    above). More so, in my opinion, we should especially
>    avoid »magic pixel values« in source code. A good program
>    will not set a fixed pixel height for a font, but
>    adjust to the font height that is natural (readable)
>    on a device and will only be known as late as at run time.
>
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?

My Kindle displays HTML pretty nicely, as does my browser,
but I don't know what the source code looks like.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Is the API of JavaFX pixel-based? Jeff Higgins <jeff@invalid.invalid> - 2015-02-03 09:52 -0500
  Re: Is the API of JavaFX pixel-based? Jeff Higgins <jeff@invalid.invalid> - 2015-02-03 10:59 -0500
    Re: Is the API of JavaFX pixel-based? Jeff Higgins <jeff@invalid.invalid> - 2015-02-03 14:43 -0500
    Re: Is the API of JavaFX pixel-based? Jeff Higgins <jeff@invalid.invalid> - 2015-02-04 09:05 -0500
      Re: Is the API of JavaFX pixel-based? Jeff Higgins <jeff@invalid.invalid> - 2015-02-04 09:21 -0500
        Re: Is the API of JavaFX pixel-based? Richard Maher <maher_rjSPAMLESS@hotmail.com> - 2015-02-05 06:18 +0800
          Re: Is the API of JavaFX pixel-based? Arne Vajhøj <arne@vajhoej.dk> - 2015-02-04 19:46 -0500
        Re: Is the API of JavaFX pixel-based? Arne Vajhøj <arne@vajhoej.dk> - 2015-02-04 19:49 -0500

csiph-web