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 int
ANCHOR_E
static int
ANCHOR_N
static int
ANCHOR_S
static int
ANCHOR_W
static int
AR_LEADING
static int
AR_OFF
static int
AR_TRAILING
static java.lang.String
BOUNDS_2D
static int
CENTER_X
static int
CENTER_Y
static int
DEFAULT_FLAGS
static java.lang.String
LAYOUT_CONSTRAINTS
static java.lang.String
LAYOUT_FLAGS
static java.lang.String
NO_SCALE_FONTS
static java.lang.String
PREF_SIZE_2D
static int
SCALE_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)
void
addLayoutComponent(java.lang.String name, java.awt.Component comp)
static java.awt.geom.Rectangle2D
getBounds(javax.swing.JComponent comp)
Provides a consistent way to get the bounds of a component.static java.awt.geom.Rectangle2D
getBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D rv)
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".static javax.swing.JComponent
getOffsettingParent(javax.swing.JComponent source)
Find the closest VisionContainer parent of the source component that is an offsetting parentstatic java.awt.geom.Rectangle2D
getPreferredBounds(javax.swing.JComponent comp)
Provides a consistent way to get the preferred bounds of a component.void
layoutContainer(java.awt.Container parent)
java.awt.Dimension
minimumLayoutSize(java.awt.Container parent)
java.awt.Dimension
preferredLayoutSize(java.awt.Container parent)
void
removeLayoutComponent(java.awt.Component comp)
static void
setBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)
Sets the actual bounds of a component.static void
setPreferredBounds(javax.swing.JComponent comp, java.awt.geom.Rectangle2D bounds)
Set the preferred bounding box of a component.static void
setRelativeEnabled(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:
addLayoutComponent
in interfacejava.awt.LayoutManager
-
removeLayoutComponent
public void removeLayoutComponent(java.awt.Component comp)
- Specified by:
removeLayoutComponent
in interfacejava.awt.LayoutManager
-
preferredLayoutSize
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
- Specified by:
preferredLayoutSize
in interfacejava.awt.LayoutManager
-
minimumLayoutSize
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
- Specified by:
minimumLayoutSize
in 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: normalJComponent
vsBounds2DComponent
-
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 -Bounds2DComponent
and 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: normalJComponent
vsBounds2DComponent
-
layoutContainer
public void layoutContainer(java.awt.Container parent)
- Specified by:
layoutContainer
in 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
-
-