public class PercentLayout extends Object implements LayoutManager2
| Modifier and Type | Field and Description |
|---|---|
static int |
HORIZONTAL
Useful constant to layout the components horizontally (from left to
right).
|
static int |
VERTICAL
Useful constant to layout the components vertically (from top to bottom).
|
| Constructor and Description |
|---|
PercentLayout()
Creates a new HORIZONTAL PercentLayout with a gap of 0.
|
PercentLayout(int orientation,
int gap) |
| Modifier and Type | Method and Description |
|---|---|
void |
addLayoutComponent(Component component,
Object constraints) |
void |
addLayoutComponent(String name,
Component comp)
Adds the specified component with the specified name to the layout.
|
com.l2fprod.common.swing.PercentLayout.Constraint |
getConstraint(Component component) |
int |
getGap() |
float |
getLayoutAlignmentX(Container target)
Returns the alignment along the x axis.
|
float |
getLayoutAlignmentY(Container target)
Returns the alignment along the y axis.
|
int |
getOrientation() |
void |
invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager has cached
information it should be discarded.
|
void |
layoutContainer(Container parent) |
Dimension |
maximumLayoutSize(Container parent)
Returns the maximum size of this component.
|
Dimension |
minimumLayoutSize(Container parent)
Calculates the minimum size dimensions for the specified panel given the
components in the specified parent container.
|
Dimension |
preferredLayoutSize(Container parent) |
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
void |
setConstraint(Component component,
Object constraints) |
void |
setGap(int gap) |
void |
setOrientation(int orientation) |
public static final int HORIZONTAL
public static final int VERTICAL
public PercentLayout()
public PercentLayout(int orientation,
int gap)
public void setGap(int gap)
public int getGap()
public void setOrientation(int orientation)
public int getOrientation()
public com.l2fprod.common.swing.PercentLayout.Constraint getConstraint(Component component)
public void addLayoutComponent(Component component, Object constraints)
addLayoutComponent in interface LayoutManager2public float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2target - public float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2target - public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2target - public void addLayoutComponent(String name, Component comp)
addLayoutComponent in interface LayoutManagername - the component namecomp - the component to be addedpublic void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagercomp - the component ot be removedpublic Dimension minimumLayoutSize(Container parent)
minimumLayoutSize in interface LayoutManagerparent - the component to be laid outpreferredLayoutSize(java.awt.Container)public Dimension maximumLayoutSize(Container parent)
maximumLayoutSize in interface LayoutManager2parent - Component.getMinimumSize(),
Component.getPreferredSize(),
LayoutManagerpublic Dimension preferredLayoutSize(Container parent)
preferredLayoutSize in interface LayoutManagerpublic void layoutContainer(Container parent)
layoutContainer in interface LayoutManagerCopyright © 2015. All rights reserved.