Class dpscomponents.RelativeLayout
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dpscomponents.RelativeLayout

java.lang.Object
   |
   +----dpscomponents.RelativeLayout

public class RelativeLayout
extends Object
implements LayoutManager
This is for placing components relatively to each other or to the parent panel with an offset. The offset direction depends intuitively on the relative position required. Relative positions are : all of which are named after what they implement. Above is centered above the reference, aboveLeft is same left-aligned... Minimal example provided for testing:
import java.awt.*;
import java.applet.*;
public class testmin extends Applet {
    Label inst_TopView;
    Label inst_MOSTransistor;
    Dimension d;
    public void init() {
	RelativeLayout rl = new RelativeLayout(new Dimension(200, 100));
	setLayout( rl );
	add( "1", inst_MOSTransistor = new Label("MOS"));
	rl.setConstraint( inst_MOSTransistor, null, RelativeLayout.insideUpperLeft, 5, 5 );
	inst_MOSTransistor.setBackground( Color.green );
	add( "1", inst_TopView = new Label("TopView"));
	rl.setConstraint( inst_TopView, inst_MOSTransistor, RelativeLayout.right, 5, 0 );
	reshape( 0, 0, 200, 100 );
    }
}
Version:
3 18.01.96
Author:
Jean-Claude Dufourd

Variable Index

 o above
 o aboveLeft
 o aboveRight
 o insideBottom
 o insideLeft
 o insideLowerLeft
 o insideLowerRight
 o insideRight
 o insideTop
 o insideUpperLeft
 o insideUpperRight
 o left
 o leftBottom
 o leftTop
 o lowerLeftCorner
 o lowerRightCorner
 o right
 o rightBottom
 o rightTop
 o under
 o underLeft
 o underRight
 o upperLeftCorner
 o upperRightCorner

Constructor Index

 o RelativeLayout(Dimension)

Method Index

 o addLayoutComponent(String, Component)
 o layoutContainer(Container)
 o minimumLayoutSize(Container)
 o preferredLayoutSize(Container)
 o removeLayoutComponent(Component)
 o setConstraint(Component, Component, char, int, int)

Variables

 o above
  public final static char above
 o under
  public final static char under
 o left
  public final static char left
 o right
  public final static char right
 o aboveRight
  public final static char aboveRight
 o underRight
  public final static char underRight
 o leftBottom
  public final static char leftBottom
 o rightBottom
  public final static char rightBottom
 o upperLeftCorner
  public final static char upperLeftCorner
 o upperRightCorner
  public final static char upperRightCorner
 o lowerRightCorner
  public final static char lowerRightCorner
 o lowerLeftCorner
  public final static char lowerLeftCorner
 o insideUpperLeft
  public final static char insideUpperLeft
 o insideUpperRight
  public final static char insideUpperRight
 o insideLowerRight
  public final static char insideLowerRight
 o insideLowerLeft
  public final static char insideLowerLeft
 o aboveLeft
  public final static char aboveLeft
 o underLeft
  public final static char underLeft
 o leftTop
  public final static char leftTop
 o rightTop
  public final static char rightTop
 o insideTop
  public final static char insideTop
 o insideBottom
  public final static char insideBottom
 o insideRight
  public final static char insideRight
 o insideLeft
  public final static char insideLeft

Constructors

 o RelativeLayout
  public RelativeLayout(Dimension dim)

Methods

 o addLayoutComponent
  public void addLayoutComponent(String name,
                                 Component comp)
 o removeLayoutComponent
  public void removeLayoutComponent(Component comp)
 o minimumLayoutSize
  public Dimension minimumLayoutSize(Container target)
 o preferredLayoutSize
  public Dimension preferredLayoutSize(Container target)
 o setConstraint
  public void setConstraint(Component self,
                            Component ref,
                            char where,
                            int dx,
                            int dy)
 o layoutContainer
  public void layoutContainer(Container target)

All Packages  Class Hierarchy  This Package  Previous  Next  Index