java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.pushingpixels.radiance.theming.internal.widget.scroll.ScrollPaneSelector
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class ScrollPaneSelector extends JComponent
ScrollPaneSelector is a little utility class that provides a means to quickly scroll both vertically and horizontally on a single mouse click, by dragging a selection rectangle over a "thumbnail" of the scrollPane's viewport view.

Once the selector is installed on a given JScrollPane instance, a little button appears as soon as at least one of its scroll bars is made visible.

Contributed by the original author under BSD license. Also appears in the JDNC Incubator.

See Also:
  • Field Details

    • COMPONENT_ORIENTATION

      private static final String COMPONENT_ORIENTATION
      See Also:
    • theFormerLayoutManager

      private LayoutManager theFormerLayoutManager
    • theScrollPane

      private JScrollPane theScrollPane
    • theComponent

      private JComponent theComponent
    • thePopupMenu

      private JPopupMenu thePopupMenu
    • toRestoreOriginal

      private boolean toRestoreOriginal
    • theButton

      private JButton theButton
    • theImage

      private BufferedImage theImage
    • theStartRectangle

      private Rectangle theStartRectangle
    • theRectangle

      private Rectangle theRectangle
    • theStartPoint

      private Point theStartPoint
    • thePrevPoint

      private Point thePrevPoint
    • theScale

      private double theScale
    • propertyChangeListener

      private PropertyChangeListener propertyChangeListener
    • theViewPortViewListener

      private ContainerAdapter theViewPortViewListener
  • Constructor Details

    • ScrollPaneSelector

      ScrollPaneSelector()
  • Method Details

    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • installOnScrollPane

      void installOnScrollPane(JScrollPane aScrollPane)
    • uninstallFromScrollPane

      void uninstallFromScrollPane()
    • display

      private void display(Point aPointOnScreen)
    • syncRectangle

      private void syncRectangle()
    • scroll

      private void scroll(int aDeltaX, int aDeltaY, boolean toAnimate)