Class FPMI_LC
Vision Layout constraints object, used with FPMILayout to hold the "layout constraints" (LC) of a component. This is a bit of a mess because of backwards compatibility, here's the explanation:
Originally, Components stored a java.awt.Point as a client property under the key FPMILayout.PREF_LOCATION. They also stored their layout options under a LAYOUT_FLAGS client prop, as well as font scaling options.
Then we introduced the FPMI_LC class primarily because it allowed us a more compact serialization mechanism. The
constructor FPMI_LC(javax.swing.JComponent)
fills in its fields from the older style client properties. At
this point, a component's preferred location was stored in the FPMI_LC, it's preferred size was stored in it's
Dimension preferredSize, and it's actual location was stored in its Rectangle bounds
Now, fast-forward to 7.3 with the introduction of vector shapes. These shapes are radically different, and can't use either of the Swing constructs preferredSize or bounds. So they have two Rectangle2Ds on them instead: originalBounds (a.k.a. preferred size+preferred location), and boundingRect
We realized how useful it is to store everything in floating precision, so we changed preferredLocation to a Point2D, and started storing what was the Dimension preferredSize as a Point2D client property under the key FPMILayout.PREF_SIZE_2D where x=width and y=height, and the actual bounds as a Rectangle2D under client property FPMILayout.BOUNDS_2D
Conveniently, the functions FPMILayout.getPreferredBounds(javax.swing.JComponent)
and
FPMILayout.getBounds(javax.swing.JComponent)
make neat work of this confusion. these methods (and their
setters) should be the only way that bounds get accessed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFlags()
void
setDisableFontScale
(Boolean disableFontScale) void
void
setFontRatioX
(Float ratioX) void
setFontRatioY
(Float ratioY) void
setPreferredLocation
(Point2D preferredLocation)
-
Constructor Details
-
Method Details
-
getPreferredLocation
-
setPreferredLocation
-
getFlags
-
setFlags
-
getDisableFontScale
-
setDisableFontScale
-
getFontRatioX
-
setFontRatioX
-
getFontRatioY
-
setFontRatioY
-