Class Rectangle
java.lang.Object
javafx.scene.Node
javafx.scene.shape.Shape
javafx.scene.shape.Rectangle
- All Implemented Interfaces:
Styleable
,EventTarget
The
Rectangle
class defines a rectangle
with the specified size and location. By default the rectangle
has sharp corners. Rounded corners can be specified by setting both of
the arcWidth and arcHeight properties to positive values (> 0.0)
.
Example code: the following code creates a rectangle with 20 pixel rounded corners.
import javafx.scene.shape.*; Rectangle r = new Rectangle(); r.setX(50); r.setY(50); r.setWidth(200); r.setHeight(100); r.setArcWidth(20); r.setArcHeight(20);
- Since:
- JavaFX 2.0
-
Property Summary
PropertiesTypePropertyDescriptionfinal DoubleProperty
Defines the vertical diameter of the arc at the four corners of the rectangle.final DoubleProperty
Defines the horizontal diameter of the arc at the four corners of the rectangle.final DoubleProperty
Defines the height of the rectangle.final DoubleProperty
Defines the width of the rectangle.final DoubleProperty
Defines the X coordinate of the upper-left corner of the rectangle.final DoubleProperty
Defines the Y coordinate of the upper-left corner of the rectangle.Properties declared in class javafx.scene.shape.Shape
fill, smooth, strokeDashOffset, strokeLineCap, strokeLineJoin, strokeMiterLimit, stroke, strokeType, strokeWidth
Properties declared in class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Field Summary
Fields declared in class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
Constructors