|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.zfqjava.swing.BoxLayout2
BoxLayout2
provides another BoxLayout
and is helpful for layout button area.
It adds following features:
BoxLayout
.BoxLayout
.BoxLayout2
is compitable with BoxLayout
at API level, use it just replace BoxLayout
with BoxLayout2
.
Box
,
ComponentOrientation
,
JComponent.getAlignmentX()
,
JComponent.getAlignmentY()
, Serialized FormField Summary | |
static int |
LINE_AXIS
Specifies that components should be laid out in the direction of a line of text as determined by the target container's ComponentOrientation property. |
static int |
PAGE_AXIS
Specifies that components should be laid out in the direction that lines flow across a page as determined by the target container's ComponentOrientation property. |
static int |
X_AXIS
Specifies that components should be laid out left to right. |
static int |
Y_AXIS
Specifies that components should be laid out top to bottom. |
Constructor Summary | |
BoxLayout2(java.awt.Container target,
int axis)
Creates a layout manager that will lay out components along the given axis. |
|
BoxLayout2(java.awt.Container target,
int axis,
boolean equalsWidth,
boolean equalsHeight)
Creates a layout manager that will lay out components along the given axis. |
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Not used by this class. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Not used by this class. |
protected boolean |
canGroup(java.awt.Component c)
Judge the component can be group. |
float |
getLayoutAlignmentX(java.awt.Container target)
Returns the alignment along the X axis for the container. |
float |
getLayoutAlignmentY(java.awt.Container target)
Returns the alignment along the Y axis for the container. |
void |
invalidateLayout(java.awt.Container target)
Indicates that a child has changed its layout related information, and thus any cached calculations should be flushed. |
void |
layoutContainer(java.awt.Container target)
Called by the AWT when the specified container needs to be laid out. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container target)
Returns the maximum dimensions the target container can use to lay out the components it contains. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container target)
Returns the minimum dimensions needed to lay out the components contained in the specified target container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container target)
Returns the preferred dimensions for this layout, given the components in the specified target container. |
void |
removeLayoutComponent(java.awt.Component comp)
Not used by this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int X_AXIS
public static final int Y_AXIS
public static final int LINE_AXIS
ComponentOrientation
property.public static final int PAGE_AXIS
ComponentOrientation
property.Constructor Detail |
public BoxLayout2(java.awt.Container target, int axis)
target
- the container that needs to be laid outaxis
- the axis to lay out components along. Can be one of:
BoxLayout.X_AXIS
,
BoxLayout.Y_AXIS
,
BoxLayout.LINE_AXIS
or
BoxLayout.PAGE_AXIS
AWTError
- if the value of axis
is invalidpublic BoxLayout2(java.awt.Container target, int axis, boolean equalsWidth, boolean equalsHeight)
target
- the container that needs to be laid outaxis
- the axis to lay out components along. Can be one of:
BoxLayout.X_AXIS
,
BoxLayout.Y_AXIS
,
BoxLayout.LINE_AXIS
or
BoxLayout.PAGE_AXIS
equalsWidth
- specify all component has the equals widthequalsHeight
- specify all component has the equals heightAWTError
- if the value of axis
is invalidMethod Detail |
public void invalidateLayout(java.awt.Container target)
This method is called by AWT when the invalidate method is called on the Container. Since the invalidate method may be called asynchronously to the event thread, this method may be called asynchronously.
invalidateLayout
in interface java.awt.LayoutManager2
target
- the affected containerAWTError
- if the target isn't the container specified to the
BoxLayout constructorpublic void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- the name of the componentcomp
- the componentpublic void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
comp
- the componentpublic void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
comp
- the componentconstraints
- constraintspublic java.awt.Dimension preferredLayoutSize(java.awt.Container target)
preferredLayoutSize
in interface java.awt.LayoutManager
target
- the container that needs to be laid outAWTError
- if the target isn't the container specified to the
BoxLayout constructorContainer
,
minimumLayoutSize(java.awt.Container)
,
maximumLayoutSize(java.awt.Container)
public java.awt.Dimension minimumLayoutSize(java.awt.Container target)
minimumLayoutSize
in interface java.awt.LayoutManager
target
- the container that needs to be laid outAWTError
- if the target isn't the container specified to the
BoxLayout constructorpreferredLayoutSize(java.awt.Container)
,
maximumLayoutSize(java.awt.Container)
public java.awt.Dimension maximumLayoutSize(java.awt.Container target)
maximumLayoutSize
in interface java.awt.LayoutManager2
target
- the container that needs to be laid outAWTError
- if the target isn't the container specified to the
BoxLayout constructorpreferredLayoutSize(java.awt.Container)
,
minimumLayoutSize(java.awt.Container)
public float getLayoutAlignmentX(java.awt.Container target)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
target
- the containerAWTError
- if the target isn't the container specified to the
BoxLayout constructorpublic float getLayoutAlignmentY(java.awt.Container target)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
target
- the containerAWTError
- if the target isn't the container specified to the
BoxLayout constructorpublic void layoutContainer(java.awt.Container target)
layoutContainer
in interface java.awt.LayoutManager
target
- the container to lay outAWTError
- if the target isn't the container specified to the
BoxLayout constructorprotected boolean canGroup(java.awt.Component c)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |