Java Reference
In-Depth Information
For example, the following style sheet entry would create a linear gradient start-
ing with sky blue from the upper-left migrating to white in the lower-right part of
the paint area.
fill: linear (0%, 0%) to (100%, 100%) stops
(0.0, skyblue), (1.0, white)
For
linear
, the
startX
/
startY
and
endX
/
endY
may be expressed as an absolute
value or a percent. The only restriction is that all values must be in the same units.
reflect
and
repeat
are optional and map to the
javafx.scene.paint.Cycle-
Methods
of
REFLECT
and
REPEAT
, respectively. Reflect means the gradient is
reflected to fill remaining space. When reflect is used, the gradient colors are
painted start to end, then painted end to start, and so on to fill in extra space.
Repeat means the start and end colors are repeated to fill in extra space.
radial
maps to the
javafx.scene.paint.RadialGradient
class.
radial (startX, startY),100% focus(focusX, focusY) stops
(offset, color), (offset, color), ... [reflect|repeat]
For example, to create a
RadialGradient
starting at position 0,0 with a focus a
quarter of the way across and down migrating from red to blue, you use a style
sheet entry using the following syntax:
fill: radial (0%,0%),100% focus(25%,25%)
stops (0.00,red),(1.00, blue);
For
radial
, the
startX
/
startY
and
focusX
/
focusY
may be expressed as an
absolute value or a percent. The only restriction is that all values must be in the
same units.
reflect
and
repeat
are optional and map to
the javafx.scene
.paint.CycleMethods
of
REFLECT
and
REPEAT
, respectively. Reflect means the
gradient is reflected to fill remaining space. When reflect is used, the gradient
colors are painted start to end, then painted end to start, and so on to fill in extra
space. Repeat means the start and end colors are repeated to fill in extra space.
Font
Fonts are defined as having optional font weight, a font size, and a font name.
Font weight may be bold, italic, or both. Size is a number, either decimal or inte-
ger, with units of either pt (point), mm (millimeters), cm (centimeters), pc (pica),
or in (inch).
font: bold italic 35pt "sans-serif";
Search WWH ::
Custom Search