Class Value

  • Direct Known Subclasses:
    Value.Fixed

    public abstract class Value
    extends java.lang.Object
    Value placeholder, allowing the value to be computed on request. Values can be provided an actor for context to reduce the number of value instances that need to be created and reduce verbosity in code that specifies values.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Value.Fixed
      A fixed value that is not computed each time it is used.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Value maxHeight
      Value that is the maxHeight of the actor in the cell.
      static Value maxWidth
      Value that is the maxWidth of the actor in the cell.
      static Value minHeight
      Value that is the minHeight of the actor in the cell.
      static Value minWidth
      Value that is the minWidth of the actor in the cell.
      static Value prefHeight
      Value that is the prefHeight of the actor in the cell.
      static Value prefWidth
      Value that is the prefWidth of the actor in the cell.
      static Value.Fixed zero
      A value that is always zero.
    • Constructor Summary

      Constructors 
      Constructor Description
      Value()  
    • Field Detail

      • zero

        public static final Value.Fixed zero
        A value that is always zero.
      • minWidth

        public static Value minWidth
        Value that is the minWidth of the actor in the cell.
      • minHeight

        public static Value minHeight
        Value that is the minHeight of the actor in the cell.
      • prefWidth

        public static Value prefWidth
        Value that is the prefWidth of the actor in the cell.
      • prefHeight

        public static Value prefHeight
        Value that is the prefHeight of the actor in the cell.
      • maxWidth

        public static Value maxWidth
        Value that is the maxWidth of the actor in the cell.
      • maxHeight

        public static Value maxHeight
        Value that is the maxHeight of the actor in the cell.
    • Constructor Detail

      • Value

        public Value()
    • Method Detail

      • get

        public float get()
        Calls get(Actor) with null.
      • get

        public abstract float get​(@Null
                                  Actor context)
        Parameters:
        context - May be null.
      • percentWidth

        public static Value percentWidth​(float percent)
        Returns a value that is a percentage of the actor's width.
      • percentHeight

        public static Value percentHeight​(float percent)
        Returns a value that is a percentage of the actor's height.
      • percentWidth

        public static Value percentWidth​(float percent,
                                         Actor actor)
        Returns a value that is a percentage of the specified actor's width. The context actor is ignored.
      • percentHeight

        public static Value percentHeight​(float percent,
                                          Actor actor)
        Returns a value that is a percentage of the specified actor's height. The context actor is ignored.