Class PackLayout
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class PackLayout

public class netscape.application.PackLayout
    extends java.lang.Object
    implements netscape.application.LayoutManager,
               netscape.util.Codable
{
    /* Constructors
     */
    public PackLayout();

    /* Methods
     */
    public void addSubview(View);
    public PackConstraints constraintsFor(View);
    public void decode(Decoder);
    public PackConstraints defaultConstraints(); *Beta API*
    public void describeClassInfo(ClassInfo);
    public void encode(Encoder);
    public void finishDecoding();
    public void layoutView(View, int, int);
    public Size preferredLayoutSize(View); *Beta API*
    public void removeSubview(View);
    public void setConstraints(View, PackConstraints);
    public void setDefaultConstraints(PackConstraints); *Beta API*
}
Object subclass implementing a LayoutManager similar to the TK Packer. See the PackConstraints class for more information about the available settings can be used.

Note: Because Views do not call layoutView() whenever subviews are added or removed, an application using a PackLayout must explicitly call the PackLayout 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.

See Also:
PackConstraints

Constructors

PackLayout

  public PackLayout()
Constructs a PackLayout.

Methods

defaultConstraints

  public PackConstraints defaultConstraints() *Beta API* 
The PackConstraints to be used as default values, when a view it added to the PackLayout without specific defaults. If you are going to set this, you should do so before adding subviews. The management of the mapping between constraints and views is lazy, and may not happen until it is really needed.

setDefaultConstraints

  public void setDefaultConstraints(PackConstraints constraints) *Beta API* 
Sets the default constraints. These values are used when a view is added to the PackLayout without specific defaults. You should set this before you add any subviews.

constraintsFor

  public PackConstraints constraintsFor(View aView)
Returns the PackConstraints object associated with aView.

addSubview

  public void addSubview(View aView)
Adds aView to the PackLayout with default PackConstraints.
See Also:
LayoutManager, PackConstraints

setConstraints

  public void setConstraints(View aView,
                             PackConstraints constraints)
Associates the PackConstraints constraints with aView. You usually call this method to associate non-default constraints with a particular View.

Note: This method adds a clone of constraints to its internal constraint container. You can therefore reconfigure and pass in the PackConstraints same instance on each call without no side effects.

removeSubview

  public void removeSubview(View aView)
Removes aView from the PackLayout.
See Also:
LayoutManager

layoutView

  public void layoutView(View aView,
                         int deltaWidth,
                         int deltaHeight)
Positions and sizes its View's subviews according to the constraints associated with each subview.
See Also:
LayoutManager

preferredLayoutSize

  public Size preferredLayoutSize(View target) *Beta API* 
This is the primative method that determines what the right size is for target current implmentation simply returns target.minSize(). If minSize() returns (0, 0), we will try to calculate a minimum size based on the subviews of the target. The algorithm calculates a bounding Rect small enough to contain all subviews. All the layout code calls this to determine the size of child views.

describeClassInfo

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

decode

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

encode

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

finishDecoding

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

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Apr 1997