|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.upd.jby.SinLayout
public class SinLayout
Using this layout in a real application is a sin. It has been designed to demonstrate how to implement a LayoutManager. It lays components one below the other, starting from the top of the container space, and such that, left and right margins draw a sinusoid. Source code here and a sample here.
Constructor Summary | |
---|---|
SinLayout()
Constructs a default SinLayout which glues component's borders to the respective left and right borders of their container. |
|
SinLayout(int cpc,
int zenith)
Constructs a SinLayout which glues component's borders to the respective left and right sinusoidal border of their container, with strict respect to their minimum size. |
Method Summary | |
---|---|
void |
addLayoutComponent(String n,
Component c)
Adds the specified component to the layout. |
void |
layoutContainer(Container c)
Lays out the container. |
Dimension |
minimumLayoutSize(Container c)
Returns the minimum dimensions needed to layout the visible components contained in the specified target container. |
Dimension |
preferredLayoutSize(Container c)
Returns the preferred dimensions for this layout given the visible components in the specified target container. |
void |
removeLayoutComponent(Component c)
Removes the specified component from the layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SinLayout()
public SinLayout(int cpc, int zenith)
cpc
- the number of component per period of the sinusoid.zenith
- the zenith of the sinusoid, in pixels.Method Detail |
---|
public void addLayoutComponent(String n, Component c)
addLayoutComponent
in interface LayoutManager
public void layoutContainer(Container c)
layoutContainer
in interface LayoutManager
c
- the container to be laid outpublic Dimension minimumLayoutSize(Container c)
minimumLayoutSize
in interface LayoutManager
c
- the container to bo laid out.public Dimension preferredLayoutSize(Container c)
preferredLayoutSize
in interface LayoutManager
c
- the container to bo laid out.public void removeLayoutComponent(Component c)
removeLayoutComponent
in interface LayoutManager
c
- the component to be removed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |