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
FieldsModifier and TypeFieldDescriptionprotected javafx.animation.TimelineTimeline used for indeterminate progress animation.protected final javafx.scene.shape.ArcThe arc that renders the current progress value.protected final javafx.scene.control.LabelThe label used to display the formatted progress value or control graphic.protected javafx.beans.binding.DoubleBindingBinding that computes the arc radius from the skinnable control.protected final javafx.scene.transform.RotateThe rotation transform used while the progress is indeterminate.protected final javafx.scene.shape.ArcThe arc that renders the full track behind the progress arc. -
Constructor Summary
ConstructorsConstructorDescriptionArcProgressIndicatorSkin(T control) Creates a skin for the given arc progress indicator. -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecomputeAcrCenterX(double contentX, double contentWidth) Computes the x-coordinate of the center of the progress arc and track arc.protected abstract doublecomputeArcCenterY(double contentY, double contentHeight) Returns the y-coordinate of the center of the progress arc and track arc.protected abstract doublecomputeLabelHeight(double diameter) Returns the height of the label.protected doublecomputeLabelWidth(double diameter) Computes the maximum width available for the progress label.protected doublecomputeLabelX(double arcCenterX, double labelWidth) Computes the x-coordinate of the progress label.protected abstract doublecomputeLabelY(double arcCenterY, double labelHeight) Returns the y-coordinate of the label.protected abstract doubleReturns the maximum length of the progress arc.protected abstract javafx.beans.binding.DoubleBindinggetRadiusBinding(T control) Returns a binding that calculates the radius of the circle based on the size of the control.protected voidInitializes the arcs, label, and child nodes used by this skin.protected abstract javafx.animation.TimelineInitializes the animation that is used when the progress is indeterminate.protected voidlayoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) protected voidStops the indeterminate animation and removes its rotation transform.Methods inherited from class GemsSkinBase
dispose, register, register, register, register, registerFilter, registerHandlerMethods 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
-
Field Details
-
progressLabel
protected final javafx.scene.control.Label progressLabelThe label used to display the formatted progress value or control graphic. -
trackArc
protected final javafx.scene.shape.Arc trackArcThe arc that renders the full track behind the progress arc. -
progressArc
protected final javafx.scene.shape.Arc progressArcThe arc that renders the current progress value. -
rotate
protected final javafx.scene.transform.Rotate rotateThe rotation transform used while the progress is indeterminate. -
radiusBinding
protected javafx.beans.binding.DoubleBinding radiusBindingBinding that computes the arc radius from the skinnable control. -
indeterminateAnimation
protected javafx.animation.Timeline indeterminateAnimationTimeline used for indeterminate progress animation.
-
-
Constructor Details
-
ArcProgressIndicatorSkin
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:
layoutChildrenin classjavafx.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 areacontentWidth- 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 centerlabelWidth- 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 areacontentHeight- 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 centerlabelHeight- 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
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
-