Class QuadDimension

java.lang.Object
dev.prozilla.pine.common.math.dimension.DualDimension
dev.prozilla.pine.common.math.dimension.QuadDimension
All Implemented Interfaces:
Cloneable<DualDimension>, Printable

public class QuadDimension extends DualDimension
Represents four dimensions (X, Y, Z and W) for a UI element. Each dimension is defined using a DimensionBase.
See Also:
  • Field Details

  • Constructor Details

    • QuadDimension

      public QuadDimension()
      Creates four default dimensions with all values set to 0 pixels.
    • QuadDimension

      public QuadDimension(int xyzw)
    • QuadDimension

      public QuadDimension(DimensionBase xyzw)
      Creates four dimensions with equal values.
    • QuadDimension

      public QuadDimension(int xz, int yw)
    • QuadDimension

      public QuadDimension(DimensionBase xz, DimensionBase yw)
      Creates four dimensions with two pairs of equal values. The X- and Z-dimensions and the Y- and W-dimensions will respectively be assigned equal values.
    • QuadDimension

      public QuadDimension(int x, int y, int z, int w)
    • QuadDimension

      public QuadDimension(DimensionBase x, DimensionBase y, DimensionBase z, DimensionBase w)
  • Method Details

    • set

      public void set(int xyzw)
      Overrides:
      set in class DualDimension
    • set

      public void set(DimensionBase xyzw)
      Overrides:
      set in class DualDimension
    • set

      public void set(int xz, int yw)
      Overrides:
      set in class DualDimension
    • set

      public void set(DimensionBase xz, DimensionBase yw)
      Overrides:
      set in class DualDimension
    • set

      public void set(int x, int y, int z, int w)
    • set

      public void set(DimensionBase x, DimensionBase y, DimensionBase z, DimensionBase w)
    • computeZ

      public float computeZ(Node element)
      Computes the Z-dimension for a given element.
    • computeW

      public float computeW(Node element)
      Computes the W-dimension for a given element.
    • computeXZ

      public float computeXZ(Node element)
      Computes the sum of the X- and Z-dimensions for a given element.
    • computeYW

      public float computeYW(Node element)
      Computes the sum of the Y- and W-dimensions for a given element.
    • isZero

      public boolean isZero(Node element)
      Description copied from class: DualDimension
      Checks whether this pair of dimensions computes to 0 for a given element.
      Overrides:
      isZero in class DualDimension
    • clone

      public QuadDimension clone()
      Description copied from interface: Cloneable
      Returns a new object that is equal to this object.
      Specified by:
      clone in interface Cloneable<DualDimension>
      Overrides:
      clone in class DualDimension
      Returns:
      Clone of this object
    • toString

      public String toString()
      Description copied from interface: Printable
      Returns a string representation of this object.
      Specified by:
      toString in interface Printable
      Overrides:
      toString in class DualDimension
      Returns:
      String representation of this object.