Class sgraphics.layout.LayoutKit
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sgraphics.layout.LayoutKit

java.lang.Object
   |
   +----sgraphics.layout.LayoutKit

public class LayoutKit
extends Object
LayoutKit creates architectural components.

Constructor Index

 o LayoutKit()

Method Index

 o align(Glyph, float, float)
Position the glyph using the given alignments.
 o alignAxis(Glyph, int, float)
Position the glyph by aligning along an axis.
 o back(Glyph, Glyph)
Put a glyph under another glyph.
 o bmargin(Glyph, float)
Add a margin to the bottom side of a glyph.
 o bmarginFlexible(Glyph, float, float, float)
Add a margin to the bottom side of a glyph and make it flexible.
 o createFullyVisibleConstraint(float, float)
A constraint that controls the the scrollable region when the view is larger than the data.
 o createViewport(Glyph)
A viewport allows its child to be scrolled.
 o fixed(Glyph, float, float)
Fix the size of a glyph along its axis.
 o fixedAxis(Glyph, int, float)
Fix the size along an axis.
 o flexible(Glyph, float, float)
Return a glyph that allows a fixed glyph to stretch and shrink.
 o flexibleAxis(Glyph, int, float, float)
Make an axis flexible.
 o flexibleFil(Glyph)
Make a glyph stretch as much as possible.
 o front(Glyph, Glyph)
Put a glyph in front of another glyph.
 o front(Glyph, Glyph, Glyph)
Put a glyph over and under another glyph.
 o glue(int, float, float, float, float)
Return a piece of glue.
 o glue(Requirement)
 o halign(Glyph, float)
Position the glyph by aligning along the x axis.
 o hbox()
Get a box that aligns horizontally.
 o hboxAlignElements(float)
Get a box that aligns horizontally.
 o hboxFirstAligned()
Get a box that aligns horizontally.
 o hfil()
Get horizontal fil.
 o hfixed(Glyph, float)
Fix the x axis.
 o hflexible(Glyph, float, float)
Make a glyph stretch horizontally.
 o hglue(float, float, float)
Get horizontal glue.
 o hglueAligned(float, float, float, float)
Get horizontal glue with an alignment.
 o hglueFil(float)
Get horizontal glue that can stretch infinitly.
 o hmargin(Glyph, float)
Add a margin to the horizontal sides of a glyph.
 o hmarginLr(Glyph, float, float)
Add a margin to the horizontal sides of a glyph.
 o hmarginLrFlexible(Glyph, float, float, float, float, float, float)
Add a margin to the horizontal sides of a glyph and make it flexible.
 o hnatural(Glyph, float)
Make a glyph that has a new natural size along the x axis.
 o hspace(float)
Get a fixed horizontal space.
 o lmargin(Glyph, float)
Add a margin to the left side of a glyph.
 o lmarginFlexible(Glyph, float, float, float)
Add a margin to the left side of a glyph and make it flexible.
 o margin(Glyph, float)
Add a margin to all four sides of a glyph.
 o marginFlexible(Glyph, float, float, float)
Add a margin to all four sides of a glyph and make it flexible.
 o marginLrbt(Glyph, float, float, float, float)
Add a margin to all four sides of a glyph.
 o marginLrbtFlexible(Glyph, float, float, float, float, float, float, float, float, float, float, float, float)
Add a margin to all four sides of a glyph and make it flexible.
 o natural(Glyph, float, float)
Make a glyph that has a new natural size.
 o naturalAxis(Glyph, int, float)
Make a glyph that has a new natural size along an axis.
 o overlay()
Get a glyph that places multiple glyphs on top of each other.
 o rmargin(Glyph, float)
Add a margin to the rignt side of a glyph.
 o rmarginFlexible(Glyph, float, float, float)
Add a margin to the rignt side of a glyph and make it flexible.
 o tmargin(Glyph, float)
Add a margin to the top side of a glyph.
 o tmarginFlexible(Glyph, float, float, float)
Add a margin to the top side of a glyph and make it flexible.
 o valign(Glyph, float)
Position the glyph by aligning along the y axis.
 o vbox()
Get a box that aligns vertically.
 o vboxAlignElements(float)
Get a box that aligns vertically.
 o vboxFirstAligned()
Get a box that aligns vertically.
 o vfil()
 o vfixed(Glyph, float)
Fix the y axis.
 o vflexible(Glyph, float, float)
Make a glyph stretch vertically.
 o vglue(float, float, float)
 o vglueAligned(float, float, float, float)
 o vglueFil(float)
 o vmargin(Glyph, float)
Add a margin to the vertical sides of a glyph.
 o vmarginBt(Glyph, float, float)
Add a margin to the vertical sides of a glyph.
 o vmarginBtFlexible(Glyph, float, float, float, float, float, float)
Add a margin to the vertical sides of a glyph and make it flexible.
 o vnatural(Glyph, float)
Make a glyph that has a new natural size along the y axis.
 o vspace(float)

Constructors

 o LayoutKit
  public LayoutKit()

Methods

 o align
  public static Glyph align(Glyph g,
                            float xAlign,
                            float yAlign)
Position the glyph using the given alignments.
Parameters:
g - the glyph to align
xAlign - the alignement in the x axis
yAlign - the alignement in the y axis
Returns:
the glyph.
 o alignAxis
  public static Glyph alignAxis(Glyph g,
                                int axis,
                                float align)
Position the glyph by aligning along an axis.
Parameters:
g - the glyph to align
axis - the axis to align on
align - the alignment
Returns:
the glyph.
 o halign
  public static Glyph halign(Glyph g,
                             float align)
Position the glyph by aligning along the x axis.
Parameters:
g - the glyph to align
align - the alignment
Returns:
the glyph.
 o valign
  public static Glyph valign(Glyph g,
                             float align)
Position the glyph by aligning along the y axis.
Parameters:
g - the glyph to align
align - the alignment
Returns:
the glyph.
 o fixed
  public static Glyph fixed(Glyph g,
                            float x,
                            float y)
Fix the size of a glyph along its axis.
Parameters:
g - the glyph to fix.
x - the horizontal size.
y - the vertical size.
Returns:
the glyph.
 o fixedAxis
  public static Glyph fixedAxis(Glyph g,
                                int axis,
                                float size)
Fix the size along an axis.
Parameters:
g - the glyph to fix.
axis - the axis that is fixed.
size - the size of the fixed axis.
Returns:
the glyph.
 o hfixed
  public static Glyph hfixed(Glyph g,
                             float size)
Fix the x axis.
Parameters:
g - the glyph to fix.
size - the size.
Returns:
the glyph.
 o vfixed
  public static Glyph vfixed(Glyph g,
                             float size)
Fix the y axis.
Parameters:
g - the glyph to fix.
size - the size.
Returns:
the glyph.
 o flexible
  public static Glyph flexible(Glyph g,
                               float stretch,
                               float shrink)
Return a glyph that allows a fixed glyph to stretch and shrink. The stretch and shrink parameters are added or subtracted from the natural size.
Parameters:
g - the glyph to make flexible.
stretch - the ammout of stretch.
shrink - the amount of shrink.
Returns:
the glyph.
 o flexibleFil
  public static Glyph flexibleFil(Glyph g)
Make a glyph stretch as much as possible.
Parameters:
the - glyph to stretch.
Returns:
the glyph.
 o flexibleAxis
  public static Glyph flexibleAxis(Glyph g,
                                   int axis,
                                   float stretch,
                                   float shrink)
Make an axis flexible.
Parameters:
g - the glyph to make flexible.
axis - the axis to make flexible.
stretch - the ammout of stretch.
shrink - the amount of shrink.
Returns:
the glyph.
 o hflexible
  public static Glyph hflexible(Glyph g,
                                float stretch,
                                float shrink)
Make a glyph stretch horizontally.
Parameters:
g - the glyph to make flexible.
stretch - the ammout of stretch.
shrink - the amount of shrink.
Returns:
the glyph.
 o vflexible
  public static Glyph vflexible(Glyph g,
                                float stretch,
                                float shrink)
Make a glyph stretch vertically.
Parameters:
g - the glyph to make flexible.
stretch - the ammout of stretch.
shrink - the amount of shrink.
Returns:
the glyph.
 o natural
  public static Glyph natural(Glyph g,
                              float x,
                              float y)
Make a glyph that has a new natural size.
Parameters:
g - the glyph to change natural on.
x - the natural size in the x direction.
y - the natural size in the y direction.
Returns:
the glyph.
 o naturalAxis
  public static Glyph naturalAxis(Glyph g,
                                  int axis,
                                  float size)
Make a glyph that has a new natural size along an axis.
Parameters:
g - the glyph to change natural on.
axis - the axis to change on.
size - the natural size.
Returns:
the glyph.
 o hnatural
  public static Glyph hnatural(Glyph g,
                               float size)
Make a glyph that has a new natural size along the x axis.
Parameters:
g - the glyph to change the natural on.
size - the natural size.
 o vnatural
  public static Glyph vnatural(Glyph g,
                               float size)
Make a glyph that has a new natural size along the y axis.
Parameters:
g - the glyph to change the natural on.
size - the natural size.
 o margin
  public static Glyph margin(Glyph g,
                             float all)
Add a margin to all four sides of a glyph.
Parameters:
g - the glyph.
all - the margin size;
Returns:
the new glyph.
 o marginFlexible
  public static Glyph marginFlexible(Glyph g,
                                     float margin,
                                     float stretch,
                                     float shrink)
Add a margin to all four sides of a glyph and make it flexible.
Parameters:
g - the glyph.
margin - the margin size;
stretch - the stretch amount.
shrink - the shrink amount.
Returns:
the new glyph.
 o marginLrbt
  public static Glyph marginLrbt(Glyph g,
                                 float lmargin,
                                 float rmargin,
                                 float bmargin,
                                 float tmargin)
Add a margin to all four sides of a glyph.
Parameters:
g - the glyph.
lmargin - the left margin size;
rmargin - the right margin size;
bmargin - the bottom margin size;
tmargin - the top margin size;
Returns:
the new glyph.
 o marginLrbtFlexible
  public static Glyph marginLrbtFlexible(Glyph g,
                                         float lmargin,
                                         float lstretch,
                                         float lshrink,
                                         float rmargin,
                                         float rstretch,
                                         float rshrink,
                                         float bmargin,
                                         float bstretch,
                                         float bshrink,
                                         float tmargin,
                                         float tstretch,
                                         float tshrink)
Add a margin to all four sides of a glyph and make it flexible.
Parameters:
g - the glyph.
lmargin - the left margin size;
rmargin - the right margin size;
bmargin - the bottom margin size;
tmargin - the top margin size;
lstretch - the left stretch amount.
rstretch - the right stretch amount.
bstretch - the bottom stretch amount.
tstretch - the top stretch amount.
lshrink - the left shrink amount.
rshrink - the right shrink amount.
bshrink - the bottom shrink amount.
tshrink - the top shrink amount.
Returns:
the new glyph.
 o hmargin
  public static Glyph hmargin(Glyph g,
                              float both)
Add a margin to the horizontal sides of a glyph.
Parameters:
g - the glyph.
both - the margin size;
Returns:
the new glyph.
 o hmarginLr
  public static Glyph hmarginLr(Glyph g,
                                float lmargin,
                                float rmargin)
Add a margin to the horizontal sides of a glyph.
Parameters:
g - the glyph.
lmargin - the left margin size;
rmargin - the right margin size;
Returns:
the new glyph.
 o hmarginLrFlexible
  public static Glyph hmarginLrFlexible(Glyph g,
                                        float lmargin,
                                        float lstretch,
                                        float lshrink,
                                        float rmargin,
                                        float rstretch,
                                        float rshrink)
Add a margin to the horizontal sides of a glyph and make it flexible.
Parameters:
g - the glyph.
lmargin - the left margin size;
rmargin - the right margin size;
lstretch - the left stretch ammount.
rstretch - the right stretch ammount.
lshrink - the left shrink ammount.
rshrink - the right shrink ammount.
Returns:
the new glyph.
 o vmargin
  public static Glyph vmargin(Glyph g,
                              float both)
Add a margin to the vertical sides of a glyph.
Parameters:
g - the glyph.
both - the margin size;
Returns:
the new glyph.
 o vmarginBt
  public static Glyph vmarginBt(Glyph g,
                                float bmargin,
                                float tmargin)
Add a margin to the vertical sides of a glyph.
Parameters:
g - the glyph.
bmargin - the bottom margin size;
tmargin - the top margin size;
Returns:
the new glyph.
 o vmarginBtFlexible
  public static Glyph vmarginBtFlexible(Glyph g,
                                        float bmargin,
                                        float bstretch,
                                        float bshrink,
                                        float tmargin,
                                        float tstretch,
                                        float tshrink)
Add a margin to the vertical sides of a glyph and make it flexible.
Parameters:
g - the glyph.
bmargin - the bottom margin size;
tmargin - the top margin size;
bstretch - the bottom stretch ammount.
tstretch - the top stretch ammount.
bshrink - the bottom shrink ammount.
tshrink - the top shrink ammount.
Returns:
the new glyph.
 o lmargin
  public static Glyph lmargin(Glyph g,
                              float size)
Add a margin to the left side of a glyph.
Parameters:
g - the glyph.
size - the margin size.
Returns:
the new glyph.
 o rmargin
  public static Glyph rmargin(Glyph g,
                              float size)
Add a margin to the rignt side of a glyph.
Parameters:
g - the glyph.
size - the margin size.
Returns:
the new glyph.
 o bmargin
  public static Glyph bmargin(Glyph g,
                              float size)
Add a margin to the bottom side of a glyph.
Parameters:
g - the glyph.
size - the margin size.
Returns:
the new glyph.
 o tmargin
  public static Glyph tmargin(Glyph g,
                              float size)
Add a margin to the top side of a glyph.
Parameters:
g - the glyph.
size - the margin size.
Returns:
the new glyph.
 o lmarginFlexible
  public static Glyph lmarginFlexible(Glyph g,
                                      float natural,
                                      float stretch,
                                      float shrink)
Add a margin to the left side of a glyph and make it flexible.
Parameters:
g - the glyph.
natural - the margin size.
stretch - the stretch amount.
shrink - the shrink amount.
Returns:
the new glyph.
 o rmarginFlexible
  public static Glyph rmarginFlexible(Glyph g,
                                      float natural,
                                      float stretch,
                                      float shrink)
Add a margin to the rignt side of a glyph and make it flexible.
Parameters:
g - the glyph.
natural - the margin size.
stretch - the stretch amount.
shrink - the shrink amount.
Returns:
the new glyph.
 o bmarginFlexible
  public static Glyph bmarginFlexible(Glyph g,
                                      float natural,
                                      float stretch,
                                      float shrink)
Add a margin to the bottom side of a glyph and make it flexible.
Parameters:
g - the glyph.
natural - the margin size.
stretch - the stretch amount.
shrink - the shrink amount.
Returns:
the new glyph.
 o tmarginFlexible
  public static Glyph tmarginFlexible(Glyph g,
                                      float natural,
                                      float stretch,
                                      float shrink)
Add a margin to the top side of a glyph and make it flexible.
Parameters:
g - the glyph.
natural - the margin size.
stretch - the stretch amount.
shrink - the shrink amount.
Returns:
the new glyph.
 o hbox
  public static Glyph hbox()
Get a box that aligns horizontally.
Returns:
the box.
 o vbox
  public static Glyph vbox()
Get a box that aligns vertically.
Returns:
the box.
 o hboxFirstAligned
  public static Glyph hboxFirstAligned()
Get a box that aligns horizontally. The first glyph is aligned.
Returns:
the box.
 o vboxFirstAligned
  public static Glyph vboxFirstAligned()
Get a box that aligns vertically. The first glyph is aligned.
Returns:
the box.
 o hboxAlignElements
  public static Glyph hboxAlignElements(float align)
Get a box that aligns horizontally. (Untested)
Parameters:
align - the alignment;
Returns:
the box.
 o vboxAlignElements
  public static Glyph vboxAlignElements(float align)
Get a box that aligns vertically. (Untested)
Parameters:
align - the alignment;
Returns:
the box.
 o glue
  public static Glyph glue(int axis,
                           float natural,
                           float stretch,
                           float shrink,
                           float align)
Return a piece of glue.
Parameters:
axis - the alignment axis.
natural - the default size.
stretch - the amount the glyph can stretch.
shrink - the amount the glyph can shrink.
Returns:
the glyph.
 o glue
  public static Glyph glue(Requirement r)
 o hfil
  public static Glyph hfil()
Get horizontal fil. Fil can stretch infinitly, but can not shrink.
Returns:
the fil.
 o hglueFil
  public static Glyph hglueFil(float natural)
Get horizontal glue that can stretch infinitly.
Parameters:
natural - the default size.
Returns:
the glue.
 o hglue
  public static Glyph hglue(float natural,
                            float stretch,
                            float shrink)
Get horizontal glue.
Parameters:
natural - the default size.
stretch - the amount the glue can stretch.
shrink - the amount the glue can shrink.
Returns:
the glue.
 o hglueAligned
  public static Glyph hglueAligned(float natural,
                                   float stretch,
                                   float shrink,
                                   float alignment)
Get horizontal glue with an alignment.
Parameters:
natural - the default size.
stretch - the amount the glue can stretch.
shrink - the amount the glue can shrink.
alignment - the alignement of the glue.
Returns:
the glue.
 o hspace
  public static Glyph hspace(float size)
Get a fixed horizontal space.
Returns:
the space glyph.
 o vfil
  public static Glyph vfil()
 o vglueFil
  public static Glyph vglueFil(float natural)
 o vglue
  public static Glyph vglue(float natural,
                            float stretch,
                            float shrink)
 o vglueAligned
  public static Glyph vglueAligned(float natural,
                                   float stretch,
                                   float shrink,
                                   float alignment)
 o vspace
  public static Glyph vspace(float size)
 o overlay
  public static Glyph overlay()
Get a glyph that places multiple glyphs on top of each other. It is helpful to use a fixed glyph to set the size after overlaying to make sure the alignment with other glyphs is correct. Overlaying glyphs will produce incorrect sizes and alignments.

Use append() and prepend() to add glyphs.

Returns:
the glyph.
 o back
  public static Glyph back(Glyph g,
                           Glyph under)
Put a glyph under another glyph. (Broken)
Parameters:
g - the glyph.
under - the glyph underneath.
Returns:
the new glyph.
 o front
  public static Glyph front(Glyph g,
                            Glyph over)
Put a glyph in front of another glyph. (Broken)
Parameters:
g - the glyph.
over - the glyph in front.
Returns:
the new glyph.
 o front
  public static Glyph front(Glyph g,
                            Glyph under,
                            Glyph over)
Put a glyph over and under another glyph. (Broken);
Parameters:
g - the glyph.
under - the glyph underneath.
over - the glyph in front.
Returns:
the new glyph.
 o createFullyVisibleConstraint
  public static FullyVisibleConstraint createFullyVisibleConstraint(float usable,
                                                                    float align)
A constraint that controls the the scrollable region when the view is larger than the data.
Returns:
the constraint.
 o createViewport
  public static Viewport createViewport(Glyph child)
A viewport allows its child to be scrolled.
Parameters:
child - the child.
Returns:
the viewport.

All Packages  Class Hierarchy  This Package  Previous  Next  Index