Class ArcProgressIndicatorSkin<T extends ArcProgressIndicator>

java.lang.Object
javafx.scene.control.SkinBase<T>
com.dlsc.gemsfx.skins.GemsSkinBase<T>
com.dlsc.gemsfx.skins.ArcProgressIndicatorSkin<T>
Type Parameters:
T - the type of progress indicator rendered by this skin
All Implemented Interfaces:
javafx.scene.control.Skin<T>
Direct Known Subclasses:
CircleProgressIndicatorSkin, SemiCircleProgressIndicatorSkin

public abstract class ArcProgressIndicatorSkin<T extends ArcProgressIndicator> extends GemsSkinBase<T>
Base skin for arc-based progress indicators.

The skin renders the control with a track arc, a progress arc, and an optional label or graphic. Subclasses provide geometry and animation details for concrete ArcProgressIndicator controls.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected javafx.animation.Timeline
    Timeline used for indeterminate progress animation.
    protected final javafx.scene.shape.Arc
    The arc that renders the current progress value.
    protected final javafx.scene.control.Label
    The label used to display the formatted progress value or control graphic.
    protected javafx.beans.binding.DoubleBinding
    Binding that computes the arc radius from the skinnable control.
    protected final javafx.scene.transform.Rotate
    The rotation transform used while the progress is indeterminate.
    protected final javafx.scene.shape.Arc
    The arc that renders the full track behind the progress arc.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a skin for the given arc progress indicator.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected double
    computeAcrCenterX(double contentX, double contentWidth)
    Computes the x-coordinate of the center of the progress arc and track arc.
    protected abstract double
    computeArcCenterY(double contentY, double contentHeight)
    Returns the y-coordinate of the center of the progress arc and track arc.
    protected abstract double
    computeLabelHeight(double diameter)
    Returns the height of the label.
    protected double
    computeLabelWidth(double diameter)
    Computes the maximum width available for the progress label.
    protected double
    computeLabelX(double arcCenterX, double labelWidth)
    Computes the x-coordinate of the progress label.
    protected abstract double
    computeLabelY(double arcCenterY, double labelHeight)
    Returns the y-coordinate of the label.
    protected abstract double
    Returns the maximum length of the progress arc.
    protected abstract javafx.beans.binding.DoubleBinding
    Returns a binding that calculates the radius of the circle based on the size of the control.
    protected void
    Initializes the arcs, label, and child nodes used by this skin.
    protected abstract javafx.animation.Timeline
    Initializes the animation that is used when the progress is indeterminate.
    protected void
    layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)
     
    protected void
    Stops the indeterminate animation and removes its rotation transform.

    Methods inherited from class javafx.scene.control.SkinBase

    computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, queryAccessibleAttribute, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • progressLabel

      protected final javafx.scene.control.Label progressLabel
      The label used to display the formatted progress value or control graphic.
    • trackArc

      protected final javafx.scene.shape.Arc trackArc
      The arc that renders the full track behind the progress arc.
    • progressArc

      protected final javafx.scene.shape.Arc progressArc
      The arc that renders the current progress value.
    • rotate

      protected final javafx.scene.transform.Rotate rotate
      The rotation transform used while the progress is indeterminate.
    • radiusBinding

      protected javafx.beans.binding.DoubleBinding radiusBinding
      Binding that computes the arc radius from the skinnable control.
    • indeterminateAnimation

      protected javafx.animation.Timeline indeterminateAnimation
      Timeline used for indeterminate progress animation.
  • Constructor Details

    • ArcProgressIndicatorSkin

      public ArcProgressIndicatorSkin(T control)
      Creates a skin for the given arc progress indicator.
      Parameters:
      control - the progress indicator rendered by this skin
  • Method Details

    • initComponents

      protected void initComponents()
      Initializes the arcs, label, and child nodes used by this skin.
    • stopAnimation

      protected void stopAnimation()
      Stops the indeterminate animation and removes its rotation transform.
    • layoutChildren

      protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)
      Overrides:
      layoutChildren in class javafx.scene.control.SkinBase<T extends ArcProgressIndicator>
    • computeLabelWidth

      protected double computeLabelWidth(double diameter)
      Computes the maximum width available for the progress label.
      Parameters:
      diameter - the available diameter inside the progress arc
      Returns:
      the label width
    • computeAcrCenterX

      protected double computeAcrCenterX(double contentX, double contentWidth)
      Computes the x-coordinate of the center of the progress arc and track arc.
      Parameters:
      contentX - the x-coordinate of the content area
      contentWidth - the width of the content area
      Returns:
      the x-coordinate of the arc center
    • computeLabelX

      protected double computeLabelX(double arcCenterX, double labelWidth)
      Computes the x-coordinate of the progress label.
      Parameters:
      arcCenterX - the x-coordinate of the arc center
      labelWidth - the computed label width
      Returns:
      the x-coordinate of the label
    • computeLabelHeight

      protected abstract double computeLabelHeight(double diameter)
      Returns the height of the label.
      Parameters:
      diameter - the available diameter inside the progress arc
      Returns:
      the label height
    • computeArcCenterY

      protected abstract double computeArcCenterY(double contentY, double contentHeight)
      Returns the y-coordinate of the center of the progress arc and track arc.
      Parameters:
      contentY - the y-coordinate of the content area
      contentHeight - the height of the content area
      Returns:
      the y-coordinate of the arc center
    • computeLabelY

      protected abstract double computeLabelY(double arcCenterY, double labelHeight)
      Returns the y-coordinate of the label.
      Parameters:
      arcCenterY - the y-coordinate of the arc center
      labelHeight - the computed label height
      Returns:
      the y-coordinate of the label
    • initIndeterminateAnimation

      protected abstract javafx.animation.Timeline initIndeterminateAnimation()
      Initializes the animation that is used when the progress is indeterminate.
      Returns:
      the indeterminate animation timeline
    • getRadiusBinding

      protected abstract javafx.beans.binding.DoubleBinding getRadiusBinding(T control)
      Returns a binding that calculates the radius of the circle based on the size of the control.
      Parameters:
      control - the progress indicator rendered by this skin
      Returns:
      the radius binding
    • getProgressMaxLength

      protected abstract double getProgressMaxLength()
      Returns the maximum length of the progress arc.
      Returns:
      the maximum progress arc length