Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Java 2D
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Advanced objects== These objects can be viewed as performing their duties in terms of the simpler objects described above. ===Transform=== Every Java 2D operation is subject to a [[Affine transformation|transform]], so that shapes may be translated, rotated, sheared, and scaled as they are drawn. The active transform is most often the '''identity transform''', which does nothing. Filling using a transform can be viewed as simply creating a new, transformed shape and then filling that shape. ===Stroke=== In addition to the ''fill'' operation, Java 2D provides a ''draw'' operation. While fill draws the interior of a shape, draw draws its outline. The outline can be as simple as a thin line, or as complicated as a dashed line with each dash having rounded edges. The object responsible for generating the outline is the ''stroke''. Given an input shape, the stroke produces a new shape representing its outline. For instance, an infinitely thin line segment (with no interior) might be stroked into a one-pixel-wide rectangle. A draw operation can therefore be described as creating a new, stroked object and then filling that object. Technically speaking, the stroke is only required to accept an input shape and produce a new shape. The stroke implementation provided with Java 2D implements the outline rules described above, but a custom-written stroke could produce any shape it wished.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)