Oh, sooner or later “flat” will look dated and old, and the gradients will
be back.

If you really wanted to do this right, create a MemoryMeterUI Swing UI
delegate, split the flat and gradient code into two implementation of it,
and have core.swing.plaf toss the name of the default one in UIManager on
startup, and the look and feel can override it if it wants.

(I’m not that serious that that’s a great use of anyone’s time, but it
would be the right way to solve it).

-Tim

On Fri, Feb 28, 2020 at 6:31 AM Emilian Bold <[email protected]> wrote:

> > I  believe the ugliness was caused by rendering the text + dropshadow
> into a buffer created with the 'nominal' pixel dimensions, then
> causing it to scale up a bit by drawing it on to the HiDPI screen
> (e.g. a 125% scale, which resulted in blockiness). As mentioned by
> David Green above it looks OK if the drop shadow effect is turned off.
> In this case text was drawn straight onto the Graphics2D.
>
> Can confirm I disabled dropped shadow on macOS and it was acceptable.
>
> I also never liked the gradient so if by getting rid of it we clean up
> some complex code, even better.
>
> --emi
>
> On Fri, Feb 28, 2020 at 1:04 PM Peter Hull <[email protected]> wrote:
> >
> > On Fri, 28 Feb 2020 at 10:37, Tim Boudreau <[email protected]> wrote:
> > > I happened to be around to chat with the author of that code
> > Thanks for the info; I mentioned above that the code seemed strangely
> > complicated and I could not find any comments or history to explain
> > it.
> > > The reason:  GradientPaint's allocate large rasters (large being
> int[width
> > > * height * 4])  on every repaint.
> > I did not know this. But, the updated widget doesn't use gradient
> > paints any more, just a flat colour filled polyline and some text, so
> > hopefully we won't get that problem.
> >
> > > Most likely the root of the problem is simply
> > > theGraphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
> > > RenderingHints.VALUE_ANTIALIASING_ON)
> > I believe the ugliness was caused by rendering the text + dropshadow
> > into a buffer created with the 'nominal' pixel dimensions, then
> > causing it to scale up a bit by drawing it on to the HiDPI screen
> > (e.g. a 125% scale, which resulted in blockiness). As mentioned by
> > David Green above it looks OK if the drop shadow effect is turned off.
> > In this case text was drawn straight onto the Graphics2D.
> >
> > If you wouldn't mind running an eye over the code that would be great!
> >
> > Pete
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
http://timboudreau.com

Reply via email to