|
Layouts
ConstraintsborderlayoutClass: BorderLayout
Example: <panel> <borderlayout> <constraint location="North"> <button text="North"> </constraint> <constraint location="Center"> <button text="Center"> </constraint> </borderlayout> </panel> boxlayoutClass: BoxLayout
Example: <panel> <boxlayout ctor="X_AXIS"> <button text="1"> <button text="2"> </boxlayout> </panel> cardlayoutClass: CardLayout
Example: <panel> <cardlayout> <constraint name="button1"> <button text="1"> </constraint> <constraint name="button2"> <button text="2"> </constraint> </cardlayout> </panel> flowlayoutClass: FlowLayout Example: <panel> <flowlayout> <button text="1"> <button text="2"> </flowlayout> </panel> gridbaglayoutClass: GridBagLayout
Example: <panel> <gridbaglayout> <gridbagconstraints fill="BOTH" weightx="1.0" weighty="1.0"> <button text="1" /> </gridbagconstraints> <gridbagconstraints fill="BOTH" gridwidth="REMAINDER" weighty="1.0"> <button text="2" /> </gridbagconstraints> </gridbaglayout> </panel> gridlayoutClass: GridLayout Example: <panel> <gridlayout rows="2" columns="2"> <button text="1" /> <button text="2" /> <button text="3" /> <button text="4" /> </gridlayout> </panel> springgridlayoutCreator: SpringGridCreator Helper: SpringGridHelper This layout is inspired by The Java Tutorial. It is similar to gridlayout, but with some tweaks. Currently, I am strictly using the utility provided in The Java Tutorial, which has a problem in that components in the last row/column can be misaligned with the rest in certain cases. The algorithm used by the utility is not wrong, but it did not make the consideration on the number rounding problem. I will try to find a fix when I have a time. Despite that, the grid generated looks absolutely fantastic.
Example: <panel> <springgridlayout rows="2" columns="2" hgap="5" vgap="5" initialx="5" initialy="5"> <button text="1" /> <button text="2" /> <button text="3" /> <button text="4" /> </springgridlayout> </panel> springlayoutClass: SpringLayout SpringLayout is a rather complicated and usually it is best left to a visual GUI generator to do the job.
Example: <panel> <springlayout> <label id="box_1" text="this is" /> <textfield id="box_2" text="for gui builders only" font="Serif,bold italic,20" /> <textfield id="box_3" text="extra extra long long long .......... field" /> <springconstraint xpad="5" ypad="5"> <idref ctor="box_1" /> </springconstraint> <springconstraint xpad="5" preferredheight="true"> <idref ctor="box_2" /> <idref ctor="box_1" /> </springconstraint> <springconstraint ypad="5"> <idref ctor="box_2" /> </springconstraint> <springconstraint> <spring setas="height" get="height"> <idref ctor="box_2" /> </spring> <idref ctor="box_1" /> </springconstraint> <springconstraint xpad="5"> <idref ctor="box_3" /> </springconstraint> <springconstraint ypad="5"> <idref ctor="box_3" /> <idref ctor="box_1" /> </springconstraint> <springconstraint clearwidth="true"> <idref ctor="box_2" /> </springconstraint> <springconstraint clearwidth="true" clearheight="true"> <idref ctor="box_3" /> </springconstraint> <springconstraint edge1="East" edge2="East" pad="-5"> <idref ctor="box_2" /> <idref ctor="boxparent" /> </springconstraint> <springconstraint edge1="East" edge2="East" pad="-5"> <idref ctor="box_3" /> <idref ctor="boxparent" /> </springconstraint> <springconstraint edge1="South" edge2="South" pad="-5"> <idref ctor="box_3" /> <idref ctor="boxparent" /> </springconstraint> </springlayout> </panel> overlaylayoutClass: OverlayLayout
Example: <panel> <overlaylayout> <constraint name="button1"> <button text="1"> </constraint> <constraint name="button2"> <button text="2"> </constraint> </overlaylayout> </panel> constraintHelper: ConstraintHelper This class is used by borderlayout, cardlayout, and overlaylayout.
gridbagconstraintsClass: GridBagConstraints This class is used by gridbaglayout.
springClass: Spring This class is used by gridbaglayout.
springconstraintHelper: SpringConstraintHelper This class is used by springlayout.
|