com.sas.visuals
Class ScrollbarLayout

com.sas.visuals.ScrollbarLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.io.Serializable

public class ScrollbarLayout
implements java.awt.LayoutManager, java.io.Serializable

ScrollbarLayout is layout manager which works like a BorderLayout to layout out scrollbars within a container. ScrollbarLayout, however, is different from BorderLayout in that it does not stretch the scrollbars in the horizontal positions to be the width of the component if there is a vertical scrollbar visible.

Scrollbars have to be added in the North, South, East or West positions in order to be displayed on one of the edges of the container, similar to BorderLayout. The actual location of the scrollbars, however, is determined by the location property which is set during construction of a ScrollbarLayout. The possible values are: TOP, LEFT, BOTTOM, RIGHT or a combination of two of these. For example, to have the scrollbars on the right and at the bottom BOTTOM | RIGHT would be specified in the constructor.

Any component can be added to using Center

See Also:
Serialized Form

Field Summary
protected  java.awt.Component _contents
           
protected  int _location
           
protected  java.awt.Component[] _scrollbar
           
static int BOTTOM
           
static java.lang.String CENTER
           
static java.lang.String EAST
           
protected static int HORIZONTAL
           
static int LEFT
           
static java.lang.String NORTH
           
static int RIGHT
           
static java.lang.String SOUTH
           
static int TOP
           
protected static int VERTICAL
           
static java.lang.String WEST
           
 
Constructor Summary
ScrollbarLayout()
          Constructs a ScrollbarLayout.
ScrollbarLayout(int location)
          Contsructs a ScrollbarLayout that places the scrollbars at location.
 
Method Summary
 void addLayoutComponent(java.lang.String name, java.awt.Component comp)
           
 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)
           
 

Field Detail

CENTER

public static final java.lang.String CENTER
See Also:
Constant Field Values

NORTH

public static final java.lang.String NORTH
See Also:
Constant Field Values

SOUTH

public static final java.lang.String SOUTH
See Also:
Constant Field Values

EAST

public static final java.lang.String EAST
See Also:
Constant Field Values

WEST

public static final java.lang.String WEST
See Also:
Constant Field Values

TOP

public static final int TOP
See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

HORIZONTAL

protected static final int HORIZONTAL
See Also:
Constant Field Values

VERTICAL

protected static final int VERTICAL
See Also:
Constant Field Values

_scrollbar

protected java.awt.Component[] _scrollbar

_contents

protected java.awt.Component _contents

_location

protected int _location
Constructor Detail

ScrollbarLayout

public ScrollbarLayout()
Constructs a ScrollbarLayout. Default location values are RIGHT and BOTTOM.


ScrollbarLayout

public ScrollbarLayout(int location)
Contsructs a ScrollbarLayout that places the scrollbars at location. The possible values for location are TOP, LEFT, BOTTOM, RIGHT or a combination of two of these.

Parameters:
location - the location of the scrollbars
Method Detail

addLayoutComponent

public void addLayoutComponent(java.lang.String name,
                               java.awt.Component comp)
Specified by:
addLayoutComponent in interface java.awt.LayoutManager

layoutContainer

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

minimumLayoutSize

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

preferredLayoutSize

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

removeLayoutComponent

public void removeLayoutComponent(java.awt.Component comp)
Specified by:
removeLayoutComponent in interface java.awt.LayoutManager



Copyright © 2009 SAS Institute Inc. All Rights Reserved.