Class GridLayout
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class GridLayout

public class netscape.application.GridLayout
    extends java.lang.Object
    implements netscape.application.LayoutManager,
               netscape.util.Codable
{
    /* Fields
     */
    public final static int FLOW_ACROSS;
    public final static int FLOW_DOWN;

    /* Constructors
     */
    public GridLayout();
    public GridLayout(int, int);
    public GridLayout(int, int, int, int, int);

    /* Methods
     */
    public void addSubview(View);
    public int columnCount();
    public void decode(Decoder);
    public void describeClassInfo(ClassInfo);
    public void encode(Encoder);
    public void finishDecoding();
    public int flowDirection();
    public Size gridSize(View);
    public int horizGap();
    public void layoutView(View, int, int);
    public void removeSubview(View);
    public int rowCount();
    public void setColumnCount(int);
    public void setFlowDirection(int);
    public void setHorizGap(int);
    public void setRowCount(int);
    public void setVertGap(int);
    public int vertGap();
}
Object subclass implementing a LayoutManager that manages a grid of Views. A GridLayout with zero rows and zero columns formatted as a square matrix large enough to hold all of the subviews. A zero in a single dimension indicates that dimension can grow without bounds. The GridLayout resizes all Views to have the same size. Note: Because Views do not call layoutView() whenever subviews are added or removed, an application using a GridLayout must explicitly call the GridLayout View's layoutView() with a zero delta width and delta height. Calling layoutView() in this manner will cause the LayoutManager to properly position and size the View's subviews.

Fields

FLOW_ACROSS

  public final static int FLOW_ACROSS
flowDirection value causing subviews to flow across the grid first.

FLOW_DOWN

  public final static int FLOW_DOWN
flowDirection value causing subviews to flow down the grid first.

Constructors

GridLayout

  public GridLayout()
Constructs a GridLayout with default values rowCount = 0, columnCount = 0, horizGap = 0, vertGap = 0, and flowDirection = FLOW_ACROSS/

GridLayout

  public GridLayout(int numRows,
                    int numCols)
Constructs a GridLayout with default values and numRows rows and numCols columns.

GridLayout

  public GridLayout(int numRows,
                    int numCols,
                    int horizGap,
                    int vertGap,
                    int flow)
Constructs a GridLayout with the specified values and numRows rows and numCols columns.

Methods

setRowCount

  public void setRowCount(int numRows)
Sets the GridLayout to have numRows rows.

rowCount

  public int rowCount()
Returns the number of rows in the GridLayout.
See Also:
setRowCount

setColumnCount

  public void setColumnCount(int numCols)
Sets the GridLayout to have numCols columns.

columnCount

  public int columnCount()
Returns the number of columns in the GridLayout.
See Also:
setColumnCount

setHorizGap

  public void setHorizGap(int gap)
Sets the horizontal gap.

horizGap

  public int horizGap()
Returns the horizontal gap.
See Also:
setHorizGap

setVertGap

  public void setVertGap(int gap)
Sets the vertical gap.

vertGap

  public int vertGap()
Returns the vertical gap.
See Also:
setVertGap

setFlowDirection

  public void setFlowDirection(int flow)
Sets the flow direction.

flowDirection

  public int flowDirection()
Returns the flow direction.
See Also:
setFlowDirection

addSubview

  public void addSubview(View aView)
LayoutManager interface method. GridLayout maintains no View-specific properties, so this method does nothing.
See Also:
LayoutManager

removeSubview

  public void removeSubview(View aView)
LayoutManager interface method. GridLayout maintains no View-specific properties, so this method does nothing.
See Also:
LayoutManager

layoutView

  public void layoutView(View aView,
                         int deltaWidth,
                         int deltaHeight)
Resizes and positions all of the subviews to fit inside the specified grid.
See Also:
gridSize, LayoutManager

gridSize

  public Size gridSize(View aView)
Using the requested grid sizes and the number of subviews of aView, determines the actual size of the grid. Grids of size (0,0) are formatted as a square matrix large enough to hold all of the subviews. A zero in a single dimension indicates that dimension can grow without bounds. Grids with a non-zero rowCount() or columnCount and have more Views than (rowCount() * columnCount) will result in the extra Views being clipped. This method returns the actual size necessary to hold the current subviews of parent. If parent contains no subviews, returns a Size with 0 extent.

describeClassInfo

  public void describeClassInfo(ClassInfo info)
Describes the GridLayout class' coding information.
See Also:
describeClassInfo

decode

  public void decode(Decoder decoder) throws CodingException
Encodes the GridLayout.
See Also:
encode

encode

  public void encode(Encoder encoder) throws CodingException
Decodes the GridLayout.
See Also:
decode

finishDecoding

  public void finishDecoding() throws CodingException
Finishes the GridLayout's decoding.
See Also:
finishDecoding

All Packages  Class Hierarchy  This Package  Previous  Next  Index