Package VASSAL.tools

Class ScrollPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants
Direct Known Subclasses:
AdjustableSpeedScrollPane, GlobalMap.GlobalMapScrollPane

public class ScrollPane extends JScrollPane
ScrollPane extends JScrollPane to have complete mouse-wheel functionality. The mouse wheel scrolls vertically when hovering over the view or vertical scrollbar, and horizontally when CTRL is depressed or when hovering over the horizontal scrollbar. ScrollPane uses the system default scroll speed. For scrollpanes which will contain large images (e.g., maps) use AdjustableSpeedScrollPane, which has a user-configurable scroll speed, instead.
Author:
Joel Uckelman
See Also:
JScrollPane, AdjustableSpeedScrollPane, Serialized Form
  • Constructor Details

    • ScrollPane

      public ScrollPane()
      Creates an empty (no viewport view) ScrollPane where both horizontal and vertical scrollbars appear when needed.
    • ScrollPane

      public ScrollPane(Component view)
      Creates a ScrollPane that displays the contents of the specified component, where both horizontal and vertical scrollbars appear whenever the component's contents are larger than the view.
      Parameters:
      view - the component to display in the scrollpane's viewport
    • ScrollPane

      public ScrollPane(int vsbPolicy, int hsbPolicy)
      Creates an empty (no viewport view) ScrollPane with specified scrollbar policies. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
      Parameters:
      vsbPolicy - an integer that specifies the vertical scrollbar policy
      hsbPolicy - an integer that specifies the horizontal scrollbar policy
    • ScrollPane

      public ScrollPane(Component view, int vsbPolicy, int hsbPolicy)
      Creates a ScrollPane that displays the view component in a viewport with the specified scrollbar policies. The available policy settings are listed at JScrollPane.setVerticalScrollBarPolicy(int) and JScrollPane.setHorizontalScrollBarPolicy(int).
      Parameters:
      view - the component to display in the scrollpane's viewport
      vsbPolicy - an integer that specifies the vertical scrollbar policy
      hsbPolicy - an integer that specifies the horizontal scrollbar policy