Shape class provides definitions of common properties for
objects that represent some form of geometric shape. These properties
include:
Paint to be applied to the fillable interior of the
shape (see setFill).
Paint to be applied to stroke the outline of the
shape (see setStroke).
StrokeType).
On the other hand, stroking those same shapes can often lead to fuzzy outlines because the default stroking attributes specify both that the default stroke width is 1.0 coordinates which often maps to exactly 1 device pixel and also that the stroke should straddle the border of the shape, falling half on either side of the border. Since the borders in many common shapes tend to fall directly on integer coordinates and those integer coordinates often map precisely to integer device locations, the borders tend to result in 50% coverage over the pixel rows and columns on either side of the border of the shape rather than 100% coverage on one or the other. Thus, fills may typically be crisp, but strokes are often fuzzy.
Two common solutions to avoid these fuzzy outlines are to use wider
strokes that cover more pixels completely - typically a stroke width of
2.0 will achieve this if there are no scale transforms in effect - or
to specify either the StrokeType#INSIDE or StrokeType#OUTSIDE
stroke styles - which will bias the default single unit stroke onto one
of the full pixel rows or columns just inside or outside the border of
the shape.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final float[] | |
| private static final double | |
| private static final StrokeLineCap | |
| private static final StrokeLineJoin | |
| private static final double | |
| private static final StrokeType | |
| private static final double | |
| private ObjectProperty | fill
Defines parameters to fill the interior of an |
| private static final double | |
| private static final double | |
| private NGShape. | |
| pack-priv Paint | |
| pack-priv Paint | |
| private final AbstractNotifyListener | |
| private Reference | |
| private BooleanProperty | smooth
Defines whether antialiasing hints are used or not for this |
| private ObjectProperty | stroke
Defines parameters of a stroke that is drawn around the outline of
a |
| private Shape. | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static BaseTransform | |
| private void | |
| pack-priv BaseBounds | computeBounds(BaseBounds bounds, BaseTransform tx, double upad, double dpad, double x, double y, double w, double h)
Helper function for rectangular shapes such as Rectangle and Ellipse for computing their bounds. |
| private NGShape. | |
| pack-priv BaseBounds | |
| pack-priv boolean | |
| pack-priv StrokeLineJoin | |
| private static Path | |
| private static Area | |
| private boolean | |
| private BaseBounds | |
| private Paint | |
| private Paint | |
| private void | doMarkDirty(DirtyBits dirtyBits)
Hides javafx. Mark the specified bit as dirty, and add this node to the scene's dirty list. |
| private void | |
| public final ObjectProperty | |
| public static List | Returns: theCssMetaDataHides javafx. Gets the |
| public List | getCssMetaData()
Overrides javafx. Implements javafx. This method should delegate to |
| public final Paint | |
| pack-priv NGShape. | |
| public final Paint | |
| private Shape. | |
| public final ObservableList | Returns: the array representing the lengths of the dash segmentsDefines the array representing the lengths of the dash segments. |
| public final double | |
| public final StrokeLineCap | |
| public final StrokeLineJoin | |
| public final double | |
| public final StrokeType | |
| public final double | |
| private Area | |
| private Area | |
| private boolean | |
| public static Shape | |
| public final boolean | |
| public final void | |
| pack-priv void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final BooleanProperty | |
| public final DoubleProperty | Returns: the distance specified in user coordinates that represents an offset into the dashing patternDefines a distance specified in user coordinates that represents an offset into the dashing pattern. |
| public final ObjectProperty | Returns: the end cap style of this shapeThe end cap style of this |
| public final ObjectProperty | Returns: the decoration applied where path segments meetDefines the decoration applied where path segments meet. |
| public final DoubleProperty | Returns: the limit for theStrokeLineJoin.MITER line join styleDefines the limit for the |
| public final ObjectProperty | |
| public final ObjectProperty | Returns: the direction that the strokeWidth is applied to the boundary of the shapeDefines the direction (inside, centered, or outside) that the strokeWidth is applied to the boundary of the shape. |
| public final DoubleProperty | |
| public static Shape | |
| private static float[] | |
| public static Shape | |
| private void |