Posted by kschaefe
on September 22, 2010 at 12:54 PM PDT
I mentioned during my BOF at JavaOne a new component that is close to ready for moving into SwingX : JXScrollMap.
Part of the way that SwingX works is that members first join the incubator project . Members contribute ideas to the incubator, flesh them out, and eventually bring them into SwingX. The incubator contains lots of stuff from really mature ideas to things that aren't. Some of the ideas have moved into SwingX, but a number of good ideas still reside there.
As SwingX was preparing for version 1.0, we placed a ban on any component additions, as we needed to concentrate on the issues at hand. The first goal post-1.0 was to remove SwingX sorting and filtering migrating JXTable and JXList to core sorting and filtering. During this time we also identified a few components that we thought might make good additions to SwingX proper. One such component was the ScrollPaneSelector .
ScrollPaneSelector is a popup that displays a mini-map of the viewport contents. Users move the viewport rectangle on the mini-map to place the viewport rectangle in the scroll pane. ScrollPaneSelector was definitely an idea that we liked. Recently, I took the ScrollPaneSelector code and made a clean up pass. I separated the control logic into the UI delegate, fine-tuned the API, and renamed it. Without further ado, I'd like to present JXScrollMap. Neither the name nor the API are finalized, as the component is still in the incubator, so any feedback is welcomed. As a side note, my second choice for naming it was JXScrollView, but I thought people might confuse it with the viewport.
JXScollMap embarks on some new territory for SwingX. Part of the original design that I liked so much was the use of Robot to automove the user's mouse to the location of the current viewport when the mini-map is displayed. Since Robot is secure, this presents an additional challenge. SwingX should run without breaking sandbox containment; no signing should be necessary. So, we need to decide how JXScrollMap is going to run without Robot. I expect that we will simply do nothing in insecure environments, meaning the current highlight will be placed, but the mouse will remain unchanged. That question is still up in the air and is one reason the component still resides in the incubator. JXScrollMap now has a property is/setSynchronizedScrolling, which determines whether the viewport location updates when the mini-map rectangle changes. It is recommended to turn this off when running in a secure environment where Robot does not work, since the user's first movement may be to place the mouse into the popup.
So, without further ado, JXScrollMap (signed) to show full functionality: