Class FPMILayout
- java.lang.Object
-
- com.inductiveautomation.factorypmi.application.components.util.FPMILayout
-
- All Implemented Interfaces:
java.awt.LayoutManager
public class FPMILayout extends java.lang.Object implements java.awt.LayoutManager
-
-
Field Summary
Fields Modifier and Type Field Description static intANCHOR_Estatic intANCHOR_Nstatic intANCHOR_Sstatic intANCHOR_Wstatic intAR_LEADINGstatic intAR_OFFstatic intAR_TRAILINGstatic java.lang.StringBOUNDS_2Dstatic intCENTER_Xstatic intCENTER_Ystatic intDEFAULT_FLAGSstatic java.lang.StringLAYOUT_CONSTRAINTSstatic java.lang.StringLAYOUT_FLAGSstatic java.lang.StringNO_SCALE_FONTSstatic java.lang.StringPREF_SIZE_2Dstatic intSCALE_RELATIVE
-
Constructor Summary
Constructors Constructor Description FPMILayout()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.awt.geom.Point2D_getPrefSize(javax.swing.JComponent comp)voidaddLayoutComponent(java.lang.String name, java.awt.Component comp)static java.awt.geom.Rectangle2DgetBounds(javax.swing.JComponent comp)Provides a consistent way to get the bounds of a component.static java.awt.geom.Rectangle2DgetBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D rv)static FPMI_LCgetLayoutConstraints(javax.swing.JComponent comp)Looks for the layout constraints (FPMI_LC object) on the component using client property key "fpmi.lc".static javax.swing.JComponentgetOffsettingParent(javax.swing.JComponent source)Find the closest VisionContainer parent of the source component that is an offsetting parentstatic java.awt.geom.Rectangle2DgetPreferredBounds(javax.swing.JComponent comp)Provides a consistent way to get the preferred bounds of a component.voidlayoutContainer(java.awt.Container parent)java.awt.DimensionminimumLayoutSize(java.awt.Container parent)java.awt.DimensionpreferredLayoutSize(java.awt.Container parent)voidremoveLayoutComponent(java.awt.Component comp)static voidsetBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)Sets the actual bounds of a component.static voidsetPreferredBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)Set the preferred bounding box of a component.static voidsetRelativeEnabled(boolean b)Deprecated.
-
-
-
Field Detail
-
LAYOUT_FLAGS
public static final java.lang.String LAYOUT_FLAGS
- See Also:
- Constant Field Values
-
NO_SCALE_FONTS
public static final java.lang.String NO_SCALE_FONTS
- See Also:
- Constant Field Values
-
PREF_SIZE_2D
public static final java.lang.String PREF_SIZE_2D
- See Also:
- Constant Field Values
-
BOUNDS_2D
public static final java.lang.String BOUNDS_2D
- See Also:
- Constant Field Values
-
LAYOUT_CONSTRAINTS
public static final java.lang.String LAYOUT_CONSTRAINTS
- See Also:
- Constant Field Values
-
ANCHOR_N
public static final int ANCHOR_N
- See Also:
- Constant Field Values
-
ANCHOR_S
public static final int ANCHOR_S
- See Also:
- Constant Field Values
-
ANCHOR_E
public static final int ANCHOR_E
- See Also:
- Constant Field Values
-
ANCHOR_W
public static final int ANCHOR_W
- See Also:
- Constant Field Values
-
SCALE_RELATIVE
public static final int SCALE_RELATIVE
- See Also:
- Constant Field Values
-
CENTER_X
public static final int CENTER_X
- See Also:
- Constant Field Values
-
CENTER_Y
public static final int CENTER_Y
- See Also:
- Constant Field Values
-
AR_LEADING
public static final int AR_LEADING
- See Also:
- Constant Field Values
-
AR_TRAILING
public static final int AR_TRAILING
- See Also:
- Constant Field Values
-
AR_OFF
public static final int AR_OFF
- See Also:
- Constant Field Values
-
DEFAULT_FLAGS
public static final int DEFAULT_FLAGS
- See Also:
- Constant Field Values
-
-
Method Detail
-
setRelativeEnabled
@Deprecated public static void setRelativeEnabled(boolean b)
Deprecated.No longer used. Relative layout mode is only enabled in the runtime, never in the designer.
-
getLayoutConstraints
public static FPMI_LC getLayoutConstraints(javax.swing.JComponent comp)
Looks for the layout constraints (FPMI_LC object) on the component using client property key "fpmi.lc". If it isn't found, it tries to make a new FPMI_LC object using the old PREF_LOCATION and NO_SCALE_FONTS properties. If those aren't there, it makes a new, clean FPMI_LC object and stores it in the client props.
-
addLayoutComponent
public void addLayoutComponent(java.lang.String name, java.awt.Component comp)- Specified by:
addLayoutComponentin interfacejava.awt.LayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponentin interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSizein interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSizein interfacejava.awt.LayoutManager
-
getPreferredBounds
public static java.awt.geom.Rectangle2D getPreferredBounds(javax.swing.JComponent comp)
Provides a consistent way to get the preferred bounds of a component. This is the bounding box of a component as it was last time it's parent container's layout was validated in the designer. Layouts may use this box to derive a new bounding box if the parent container changes. This function detects for the two ways that this box is stored:- Normal JComponent: Uses Jcomponent's preferred size property as the Dimension, and the FPMI_LC's preferred location Point to create the rectangle.
- Bounds2DComponent: Uses the originalBounds property.
-
_getPrefSize
public static java.awt.geom.Point2D _getPrefSize(javax.swing.JComponent comp)
-
setPreferredBounds
public static void setPreferredBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)Set the preferred bounding box of a component. This function detects for the two strategies for storing this: normalJComponentvsBounds2DComponent
-
getBounds
public static java.awt.geom.Rectangle2D getBounds(javax.swing.JComponent comp)
Provides a consistent way to get the bounds of a component. Detects the two major kinds of components -Bounds2DComponentand normalJComponent.
-
getBounds
public static java.awt.geom.Rectangle2D getBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D rv)
-
setBounds
public static void setBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)Sets the actual bounds of a component. This function detects for the two strategies for storing this: normalJComponentvsBounds2DComponent
-
layoutContainer
public void layoutContainer(java.awt.Container parent)
- Specified by:
layoutContainerin interfacejava.awt.LayoutManager
-
getOffsettingParent
public static javax.swing.JComponent getOffsettingParent(javax.swing.JComponent source)
Find the closest VisionContainer parent of the source component that is an offsetting parent
-
-