Package javafx.scene.shape
Class Arc
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Arc
- All Implemented Interfaces:
LayoutMeasurable
,LayoutMeasurableMixin
,HasBlendModeProperty
,HasClipProperty
,HasEffectProperty
,HasFillProperty
,HasLayoutXProperty
,HasLayoutYProperty
,HasManagedProperty
,HasMouseTransparentProperty
,HasOnMouseClickedProperty
,HasOpacityProperty
,HasParentProperty
,HasSmoothProperty
,HasStrokeDashOffsetProperty
,HasStrokeLineCapProperty
,HasStrokeLineJoinProperty
,HasStrokeMiterLimitProperty
,HasStrokeProperty
,HasStrokeTypeProperty
,HasStrokeWidthProperty
,HasVisibleProperty
,Styleable
,EventTarget
,INode
The
Arc
class represents a 2D arc object, defined by a center point,
start angle (in degrees), angular extent (length of the arc in degrees),
and an arc type (ArcType.OPEN
, ArcType.CHORD
,
or ArcType.ROUND
).
Example usage: the following code creates an Arc which is centered around 50,50, has a radius of 25 and extends from the angle 45 to the angle 315 (270 degrees long), and is round.
import javafx.scene.shape.*; Arc arc = new Arc(); arc.setCenterX(50.0f); arc.setCenterY(50.0f); arc.setRadiusX(25.0f); arc.setRadiusY(25.0f); arc.setStartAngle(45.0f); arc.setLength(270.0f); arc.setType(ArcType.ROUND);
- Since:
- JavaFX 2.0
-
Property Summary
TypePropertyDescriptionfinal DoubleProperty
Defines the X coordinate of the center point of the arc.final DoubleProperty
Defines the Y coordinate of the center point of the arc.final DoubleProperty
Defines the angular extent of the arc in degrees.final DoubleProperty
Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.final DoubleProperty
Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.final DoubleProperty
Defines the starting angle of the arc in degrees.final ObjectProperty<ArcType>
Properties inherited from class javafx.scene.shape.Shape
fill, smooth, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, stroke, strokeType, strokeWidth
Properties inherited from class javafx.scene.Node
blendMode, cacheHint, cache, clip, cursor, disabled, disable, effect, eventDispatcher, focused, focusTraversable, hover, id, layoutBounds, layoutX, layoutY, managed, mouseTransparent, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragged, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onScroll, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, opacity, parent, pressed, rotate, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, visible
-
Field Summary
Fields inherited from interface javafx.scene.INode
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal DoubleProperty
Defines the X coordinate of the center point of the arc.final DoubleProperty
Defines the Y coordinate of the center point of the arc.final double
Gets the value of thecenterX
property.final double
Gets the value of thecenterY
property.final double
Gets the value of thelength
property.final double
Gets the value of theradiusX
property.final double
Gets the value of theradiusY
property.final double
Gets the value of thestartAngle
property.final ArcType
getType()
Gets the value of thetype
property.impl_computeGeomBounds
(BaseBounds bounds, BaseTransform tx) Computes the geometric bounds for this Node.final DoubleProperty
Defines the angular extent of the arc in degrees.final DoubleProperty
Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.final DoubleProperty
Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.final void
setCenterX
(double value) Sets the value of thecenterX
property.final void
setCenterY
(double value) Sets the value of thecenterY
property.final void
setLength
(double value) Sets the value of thelength
property.final void
setRadiusX
(double value) Sets the value of theradiusX
property.final void
setRadiusY
(double value) Sets the value of theradiusY
property.final void
setStartAngle
(double value) Sets the value of thestartAngle
property.final void
Sets the value of thetype
property.final DoubleProperty
Defines the starting angle of the arc in degrees.toString()
Returns a string representation of thisArc
object.final ObjectProperty<ArcType>
Methods inherited from class javafx.scene.shape.Shape
fillProperty, getStrokeDashArray, smoothProperty, strokeDashOffsetProperty, strokeLineCapProperty, strokeLineJoinProperty, strokeMiterLimitProperty, strokeProperty, strokeTypeProperty, strokeWidthProperty, subtract
Methods inherited from class javafx.scene.Node
addEventFilter, addEventHandler, autosize, blendModeProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, createLayoutMeasurable, cursorProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAllNodeTransforms, getBoundsInLocal, getCacheHint, getCursor, getEventDispatcher, getId, getLayoutMeasurable, getNodePeer, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOrCreateAndBindNodePeer, getProperties, getRotate, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getUserData, hasProperties, hoverProperty, idProperty, impl_computeLayoutBounds, impl_getLayoutBounds, impl_isTreeVisible, impl_maxHeight, impl_maxWidth, impl_minHeight, impl_minWidth, impl_prefHeight, impl_prefWidth, impl_traverse, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isPressed, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScreen, localToScreen, localToScreen, localToScreen, managedProperty, mouseTransparentProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onNodePeerReady, onPeerSizeChanged, onScrollProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, opacityProperty, parentProperty, parentToLocal, pressedProperty, removeEventFilter, removeEventHandler, requestFocus, requestPeerFocus, rotateProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setCache, setCacheHint, setCursor, setDisable, setDisabled, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setNodePeer, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setPressed, setRotate, setScaleX, setScaleY, setScaleZ, setScene, setStyle, setTranslateX, setTranslateY, setUserData, shouldUseLayoutMeasurable, snapshot, startDragAndDrop, styleProperty, toBack, toFront, translateXProperty, translateYProperty, visibleProperty
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasBlendModeProperty
getBlendMode, setBlendMode
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasClipProperty
getClip, setClip
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasEffectProperty
getEffect, setEffect
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasFillProperty
getFill, setFill
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutXProperty
getLayoutX, setLayoutX
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasLayoutYProperty
getLayoutY, setLayoutY
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasManagedProperty
isManaged, setManaged
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasMouseTransparentProperty
isMouseTransparent, setMouseTransparent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOnMouseClickedProperty
getOnMouseClicked, setOnMouseClicked
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasOpacityProperty
getOpacity, setOpacity
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasParentProperty
getParent, setParent
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasSmoothProperty
isSmooth, setSmooth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeDashOffsetProperty
getStrokeDashOffset, setStrokeDashOffset
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineCapProperty
getStrokeLineCap, setStrokeLineCap
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeLineJoinProperty
getStrokeLineJoin, setStrokeLineJoin
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeMiterLimitProperty
getStrokeMiterLimit, setStrokeMiterLimit
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeProperty
getStroke, setStroke
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeTypeProperty
getStrokeType, setStrokeType
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasStrokeWidthProperty
getStrokeWidth, setStrokeWidth
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.markers.HasVisibleProperty
isVisible, setVisible
Methods inherited from interface javafx.scene.INode
getBaselineOffset, getContentBias, isResizable, relocate, resize, resizeRelocate
Methods inherited from interface dev.webfx.kit.mapper.peers.javafxgraphics.emul_coupling.LayoutMeasurableMixin
clearCache, getLayoutBounds, maxHeight, maxWidth, minHeight, minWidth, prefHeight, prefWidth
-
Property Details
-
centerX
Defines the X coordinate of the center point of the arc.- Default value:
- 0.0
- See Also:
-
centerY
Defines the Y coordinate of the center point of the arc.- Default value:
- 0.0
- See Also:
-
radiusX
Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.- Default value:
- 0.0
- See Also:
-
radiusY
Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.- Default value:
- 0.0
- See Also:
-
startAngle
Defines the starting angle of the arc in degrees.- Default value:
- 0.0
- See Also:
-
length
Defines the angular extent of the arc in degrees.- Default value:
- 0.0
- See Also:
-
type
- Default value:
- OPEN
- See Also:
-
-
Constructor Details
-
Arc
public Arc()Creates an empty instance of Arc. -
Arc
public Arc(double centerX, double centerY, double radiusX, double radiusY, double startAngle, double length) Creates a new instance of Arc.- Parameters:
centerX
- the X coordinate of the center point of the arccenterY
- the Y coordinate of the center point of the arcradiusX
- the overall width (horizontal radius) of the full ellipse of which this arc is a partial sectionradiusY
- the overall height (vertical radius) of the full ellipse of which this arc is a partial sectionstartAngle
- the starting angle of the arc in degreeslength
- the angular extent of the arc in degrees
-
-
Method Details
-
setCenterX
public final void setCenterX(double value) Sets the value of thecenterX
property.- Property description:
- Defines the X coordinate of the center point of the arc.
- Default value:
- 0.0
- Parameters:
value
- the value for thecenterX
property- See Also:
-
getCenterX
public final double getCenterX()Gets the value of thecenterX
property.- Property description:
- Defines the X coordinate of the center point of the arc.
- Default value:
- 0.0
- Returns:
- the value of the
centerX
property - See Also:
-
centerXProperty
Defines the X coordinate of the center point of the arc.- Default value:
- 0.0
- Returns:
- the
centerX
property - See Also:
-
setCenterY
public final void setCenterY(double value) Sets the value of thecenterY
property.- Property description:
- Defines the Y coordinate of the center point of the arc.
- Default value:
- 0.0
- Parameters:
value
- the value for thecenterY
property- See Also:
-
getCenterY
public final double getCenterY()Gets the value of thecenterY
property.- Property description:
- Defines the Y coordinate of the center point of the arc.
- Default value:
- 0.0
- Returns:
- the value of the
centerY
property - See Also:
-
centerYProperty
Defines the Y coordinate of the center point of the arc.- Default value:
- 0.0
- Returns:
- the
centerY
property - See Also:
-
setRadiusX
public final void setRadiusX(double value) Sets the value of theradiusX
property.- Property description:
- Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
- Default value:
- 0.0
- Parameters:
value
- the value for theradiusX
property- See Also:
-
getRadiusX
public final double getRadiusX()Gets the value of theradiusX
property.- Property description:
- Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.
- Default value:
- 0.0
- Returns:
- the value of the
radiusX
property - See Also:
-
radiusXProperty
Defines the overall width (horizontal radius) of the full ellipse of which this arc is a partial section.- Default value:
- 0.0
- Returns:
- the
radiusX
property - See Also:
-
setRadiusY
public final void setRadiusY(double value) Sets the value of theradiusY
property.- Property description:
- Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
- Default value:
- 0.0
- Parameters:
value
- the value for theradiusY
property- See Also:
-
getRadiusY
public final double getRadiusY()Gets the value of theradiusY
property.- Property description:
- Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.
- Default value:
- 0.0
- Returns:
- the value of the
radiusY
property - See Also:
-
radiusYProperty
Defines the overall height (vertical radius) of the full ellipse of which this arc is a partial section.- Default value:
- 0.0
- Returns:
- the
radiusY
property - See Also:
-
setStartAngle
public final void setStartAngle(double value) Sets the value of thestartAngle
property.- Property description:
- Defines the starting angle of the arc in degrees.
- Default value:
- 0.0
- Parameters:
value
- the value for thestartAngle
property- See Also:
-
getStartAngle
public final double getStartAngle()Gets the value of thestartAngle
property.- Property description:
- Defines the starting angle of the arc in degrees.
- Default value:
- 0.0
- Returns:
- the value of the
startAngle
property - See Also:
-
startAngleProperty
Defines the starting angle of the arc in degrees.- Default value:
- 0.0
- Returns:
- the
startAngle
property - See Also:
-
setLength
public final void setLength(double value) Sets the value of thelength
property.- Property description:
- Defines the angular extent of the arc in degrees.
- Default value:
- 0.0
- Parameters:
value
- the value for thelength
property- See Also:
-
getLength
public final double getLength()Gets the value of thelength
property.- Property description:
- Defines the angular extent of the arc in degrees.
- Default value:
- 0.0
- Returns:
- the value of the
length
property - See Also:
-
lengthProperty
Defines the angular extent of the arc in degrees.- Default value:
- 0.0
- Returns:
- the
length
property - See Also:
-
setType
Sets the value of thetype
property.- Property description:
- Defines the closure type for the arc:
ArcType.OPEN
,ArcType.CHORD
,orArcType.ROUND
. - Default value:
- OPEN
- Parameters:
value
- the value for thetype
property- See Also:
-
getType
Gets the value of thetype
property.- Property description:
- Defines the closure type for the arc:
ArcType.OPEN
,ArcType.CHORD
,orArcType.ROUND
. - Default value:
- OPEN
- Returns:
- the value of the
type
property - See Also:
-
typeProperty
- Default value:
- OPEN
- Returns:
- the
type
property - See Also:
-
toString
Returns a string representation of thisArc
object. -
impl_computeGeomBounds
Description copied from class:Node
Computes the geometric bounds for this Node. This method is abstract and must be implemented by each Node subclass.- Specified by:
impl_computeGeomBounds
in classNode
-