Class Box

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class Box
    extends Shape3D
    The Box class defines a 3 dimensional box with the specified size. A Box is a 3D geometry primitive created with a given depth, width, and height. It is centered at the origin.
    Since:
    JavaFX 8.0
    • Field Detail

      • DEFAULT_SIZE

        public static final double DEFAULT_SIZE
        Creates a new instance of Box of dimension 2 by 2 by 2.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Box

        public Box()
      • Box

        public Box​(double width,
                   double height,
                   double depth)
        Creates a new instance of Box of dimension width by height by depth.
        Parameters:
        width - the width of this box
        height - the height of this box
        depth - the depth of this box
    • Method Detail

      • setDepth

        public final void setDepth​(double value)
        Sets the value of the property depth.
        Property description:
        Defines the depth or the Z dimension of the Box.
        Default value:
        2.0
      • getDepth

        public final double getDepth()
        Gets the value of the property depth.
        Property description:
        Defines the depth or the Z dimension of the Box.
        Default value:
        2.0
      • setHeight

        public final void setHeight​(double value)
        Sets the value of the property height.
        Property description:
        Defines the height or the Y dimension of the Box.
        Default value:
        2.0
      • getHeight

        public final double getHeight()
        Gets the value of the property height.
        Property description:
        Defines the height or the Y dimension of the Box.
        Default value:
        2.0
      • setWidth

        public final void setWidth​(double value)
        Sets the value of the property width.
        Property description:
        Defines the width or the X dimension of the Box.
        Default value:
        2.0
      • getWidth

        public final double getWidth()
        Gets the value of the property width.
        Property description:
        Defines the width or the X dimension of the Box.
        Default value:
        2.0