Class Cylinder

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class Cylinder
    extends Shape3D
    The Cylinder class defines a 3 dimensional cylinder with the specified size. A Cylinder is a 3D geometry primitive created with a given radius and height. It is centered at the origin.
    Since:
    JavaFX 8.0
    • Constructor Detail

      • Cylinder

        public Cylinder()
        Creates a new instance of Cylinder of radius of 1.0 and height of 2.0. Resolution defaults to 15 divisions along X and Z axis.
      • Cylinder

        public Cylinder​(double radius,
                        double height)
        Creates a new instance of Cylinder of a given radius and height. Resolution defaults to 15 divisions along X and Z axis.
        Parameters:
        radius - Radius
        height - Height
      • Cylinder

        public Cylinder​(double radius,
                        double height,
                        int divisions)
        Creates a new instance of Cylinder of a given radius, height, and divisions. Resolution defaults to 15 divisions along X and Z axis. Note that divisions should be at least 3. Any value less than that will be clamped to 3.
        Parameters:
        radius - Radius
        height - Height
        divisions - Divisions
    • Method Detail

      • 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 Cylinder.
        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 Cylinder.
        Default value:
        2.0
      • setRadius

        public final void setRadius​(double value)
        Sets the value of the property radius.
        Property description:
        Defines the radius in the Z plane of the Cylinder.
        Default value:
        1.0
      • getRadius

        public final double getRadius()
        Gets the value of the property radius.
        Property description:
        Defines the radius in the Z plane of the Cylinder.
        Default value:
        1.0
      • getDivisions

        public int getDivisions()
        Retrieves the divisions attribute use to generate this cylinder.
        Returns:
        the divisions attribute.