Class Value

java.lang.Object
com.prineside.tdi2.scene2d.ui.Value
Direct Known Subclasses:
Value.Fixed

public abstract class Value extends 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.
Author:
Nathan Sweet
  • Nested Class Summary

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

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    get()
    Calls get(Actor) with null.
    abstract float
    get(Actor context)
     
    static Value
    percentHeight(float percent)
    Returns a value that is a percentage of the actor's height.
    static Value
    percentHeight(float percent, Actor actor)
    Returns a value that is a percentage of the specified actor's height.
    static Value
    percentWidth(float percent)
    Returns a value that is a percentage of the actor's width.
    static Value
    percentWidth(float percent, Actor actor)
    Returns a value that is a percentage of the specified actor's width.

    Methods inherited from class java.lang.Object

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

    • 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 Details

    • Value

      public Value()
  • Method Details

    • 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.