| java.lang.Object com.l2fprod.common.swing.PercentLayout
PercentLayout | public class PercentLayout implements LayoutManager2(Code) | | PercentLayout. Constraint based layout which allow the space to be
splitted using percentages. The following are allowed when adding components
to container:
- container.add(component);
in this case, the component will be
sized to its preferred size
- container.add(component, "100");
in this case, the component will
have a width (or height) of 100
- container.add(component, "25%");
in this case, the component will
have a width (or height) of 25 % of the container width (or height)
- container.add(component, "*");
in this case, the component will
take the remaining space. if several components use the "*" constraint the
space will be divided among the components.
|
Inner Class :static class Constraint | |
Inner Class :static class NumberConstraint extends Constraint | |
Inner Class :static class PercentConstraint extends Constraint | |
Field Summary | |
final public static int | HORIZONTAL Useful constant to layout the components horizontally (from top to
bottom). | final public static int | VERTICAL Useful constant to layout the components vertically (from left to right). |
Constructor Summary | |
public | PercentLayout() Creates a new HORIZONTAL PercentLayout with a gap of 0. | public | PercentLayout(int orientation, int gap) |
HORIZONTAL | final public static int HORIZONTAL(Code) | | Useful constant to layout the components horizontally (from top to
bottom).
|
VERTICAL | final public static int VERTICAL(Code) | | Useful constant to layout the components vertically (from left to right).
|
PercentLayout | public PercentLayout()(Code) | | Creates a new HORIZONTAL PercentLayout with a gap of 0.
|
PercentLayout | public PercentLayout(int orientation, int gap)(Code) | | |
addLayoutComponent | public void addLayoutComponent(String name, Component comp)(Code) | | Adds the specified component with the specified name to the layout.
Parameters: name - the component name Parameters: comp - the component to be added |
getGap | public int getGap()(Code) | | |
getLayoutAlignmentX | public float getLayoutAlignmentX(Container target)(Code) | | Returns the alignment along the x axis. This specifies how the component
would like to be aligned relative to other components. The value should be
a number between 0 and 1 where 0 represents alignment along the origin, 1
is aligned the furthest away from the origin, 0.5 is centered, etc.
|
getLayoutAlignmentY | public float getLayoutAlignmentY(Container target)(Code) | | Returns the alignment along the y axis. This specifies how the component
would like to be aligned relative to other components. The value should be
a number between 0 and 1 where 0 represents alignment along the origin, 1
is aligned the furthest away from the origin, 0.5 is centered, etc.
|
getOrientation | public int getOrientation()(Code) | | |
invalidateLayout | public void invalidateLayout(Container target)(Code) | | Invalidates the layout, indicating that if the layout manager has cached
information it should be discarded.
|
minimumLayoutSize | public Dimension minimumLayoutSize(Container parent)(Code) | | Calculates the minimum size dimensions for the specified panel given the
components in the specified parent container.
Parameters: parent - the component to be laid out See Also: PercentLayout.preferredLayoutSize |
removeLayoutComponent | public void removeLayoutComponent(Component comp)(Code) | | Removes the specified component from the layout.
Parameters: comp - the component ot be removed |
setGap | public void setGap(int gap)(Code) | | |
setOrientation | public void setOrientation(int orientation)(Code) | | |
|
|