All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----matthew.awt.StrutLayout.Strut
Summary |
public static final class StrutLayout.Strut extends java.lang.Object { // Fields 6 public Component child; public int direction; public int fromConnector; public int length; public Component parent; public int toConnector; // Constructors 2 public Strut(Component, Component, int, int, int); public Strut(Component, Component, int, int, int, int); }
Represents a strut going from a parent component to a child (see StrutLayout.StrutConstraint for a description of struts). This class is used in conjunction with addStruts () as an alternative to a sequence of addLayoutComponent (component, new StrutConstraint (...)) statements.
Example:
StrutLayout.Strut struts [] = {new StrutLayout.Strut (nameLabel, nameField, StrutLayout.MID_RIGHT, StrutLayout.MID_LEFT, StrutLayout.EAST), new StrutLayout.Strut (ageField, nameField, StrutLayout.BOTTOM_LEFT, StrutLayout.TOP_LEFT, StrutLayout.SOUTH) }; Panel panel = new Panel (); StrutLayout strutLayout = new StrutLayout (); panel.setLayout (strutLayout); panel.add (rootComponent); StrutLayout.addStruts (panel, struts);
See Also: StrutLayout.StrutConstraint, addStruts
Fields |
· parent | Summary | Top |
public Component parent
· child | Summary | Top |
public Component child
· fromConnector | Summary | Top |
public int fromConnector
· toConnector | Summary | Top |
public int toConnector
· direction | Summary | Top |
public int direction
· length | Summary | Top |
public int length
Constructors |
· Strut | Summary | Top |
public Strut(Component parent, Component child, int fromConnector, int toConnector, int direction)
Creates a strut going from a parent component to a child component with a default length
Parameter Description parent The parent component. child The child component. fromConnector The connector on the parent to attach the strut to (eg. StrutLayout.TOP_RIGHT). toConnector The connector on the child to attach the strut to (eg. StrutLayout.TOP_LEFT). direction The direction of the strut. One of StrutLayout.NORTH, StrutLayout.SOUTH, StrutLayout.EAST or StrutLayout.WEST.
See Also: Strut, StrutLayout.StrutConstraint, getDefaultStrutLength
· Strut | Summary | Top |
public Strut(Component parent, Component child, int fromConnector, int toConnector, int direction, int length)
Creates a strut going from a parent component to a child component.
Parameter Description parent The parent component. child The child component. fromConnector The connector on the parent to attach the strut to (eg. StrutLayout.TOP_RIGHT). toConnector The connector on the child to attach the strut to (eg. StrutLayout.TOP_LEFT). direction The direction of the strut. One of StrutLayout.NORTH, StrutLayout.SOUTH, StrutLayout.EAST or StrutLayout.WEST. length The length (in pixels) of the strut.
See Also: Strut, StrutLayout.StrutConstraint
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7