Package mgui.interfaces.layouts
Class LineLayout
java.lang.Object
mgui.interfaces.layouts.LineLayout
- All Implemented Interfaces:
java.awt.LayoutManager
,java.awt.LayoutManager2
,java.io.Serializable
- Direct Known Subclasses:
CategoryLayout
public class LineLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable
Layout which provides a basic functionality for rendering components on horizontal lines. Uses
LineLayoutConstraints
to specify line height, gap height, and preferred width.- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description java.util.ArrayList<java.awt.Component>
components
java.util.ArrayList<LineLayoutConstraints>
constraints
protected java.awt.Component
flexible_component
int
lineGap
int
lineHeight
int
lineWidth
java.awt.Dimension
maximumSize
java.awt.Dimension
minimumSize
java.awt.Dimension
preferredSize
-
Constructor Summary
Constructors Constructor Description LineLayout()
LineLayout(int height, int gap, int width)
Construct a newLineLayout
with the given dimensions -
Method Summary
Modifier and Type Method Description void
addLayoutComponent(java.awt.Component comp, java.lang.Object cons)
void
addLayoutComponent(java.lang.String str, java.awt.Component comp)
float
getLayoutAlignmentX(java.awt.Container parent)
float
getLayoutAlignmentY(java.awt.Container parent)
void
invalidateLayout(java.awt.Container parent)
void
layoutContainer(java.awt.Container parent)
java.awt.Dimension
maximumLayoutSize(java.awt.Container parent)
java.awt.Dimension
minimumLayoutSize(java.awt.Container arg0)
java.awt.Dimension
preferredLayoutSize(java.awt.Container parent)
void
removeLayoutComponent(java.awt.Component comp)
void
setFlexibleComponent(java.awt.Component c)
Sets the flexible component for this layout; this component is stretched vertically when the layout is larger than is total line + gap height, to fill the extra space.void
setPreferredSize(java.awt.Dimension size)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
lineHeight
public int lineHeight -
lineGap
public int lineGap -
lineWidth
public int lineWidth -
preferredSize
public java.awt.Dimension preferredSize -
minimumSize
public java.awt.Dimension minimumSize -
maximumSize
public java.awt.Dimension maximumSize -
constraints
-
components
public java.util.ArrayList<java.awt.Component> components -
flexible_component
protected java.awt.Component flexible_component
-
-
Constructor Details
-
LineLayout
public LineLayout() -
LineLayout
public LineLayout(int height, int gap, int width)Construct a newLineLayout
with the given dimensions- Parameters:
height
-gap
-width
-
-
-
Method Details
-
addLayoutComponent
public void addLayoutComponent(java.lang.String str, java.awt.Component comp)- Specified by:
addLayoutComponent
in interfacejava.awt.LayoutManager
-
setFlexibleComponent
public void setFlexibleComponent(java.awt.Component c)Sets the flexible component for this layout; this component is stretched vertically when the layout is larger than is total line + gap height, to fill the extra space. A value ofnull
unsets the flexible component.- Parameters:
c
-
-
layoutContainer
public void layoutContainer(java.awt.Container parent)- Specified by:
layoutContainer
in interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container arg0)- Specified by:
minimumLayoutSize
in interfacejava.awt.LayoutManager
-
setPreferredSize
public void setPreferredSize(java.awt.Dimension size) -
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)- Specified by:
preferredLayoutSize
in interfacejava.awt.LayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)- Specified by:
removeLayoutComponent
in interfacejava.awt.LayoutManager
-
addLayoutComponent
public void addLayoutComponent(java.awt.Component comp, java.lang.Object cons)- Specified by:
addLayoutComponent
in interfacejava.awt.LayoutManager2
-
getLayoutAlignmentX
public float getLayoutAlignmentX(java.awt.Container parent)- Specified by:
getLayoutAlignmentX
in interfacejava.awt.LayoutManager2
-
getLayoutAlignmentY
public float getLayoutAlignmentY(java.awt.Container parent)- Specified by:
getLayoutAlignmentY
in interfacejava.awt.LayoutManager2
-
invalidateLayout
public void invalidateLayout(java.awt.Container parent)- Specified by:
invalidateLayout
in interfacejava.awt.LayoutManager2
-
maximumLayoutSize
public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)- Specified by:
maximumLayoutSize
in interfacejava.awt.LayoutManager2
-