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 );
setBounds( 0, 0, 200, 100 );
}
}

Version:
$Revision: 1.1.1.1 $, $Date: 1999/11/15 20:37:48 $. Author's original version: 3 18.01.96
Author:
Jean-Claude Dufourd, Daren Stotler

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 static final char above
 o under
 public static final char under
 o left
 public static final char left
 o right
 public static final char right
 o aboveRight
 public static final char aboveRight
 o underRight
 public static final char underRight
 o leftBottom
 public static final char leftBottom
 o rightBottom
 public static final char rightBottom
 o upperLeftCorner
 public static final char upperLeftCorner
 o upperRightCorner
 public static final char upperRightCorner
 o lowerRightCorner
 public static final char lowerRightCorner
 o lowerLeftCorner
 public static final char lowerLeftCorner
 o insideUpperLeft
 public static final char insideUpperLeft
 o insideUpperRight
 public static final char insideUpperRight
 o insideLowerRight
 public static final char insideLowerRight
 o insideLowerLeft
 public static final char insideLowerLeft
 o aboveLeft
 public static final char aboveLeft
 o underLeft
 public static final char underLeft
 o leftTop
 public static final char leftTop
 o rightTop
 public static final char rightTop
 o insideTop
 public static final char insideTop
 o insideBottom
 public static final char insideBottom
 o insideRight
 public static final char insideRight
 o insideLeft
 public static final 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