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