Class ScrollLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager

    public class ScrollLayout
    extends java.lang.Object
    implements java.awt.LayoutManager
    Similar to a javax.swing.ScrollPaneLayout, but not as restrictive on the components that can be added. This layout is essentially a 3 x 3 grid layout, with the intent that the bottom and right will hold scroll bars. When installed a TextArea, the bottom has a scroll bar, the right has a vertical box containing a scroll bar, the left has a Gutter, and the center holds a TextAreaPainter. The corners and top are not used by the TextArea. The corners are intended to be a place to put a button or other small component. The corner dimensions are constrained by the left, right, top, and bottom components, so, for example, the width of the top left corner is the width of the left component and the height of the top left corner is the height of the top component.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BOTTOM  
      static java.lang.String BOTTOM_LEFT  
      static java.lang.String BOTTOM_RIGHT  
      static java.lang.String CENTER  
      static java.lang.String LEFT  
      static java.lang.String RIGHT  
      static java.lang.String TOP  
      static java.lang.String TOP_LEFT  
      static java.lang.String TOP_RIGHT  
    • Constructor Summary

      Constructors 
      Constructor Description
      ScrollLayout()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLayoutComponent​(java.lang.String name, java.awt.Component comp)
      Adds a component to the layout using the name parameter to position the component.
      void layoutContainer​(java.awt.Container parent)  
      java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)  
      java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)  
      void removeLayoutComponent​(java.awt.Component comp)
      Removes the specified component from the layout.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ScrollLayout

        public ScrollLayout()
    • Method Detail

      • addLayoutComponent

        public void addLayoutComponent​(java.lang.String name,
                                       java.awt.Component comp)
        Adds a component to the layout using the name parameter to position the component.
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        name - One of CENTER, RIGHT, LEFT, BOTTOM, TOP, TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT.
        comp - The component to add at the given position. If null, the component will be removed from that position.
      • removeLayoutComponent

        public void removeLayoutComponent​(java.awt.Component comp)
        Removes the specified component from the layout.
        Specified by:
        removeLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        comp - The component to be removed.
      • preferredLayoutSize

        public java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)
        Specified by:
        preferredLayoutSize in interface java.awt.LayoutManager
      • minimumLayoutSize

        public java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)
        Specified by:
        minimumLayoutSize in interface java.awt.LayoutManager
      • layoutContainer

        public void layoutContainer​(java.awt.Container parent)
        Specified by:
        layoutContainer in interface java.awt.LayoutManager