You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Tim Boudreau <ni...@gmail.com> on 2019/04/10 19:56:36 UTC

Editor tab control UI replacement

Back in 2003/4, I wrote the tab control for the NetBeans 3.6 window system,
which is still in use - the thing JTabbedPane should have been if it had
been written with the needs of applications like NetBeans in mind (i.e.
model driven, not using the AWT hierarchy as its model, capable of complex
transforms on its contents with minimal redraws, etc.).

Some time after that, NetBeans' Visual Library came into being, which makes
easy a lot of things that are otherwise very hard in Swing - animation,
glows around components that extend beyond the bounds of the component,
smooth scrolling and more.  So I've had it in my head for years that
someone ought to write a replacement UI delegate for the editor tabs which
uses it.  Needing to take a break from another project, the other day I
finally wrote that.  It should work on any Swing look and feel (and I
tested it on a bunch) - it derives its colors from those of the look and
feel.  And all of the gradient painting logic is carefully memory managed
using cached BufferedImages (10-40x faster than caching GradientPaint in my
tests and far more consistent in its performance).

What it does differently are mainly animation and bling, and highlighting
for the selected tab that sits outside the tab.  It does have really lovely
built-in tab-dragging support, but since drag support in the window system
is implemented via an AWTEventListener in core.windows...I can disable that
with a not-too-evil hack (have the UI delegate implement Tabbed.Adapter and
then return null for its Tabbed instance), but then model changes aren't
known to the window system, so it "corrects" them, undoing the drag on the
next move.  But the existing tab dragging support (with its ugly polygons)
works fine, so that's disabled by default.

So, two things:
1.  If you'd like a little more (gratuitous?) bling in your editor tabs,
please test it (download link below)
2.  I'd be happy to contribute it to NetBeans if there's interest - it's
already licensed compatibly

Screen shot (running on my own Dark Look and Feel plugin):
https://timboudreau.com/files/screen/04-10-2019_15-48-36.png

Binary download compatible w/ JDK 8 and up, NetBeans 8.2 and up:
https://timboudreau.com/files/visual-library-tabbedcontrol-0.3.1.nbm

Github repo w/ source code:
https://github.com/timboudreau/visual-library-tabcontrol

Feedback appreciated.

Thanks,

Tim

-- 
http://timboudreau.com

Re: Editor tab control UI replacement

Posted by Wade Chandler <wa...@apache.org>.
Great stuff Tim! Definitely work it in and contribute it. We need more of
that versus less, and who better! Certainly if it can be enabled and
disabled with a check box in settings it would be great; then can AB test
for which should be the default later. Maybe we should start some Apache
NetBeans feature surveys :-)

Thanks

Wade


On Wed, Apr 10, 2019, 15:56 Tim Boudreau <ni...@gmail.com> wrote:

> Back in 2003/4, I wrote the tab control for the NetBeans 3.6 window system,
> which is still in use - the thing JTabbedPane should have been if it had
> been written with the needs of applications like NetBeans in mind (i.e.
> model driven, not using the AWT hierarchy as its model, capable of complex
> transforms on its contents with minimal redraws, etc.).
>
> Some time after that, NetBeans' Visual Library came into being, which makes
> easy a lot of things that are otherwise very hard in Swing - animation,
> glows around components that extend beyond the bounds of the component,
> smooth scrolling and more.  So I've had it in my head for years that
> someone ought to write a replacement UI delegate for the editor tabs which
> uses it.  Needing to take a break from another project, the other day I
> finally wrote that.  It should work on any Swing look and feel (and I
> tested it on a bunch) - it derives its colors from those of the look and
> feel.  And all of the gradient painting logic is carefully memory managed
> using cached BufferedImages (10-40x faster than caching GradientPaint in my
> tests and far more consistent in its performance).
>
> What it does differently are mainly animation and bling, and highlighting
> for the selected tab that sits outside the tab.  It does have really lovely
> built-in tab-dragging support, but since drag support in the window system
> is implemented via an AWTEventListener in core.windows...I can disable that
> with a not-too-evil hack (have the UI delegate implement Tabbed.Adapter and
> then return null for its Tabbed instance), but then model changes aren't
> known to the window system, so it "corrects" them, undoing the drag on the
> next move.  But the existing tab dragging support (with its ugly polygons)
> works fine, so that's disabled by default.
>
> So, two things:
> 1.  If you'd like a little more (gratuitous?) bling in your editor tabs,
> please test it (download link below)
> 2.  I'd be happy to contribute it to NetBeans if there's interest - it's
> already licensed compatibly
>
> Screen shot (running on my own Dark Look and Feel plugin):
> https://timboudreau.com/files/screen/04-10-2019_15-48-36.png
>
> Binary download compatible w/ JDK 8 and up, NetBeans 8.2 and up:
> https://timboudreau.com/files/visual-library-tabbedcontrol-0.3.1.nbm
>
> Github repo w/ source code:
> https://github.com/timboudreau/visual-library-tabcontrol
>
> Feedback appreciated.
>
> Thanks,
>
> Tim
>
> --
> http://timboudreau.com
>

Re: Editor tab control UI replacement

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
Very cool, would be great to have all tabs like that, sure, it should be
optional.

Gj

On Thu, Apr 11, 2019 at 9:13 AM Christian Lenz <ch...@gmx.net>
wrote:

> Looks nice 😊 but please make it optional if we will build in into
> NetBeans. Not everyone wants to have it. Otherwise, if it is a Plugin, that
> will be also fine. My 2 Cents.
>
>
> Cheers
>
> Chris
>
>
>
> Von: Tim Boudreau
> Gesendet: Mittwoch, 10. April 2019 21:56
> An: dev@netbeans.apache.org
> Betreff: Editor tab control UI replacement
>
> Back in 2003/4, I wrote the tab control for the NetBeans 3.6 window system,
> which is still in use - the thing JTabbedPane should have been if it had
> been written with the needs of applications like NetBeans in mind (i.e.
> model driven, not using the AWT hierarchy as its model, capable of complex
> transforms on its contents with minimal redraws, etc.).
>
> Some time after that, NetBeans' Visual Library came into being, which makes
> easy a lot of things that are otherwise very hard in Swing - animation,
> glows around components that extend beyond the bounds of the component,
> smooth scrolling and more.  So I've had it in my head for years that
> someone ought to write a replacement UI delegate for the editor tabs which
> uses it.  Needing to take a break from another project, the other day I
> finally wrote that.  It should work on any Swing look and feel (and I
> tested it on a bunch) - it derives its colors from those of the look and
> feel.  And all of the gradient painting logic is carefully memory managed
> using cached BufferedImages (10-40x faster than caching GradientPaint in my
> tests and far more consistent in its performance).
>
> What it does differently are mainly animation and bling, and highlighting
> for the selected tab that sits outside the tab.  It does have really lovely
> built-in tab-dragging support, but since drag support in the window system
> is implemented via an AWTEventListener in core.windows...I can disable that
> with a not-too-evil hack (have the UI delegate implement Tabbed.Adapter and
> then return null for its Tabbed instance), but then model changes aren't
> known to the window system, so it "corrects" them, undoing the drag on the
> next move.  But the existing tab dragging support (with its ugly polygons)
> works fine, so that's disabled by default.
>
> So, two things:
> 1.  If you'd like a little more (gratuitous?) bling in your editor tabs,
> please test it (download link below)
> 2.  I'd be happy to contribute it to NetBeans if there's interest - it's
> already licensed compatibly
>
> Screen shot (running on my own Dark Look and Feel plugin):
> https://timboudreau.com/files/screen/04-10-2019_15-48-36.png
>
> Binary download compatible w/ JDK 8 and up, NetBeans 8.2 and up:
> https://timboudreau.com/files/visual-library-tabbedcontrol-0.3.1.nbm
>
> Github repo w/ source code:
> https://github.com/timboudreau/visual-library-tabcontrol
>
> Feedback appreciated.
>
> Thanks,
>
> Tim
>
> --
> http://timboudreau.com
>
>

AW: Editor tab control UI replacement

Posted by Christian Lenz <ch...@gmx.net>.
Looks nice 😊 but please make it optional if we will build in into NetBeans. Not everyone wants to have it. Otherwise, if it is a Plugin, that will be also fine. My 2 Cents.


Cheers

Chris



Von: Tim Boudreau
Gesendet: Mittwoch, 10. April 2019 21:56
An: dev@netbeans.apache.org
Betreff: Editor tab control UI replacement

Back in 2003/4, I wrote the tab control for the NetBeans 3.6 window system,
which is still in use - the thing JTabbedPane should have been if it had
been written with the needs of applications like NetBeans in mind (i.e.
model driven, not using the AWT hierarchy as its model, capable of complex
transforms on its contents with minimal redraws, etc.).

Some time after that, NetBeans' Visual Library came into being, which makes
easy a lot of things that are otherwise very hard in Swing - animation,
glows around components that extend beyond the bounds of the component,
smooth scrolling and more.  So I've had it in my head for years that
someone ought to write a replacement UI delegate for the editor tabs which
uses it.  Needing to take a break from another project, the other day I
finally wrote that.  It should work on any Swing look and feel (and I
tested it on a bunch) - it derives its colors from those of the look and
feel.  And all of the gradient painting logic is carefully memory managed
using cached BufferedImages (10-40x faster than caching GradientPaint in my
tests and far more consistent in its performance).

What it does differently are mainly animation and bling, and highlighting
for the selected tab that sits outside the tab.  It does have really lovely
built-in tab-dragging support, but since drag support in the window system
is implemented via an AWTEventListener in core.windows...I can disable that
with a not-too-evil hack (have the UI delegate implement Tabbed.Adapter and
then return null for its Tabbed instance), but then model changes aren't
known to the window system, so it "corrects" them, undoing the drag on the
next move.  But the existing tab dragging support (with its ugly polygons)
works fine, so that's disabled by default.

So, two things:
1.  If you'd like a little more (gratuitous?) bling in your editor tabs,
please test it (download link below)
2.  I'd be happy to contribute it to NetBeans if there's interest - it's
already licensed compatibly

Screen shot (running on my own Dark Look and Feel plugin):
https://timboudreau.com/files/screen/04-10-2019_15-48-36.png

Binary download compatible w/ JDK 8 and up, NetBeans 8.2 and up:
https://timboudreau.com/files/visual-library-tabbedcontrol-0.3.1.nbm

Github repo w/ source code:
https://github.com/timboudreau/visual-library-tabcontrol

Feedback appreciated.

Thanks,

Tim

-- 
http://timboudreau.com


RE: Editor tab control UI replacement

Posted by Eirik Bakke <eb...@ultorg.com>.
I tried it on Windows 10--I must say I strongly prefer the previous tab appearance (which you also wrote, so no shame in that! :-)

UIs are usually improved by removing unnecessary "bling", not adding more of it. The existing tab controls look simple and professional, and attract just about the right amount of attention to them: enough to clearly indicate which tab is active, but not enough to be distracting. Perhaps things are different on Darcula? If so, maybe some smaller Darcula color tweaks would achieve the same?

Animations also quickly get tiring. They tend to take something that was previously an instantaneous operation, like selecting a tab or even just hovering over one, and make it into something that is now perceived to take 500ms of time. There are a few cases where animations _can_ be warranted, e.g. to show that a window is being minimized to a hidden taskbar on MacOS. But there is no such need here.

(That said, I love the existing NetBeans tab control! It looks a lot better than the Eclipse ones, and I use it in my NetBeans Platform application.)

-- Eirik

-----Original Message-----
From: Tim Boudreau <ni...@gmail.com> 
Sent: Wednesday, April 10, 2019 3:57 PM
To: dev@netbeans.apache.org
Subject: Editor tab control UI replacement

Back in 2003/4, I wrote the tab control for the NetBeans 3.6 window system, which is still in use - the thing JTabbedPane should have been if it had been written with the needs of applications like NetBeans in mind (i.e.
model driven, not using the AWT hierarchy as its model, capable of complex transforms on its contents with minimal redraws, etc.).

Some time after that, NetBeans' Visual Library came into being, which makes easy a lot of things that are otherwise very hard in Swing - animation, glows around components that extend beyond the bounds of the component, smooth scrolling and more.  So I've had it in my head for years that someone ought to write a replacement UI delegate for the editor tabs which uses it.  Needing to take a break from another project, the other day I finally wrote that.  It should work on any Swing look and feel (and I tested it on a bunch) - it derives its colors from those of the look and feel.  And all of the gradient painting logic is carefully memory managed using cached BufferedImages (10-40x faster than caching GradientPaint in my tests and far more consistent in its performance).

What it does differently are mainly animation and bling, and highlighting for the selected tab that sits outside the tab.  It does have really lovely built-in tab-dragging support, but since drag support in the window system is implemented via an AWTEventListener in core.windows...I can disable that with a not-too-evil hack (have the UI delegate implement Tabbed.Adapter and then return null for its Tabbed instance), but then model changes aren't known to the window system, so it "corrects" them, undoing the drag on the next move.  But the existing tab dragging support (with its ugly polygons) works fine, so that's disabled by default.

So, two things:
1.  If you'd like a little more (gratuitous?) bling in your editor tabs, please test it (download link below) 2.  I'd be happy to contribute it to NetBeans if there's interest - it's already licensed compatibly

Screen shot (running on my own Dark Look and Feel plugin):
https://timboudreau.com/files/screen/04-10-2019_15-48-36.png

Binary download compatible w/ JDK 8 and up, NetBeans 8.2 and up:
https://timboudreau.com/files/visual-library-tabbedcontrol-0.3.1.nbm

Github repo w/ source code:
https://github.com/timboudreau/visual-library-tabcontrol

Feedback appreciated.

Thanks,

Tim

--
http://timboudreau.com