Package tripleplay.ui

Class Constraints

java.lang.Object
tripleplay.ui.Constraints

public class Constraints extends Object
Provides various user interface constraints.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A special layout constraint used by TextWidgets which adjusts only the text size of the widget, leaving the remaining dimensions (icon, insets, etc.) unmodified.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fixedHeight(float height)
    Returns a layout constraint that forces the widget's preferred height to the specified value.
    fixedSize(float width, float height)
    Returns a layout constraint that forces the widget's preferred width height to the specified values.
    Returns a layout constriant that forces the widget's preferred size to be precisely what is needed to accommodate the supplied template text string.
    fixedWidth(float width)
    Returns a layout constraint that forces the widget's preferred width to the specified value.
    maxHeight(float height)
    Returns a layout constraint that forces the widget's preferred height to be no more than the specified value.
    maxSize(float width, float height)
    Returns a layout constraint that forces the widget's preferred width height to be no more than the specified values.
    maxWidth(float width)
    Returns a layout constraint that forces the widget's preferred width to be no more than the specified value.
    minHeight(float height)
    Returns a layout constraint that forces the widget's preferred height to be no less than the specified value.
    minSize(float width, float height)
    Returns a layout constraint that forces the widget's preferred width height to be no less than the specified values.
    minSize(Graphics gfx, String text)
    Returns a layout constriant that forces the widget's preferred size to be no less than what is needed to accommodate the supplied template text string.
    minWidth(float width)
    Returns a layout constraint that forces the widget's preferred width to be no less than the specified value.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Constraints

      public Constraints()
  • Method Details

    • fixedWidth

      public static Layout.Constraint fixedWidth(float width)
      Returns a layout constraint that forces the widget's preferred width to the specified value.
    • fixedHeight

      public static Layout.Constraint fixedHeight(float height)
      Returns a layout constraint that forces the widget's preferred height to the specified value.
    • fixedSize

      public static Layout.Constraint fixedSize(float width, float height)
      Returns a layout constraint that forces the widget's preferred width height to the specified values.
    • maxWidth

      public static Layout.Constraint maxWidth(float width)
      Returns a layout constraint that forces the widget's preferred width to be no more than the specified value.
    • maxHeight

      public static Layout.Constraint maxHeight(float height)
      Returns a layout constraint that forces the widget's preferred height to be no more than the specified value.
    • maxSize

      public static Layout.Constraint maxSize(float width, float height)
      Returns a layout constraint that forces the widget's preferred width height to be no more than the specified values.
    • minWidth

      public static Layout.Constraint minWidth(float width)
      Returns a layout constraint that forces the widget's preferred width to be no less than the specified value.
    • minHeight

      public static Layout.Constraint minHeight(float height)
      Returns a layout constraint that forces the widget's preferred height to be no less than the specified value.
    • minSize

      public static Layout.Constraint minSize(float width, float height)
      Returns a layout constraint that forces the widget's preferred width height to be no less than the specified values.
    • minSize

      public static Layout.Constraint minSize(Graphics gfx, String text)
      Returns a layout constriant that forces the widget's preferred size to be no less than what is needed to accommodate the supplied template text string. This is useful for configuring the size of text widgets to be that of a largest-possible value.
    • fixedSize

      public static Layout.Constraint fixedSize(Graphics gfx, String text)
      Returns a layout constriant that forces the widget's preferred size to be precisely what is needed to accommodate the supplied template text string. This is useful for configuring the size of text widgets to be that of a largest-possible value.