public class FPMI_LC
extends java.lang.Object
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 and Description |
---|
FPMI_LC()
Creates a new, default constraints object
|
FPMI_LC(int flags) |
FPMI_LC(java.awt.geom.Point2D preferredLocation,
java.lang.Integer flags,
java.lang.Boolean disableFontScale,
java.lang.Float ratioX,
java.lang.Float ratioY)
Constructor that takes in all properties
|
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
getDisableFontScale() |
java.lang.Integer |
getFlags() |
java.lang.Float |
getFontRatioX() |
java.lang.Float |
getFontRatioY() |
java.awt.geom.Point2D |
getPreferredLocation() |
void |
setDisableFontScale(java.lang.Boolean disableFontScale) |
void |
setFlags(java.lang.Integer flags) |
void |
setFontRatioX(java.lang.Float ratioX) |
void |
setFontRatioY(java.lang.Float ratioY) |
void |
setPreferredLocation(java.awt.geom.Point2D preferredLocation) |
public FPMI_LC()
public FPMI_LC(int flags)
public FPMI_LC(java.awt.geom.Point2D preferredLocation, java.lang.Integer flags, java.lang.Boolean disableFontScale, java.lang.Float ratioX, java.lang.Float ratioY)
public java.awt.geom.Point2D getPreferredLocation()
public void setPreferredLocation(java.awt.geom.Point2D preferredLocation)
public java.lang.Integer getFlags()
public void setFlags(java.lang.Integer flags)
public java.lang.Boolean getDisableFontScale()
public void setDisableFontScale(java.lang.Boolean disableFontScale)
public java.lang.Float getFontRatioX()
public void setFontRatioX(java.lang.Float ratioX)
public java.lang.Float getFontRatioY()
public void setFontRatioY(java.lang.Float ratioY)