Spec-Zone.ru › OpenJavaFX 8
javafx.scene.effect

Class Light.Point

java.lang.Object
  • javafx.scene.effect.Light
    • javafx.scene.effect.Light.Point

Direct Known Subclasses:

Light.Spot

Enclosing class:

Light



public static class Light.Point
extends Light
Represents a light source at a given position in 3D space.

Example:

Light.Point light = new Light.Point();
 light.setX(100);
 light.setY(100);
 light.setZ(50);

 Lighting lighting = new Lighting();
 lighting.setLight(light);
 lighting.setSurfaceScale(5.0);

 Text text = new Text();
 text.setText("Point");
 text.setFill(Color.STEELBLUE);
 text.setFont(Font.font(null, FontWeight.BOLD, 80));
 text.setX(10.0);
 text.setY(10.0);
 text.setTextOrigin(VPos.TOP);

 Rectangle rect = new Rectangle(250, 150);
 rect.setFill(Color.ALICEBLUE);
 rect.setEffect(lighting);
 text.setEffect(lighting);

The code above produces the following:

Since:

JavaFX 2.0

  • Property Summary

    All MethodsInstance MethodsConcrete Methods
    Type Property and Description
    DoubleProperty x
    The x coordinate of the light position.
    DoubleProperty y
    The y coordinate of the light position.
    DoubleProperty z
    The z coordinate of the light position.
    • Properties inherited from class javafx.scene.effect.Light

      color
  • Nested Class Summary

    • Nested classes/interfaces inherited from class javafx.scene.effect.Light

      Light.Distant, Light.Point, Light.Spot
  • Constructor Summary

    Constructors
    Constructor and Description
    Point()
    Creates a new instance of Point light with default parameters.
    Point(double x, double y, double z, Color color)
    Creates a new instance of Point light with the specified x, y, x, and color.
  • Method Summary

    All MethodsInstance MethodsConcrete Methods
    Modifier and Type Method and Description
    double getX()
    Gets the value of the property x.
    double getY()
    Gets the value of the property y.
    double getZ()
    Gets the value of the property z.
    void setX(double value)
    Sets the value of the property x.
    void setY(double value)
    Sets the value of the property y.
    void setZ(double value)
    Sets the value of the property z.
    DoubleProperty xProperty()
    The x coordinate of the light position.
    DoubleProperty yProperty()
    The y coordinate of the light position.
    DoubleProperty zProperty()
    The z coordinate of the light position.
    • Methods inherited from class javafx.scene.effect.Light

      colorProperty, getColor, setColor
    • Methods inherited from class java.lang.Object

      clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Detail

    • x

      public final DoubleProperty xProperty
      The x coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getX(), setX(double)

    • y

      public final DoubleProperty yProperty
      The y coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getY(), setY(double)

    • z

      public final DoubleProperty zProperty
      The z coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getZ(), setZ(double)

  • Constructor Detail

    • Point

      public Point()
      Creates a new instance of Point light with default parameters.
    • Point

      public Point(double x,
                   double y,
                   double z,
                   Color color)
      Creates a new instance of Point light with the specified x, y, x, and color.

      Parameters:

      x - the x coordinate of the light position

      Since:

      JavaFX 2.1

  • Method Detail

    • setX

      public final void setX(double value)
      Sets the value of the property x.

      Property description:

      The x coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • getX

      public final double getX()
      Gets the value of the property x.

      Property description:

      The x coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • xProperty

      public final DoubleProperty xProperty()
      The x coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getX(), setX(double)

    • setY

      public final void setY(double value)
      Sets the value of the property y.

      Property description:

      The y coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • getY

      public final double getY()
      Gets the value of the property y.

      Property description:

      The y coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • yProperty

      public final DoubleProperty yProperty()
      The y coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getY(), setY(double)

    • setZ

      public final void setZ(double value)
      Sets the value of the property z.

      Property description:

      The z coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • getZ

      public final double getZ()
      Gets the value of the property z.

      Property description:

      The z coordinate of the light position.

      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

    • zProperty

      public final DoubleProperty zProperty()
      The z coordinate of the light position.
      Min: n/a
             Max: n/a
         Default: 0.0
        Identity: n/a

      Default value:

      0.0

      See Also:

      getZ(), setZ(double)

© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API