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 :
- RelativeLayout.above
- RelativeLayout.under
- RelativeLayout.left
- RelativeLayout.right
- RelativeLayout.aboveRight
- RelativeLayout.underRight
- RelativeLayout.leftBottom
- RelativeLayout.rightBottom
- RelativeLayout.upperLeftCorner
- RelativeLayout.upperRightCorner
- RelativeLayout.lowerRightCorner
- RelativeLayout.lowerLeftCorner
- RelativeLayout.insideUpperLeft
- RelativeLayout.insideUpperRight
- RelativeLayout.insideLowerRight
- RelativeLayout.insideLowerLeft
- RelativeLayout.aboveLeft
- RelativeLayout.underLeft
- RelativeLayout.leftTop
- RelativeLayout.rightTop
- RelativeLayout.insideTop
- RelativeLayout.insideBottom
- RelativeLayout.insideRight
- RelativeLayout.insideLeft
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
-
above
-
-
aboveLeft
-
-
aboveRight
-
-
insideBottom
-
-
insideLeft
-
-
insideLowerLeft
-
-
insideLowerRight
-
-
insideRight
-
-
insideTop
-
-
insideUpperLeft
-
-
insideUpperRight
-
-
left
-
-
leftBottom
-
-
leftTop
-
-
lowerLeftCorner
-
-
lowerRightCorner
-
-
right
-
-
rightBottom
-
-
rightTop
-
-
under
-
-
underLeft
-
-
underRight
-
-
upperLeftCorner
-
-
upperRightCorner
-
-
RelativeLayout(Dimension)
-
-
addLayoutComponent(String, Component)
-
-
layoutContainer(Container)
-
-
minimumLayoutSize(Container)
-
-
preferredLayoutSize(Container)
-
-
removeLayoutComponent(Component)
-
-
setConstraint(Component, Component, char, int, int)
-
above
public final static char above
under
public final static char under
left
public final static char left
right
public final static char right
aboveRight
public final static char aboveRight
underRight
public final static char underRight
leftBottom
public final static char leftBottom
rightBottom
public final static char rightBottom
upperLeftCorner
public final static char upperLeftCorner
upperRightCorner
public final static char upperRightCorner
lowerRightCorner
public final static char lowerRightCorner
lowerLeftCorner
public final static char lowerLeftCorner
insideUpperLeft
public final static char insideUpperLeft
insideUpperRight
public final static char insideUpperRight
insideLowerRight
public final static char insideLowerRight
insideLowerLeft
public final static char insideLowerLeft
aboveLeft
public final static char aboveLeft
underLeft
public final static char underLeft
leftTop
public final static char leftTop
rightTop
public final static char rightTop
insideTop
public final static char insideTop
insideBottom
public final static char insideBottom
insideRight
public final static char insideRight
insideLeft
public final static char insideLeft
RelativeLayout
public RelativeLayout(Dimension dim)
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
removeLayoutComponent
public void removeLayoutComponent(Component comp)
minimumLayoutSize
public Dimension minimumLayoutSize(Container target)
preferredLayoutSize
public Dimension preferredLayoutSize(Container target)
setConstraint
public void setConstraint(Component self,
Component ref,
char where,
int dx,
int dy)
layoutContainer
public void layoutContainer(Container target)
All Packages Class Hierarchy This Package Previous Next Index