Class LinearGradientNode

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class LinearGradientNode extends RenderNode
A render node for a linear gradient.
  • Constructor Details

    • LinearGradientNode

      public LinearGradientNode(MemorySegment address)
      Create a LinearGradientNode instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • LinearGradientNode

      public LinearGradientNode(Rect bounds, Point start, Point end, @Nullable ColorStop @Nullable [] colorStops)
      Creates a GskRenderNode that will create a linear gradient from the given points and color stops, and render that into the area given by bounds.
      Parameters:
      bounds - the rectangle to render the linear gradient into
      start - the point at which the linear gradient will begin
      end - the point at which the linear gradient will finish
      colorStops - a pointer to an array of GskColorStop defining the gradient. The offsets of all color stops must be increasing. The first stop's offset must be >= 0 and the last stop's offset must be <= 1.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the LinearGradientNode class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected LinearGradientNode asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class RenderNode
      Returns:
      the instance as if it were its parent type
    • getColorStops

      public ColorStop[] getColorStops()
      Retrieves the color stops in the gradient.
      Returns:
      the color stops in the gradient
    • getEnd

      public Point getEnd()
      Retrieves the final point of the linear gradient.
      Returns:
      the final point
    • getNColorStops

      public long getNColorStops()
      Retrieves the number of color stops in the gradient.
      Returns:
      the number of color stops
    • getStart

      public Point getStart()
      Retrieves the initial point of the linear gradient.
      Returns:
      the initial point