Class FPMI_LC
- java.lang.Object
- 
- com.inductiveautomation.factorypmi.application.components.util.FPMI_LC
 
- 
 public class FPMI_LC extends java.lang.ObjectVision 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 boundsNow, 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)andFPMILayout.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 SummaryConstructors Constructor Description FPMI_LC()Creates a new, default constraints objectFPMI_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
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.BooleangetDisableFontScale()java.lang.IntegergetFlags()java.lang.FloatgetFontRatioX()java.lang.FloatgetFontRatioY()java.awt.geom.Point2DgetPreferredLocation()voidsetDisableFontScale(java.lang.Boolean disableFontScale)voidsetFlags(java.lang.Integer flags)voidsetFontRatioX(java.lang.Float ratioX)voidsetFontRatioY(java.lang.Float ratioY)voidsetPreferredLocation(java.awt.geom.Point2D preferredLocation)
 
- 
- 
- 
Constructor Detail- 
FPMI_LCpublic FPMI_LC() Creates a new, default constraints object
 - 
FPMI_LCpublic FPMI_LC(int flags) 
 - 
FPMI_LCpublic 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
 
- 
 - 
Method Detail- 
getPreferredLocationpublic java.awt.geom.Point2D getPreferredLocation() 
 - 
setPreferredLocationpublic void setPreferredLocation(java.awt.geom.Point2D preferredLocation) 
 - 
getFlagspublic java.lang.Integer getFlags() 
 - 
setFlagspublic void setFlags(java.lang.Integer flags) 
 - 
getDisableFontScalepublic java.lang.Boolean getDisableFontScale() 
 - 
setDisableFontScalepublic void setDisableFontScale(java.lang.Boolean disableFontScale) 
 - 
getFontRatioXpublic java.lang.Float getFontRatioX() 
 - 
setFontRatioXpublic void setFontRatioX(java.lang.Float ratioX) 
 - 
getFontRatioYpublic java.lang.Float getFontRatioY() 
 - 
setFontRatioYpublic void setFontRatioY(java.lang.Float ratioY) 
 
- 
 
-