Package snap.view

Class ScrollView

All Implemented Interfaces:
PropChange.DoChange, XMLArchiver.Archivable, ViewHost

public class ScrollView extends ParentView implements ViewHost
A View for scrolling other views.
  • Field Details

  • Constructor Details

    • ScrollView

      public ScrollView()
      Constructor.
    • ScrollView

      public ScrollView(View aView)
      Constructor for given view.
  • Method Details

    • getContent

      public View getContent()
      Returns the content.
    • setContent

      public void setContent(View aView)
      Sets the content.
    • getGuestCount

      public int getGuestCount()
      ViewHost method: Override to send to Scroller.
      Specified by:
      getGuestCount in interface ViewHost
    • getGuest

      public View getGuest(int anIndex)
      ViewHost method: Override to send to Scroller.
      Specified by:
      getGuest in interface ViewHost
    • addGuest

      public void addGuest(View aChild, int anIndex)
      ViewHost method: Override to send to Scroller.
      Specified by:
      addGuest in interface ViewHost
    • removeGuest

      public View removeGuest(int anIndex)
      ViewHost method: Override to send to Scroller.
      Specified by:
      removeGuest in interface ViewHost
    • getScroller

      public Scroller getScroller()
      Returns the view that handles scrolling.
    • getHBar

      public ScrollBar getHBar()
      Returns the Horizontal ScrollBar.
    • getVBar

      public ScrollBar getVBar()
      Returns the vertical ScrollBar.
    • getShowHBar

      public Boolean getShowHBar()
      Returns whether to show horizontal scroll bar (null means 'as-needed').
    • setShowHBar

      public void setShowHBar(Boolean aValue)
      Sets whether to show horizontal scroll bar (null means 'as-needed').
    • getShowVBar

      public Boolean getShowVBar()
      Returns whether to show vertical scroll bar (null means 'as-needed').
    • setShowVBar

      public void setShowVBar(Boolean aValue)
      Returns whether to show vertical scroll bar (null means 'as-needed').
    • isHBarShowing

      public boolean isHBarShowing()
      Returns whether HBar is showing.
    • setHBarShowing

      protected void setHBarShowing(boolean aValue)
      Sets whether HBar is showing.
    • isVBarShowing

      public boolean isVBarShowing()
      Returns whether VBar is showing.
    • setVBarShowing

      protected void setVBarShowing(boolean aValue)
      Sets whether VBar is showing.
    • getBarSize

      public int getBarSize()
      Returns the scroll bar size.
    • setBarSize

      public void setBarSize(int aValue)
      Sets the scroll bar size.
    • isFillWidth

      public boolean isFillWidth()
      Returns whether this ScrollView fits content to its width.
    • setFillWidth

      public void setFillWidth(boolean aValue)
      Sets whether this ScrollView fits content to its width.
    • isFillHeight

      public boolean isFillHeight()
      Returns whether this ScrollView fits content to its height.
    • setFillHeight

      public void setFillHeight(boolean aValue)
      Sets whether this ScrollView fits content to its height.
    • getMinWidthImpl

      protected double getMinWidthImpl()
      Calculates the minimum width.
      Overrides:
      getMinWidthImpl in class View
    • getMinHeightImpl

      protected double getMinHeightImpl()
      Calculates the minimum height.
      Overrides:
      getMinHeightImpl in class View
    • getPrefWidthImpl

      protected double getPrefWidthImpl(double aH)
      Calculates the preferred width.
      Overrides:
      getPrefWidthImpl in class View
    • getPrefHeightImpl

      protected double getPrefHeightImpl(double aW)
      Calculates the preferred height.
      Overrides:
      getPrefHeightImpl in class View
    • layoutImpl

      protected void layoutImpl()
      Override to layout children.
      Overrides:
      layoutImpl in class ParentView
    • updateScrollBarsShowing

      protected boolean updateScrollBarsShowing()
      Called to update whether ScrollBars are showing. Returns true if any changes.
    • getDefaultBorder

      public Border getDefaultBorder()
      Returns the default border.
      Overrides:
      getDefaultBorder in class View
    • scrollerDidPropChange

      protected void scrollerDidPropChange(PropChange anEvent)
      Handle Scroller property changes.
    • scrollBarDidPropChange

      public void scrollBarDidPropChange(PropChange aPC)
      Handle ScrollBar property changes.
    • toXMLView

      public XMLElement toXMLView(XMLArchiver anArchiver)
      XML archival.
      Overrides:
      toXMLView in class ParentView
    • fromXMLView

      public void fromXMLView(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Overrides:
      fromXMLView in class ParentView