Class FPMILayout
java.lang.Object
com.inductiveautomation.factorypmi.application.components.util.FPMILayout
- All Implemented Interfaces:
LayoutManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
static final int
static final int
static final int
static final String
static final String
static final String
static final String
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Point2D
_getPrefSize
(JComponent comp) void
addLayoutComponent
(String name, Component comp) static Rectangle2D
getBounds
(JComponent comp) Provides a consistent way to get the bounds of a component.static Rectangle2D
getBounds
(JComponent comp, Rectangle2D rv) static FPMI_LC
Looks for the layout constraints (FPMI_LC object) on the component using client property key "fpmi.lc".static JComponent
getOffsettingParent
(JComponent source) Find the closest VisionContainer parent of the source component that is an offsetting parentstatic Rectangle2D
getPreferredBounds
(JComponent comp) Provides a consistent way to get the preferred bounds of a component.void
layoutContainer
(Container parent) minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) void
static void
setBounds
(JComponent comp, Rectangle2D bounds) Sets the actual bounds of a component.static void
setPreferredBounds
(JComponent comp, Rectangle2D bounds) Set the preferred bounding box of a component.static void
setRelativeEnabled
(boolean b) Deprecated.
-
Field Details
-
LAYOUT_FLAGS
- See Also:
-
NO_SCALE_FONTS
- See Also:
-
PREF_SIZE_2D
- See Also:
-
BOUNDS_2D
- See Also:
-
LAYOUT_CONSTRAINTS
- See Also:
-
ANCHOR_N
public static final int ANCHOR_N- See Also:
-
ANCHOR_S
public static final int ANCHOR_S- See Also:
-
ANCHOR_E
public static final int ANCHOR_E- See Also:
-
ANCHOR_W
public static final int ANCHOR_W- See Also:
-
SCALE_RELATIVE
public static final int SCALE_RELATIVE- See Also:
-
CENTER_X
public static final int CENTER_X- See Also:
-
CENTER_Y
public static final int CENTER_Y- See Also:
-
AR_LEADING
public static final int AR_LEADING- See Also:
-
AR_TRAILING
public static final int AR_TRAILING- See Also:
-
AR_OFF
public static final int AR_OFF- See Also:
-
DEFAULT_FLAGS
public static final int DEFAULT_FLAGS- See Also:
-
-
Constructor Details
-
FPMILayout
public FPMILayout()
-
-
Method Details
-
setRelativeEnabled
Deprecated.No longer used. Relative layout mode is only enabled in the runtime, never in the designer. -
getLayoutConstraints
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
- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
getPreferredBounds
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
-
setPreferredBounds
Set the preferred bounding box of a component. This function detects for the two strategies for storing this: normalJComponent
vsBounds2DComponent
-
getBounds
Provides a consistent way to get the bounds of a component. Detects the two major kinds of components -Bounds2DComponent
and normalJComponent
. -
getBounds
-
setBounds
Sets the actual bounds of a component. This function detects for the two strategies for storing this: normalJComponent
vsBounds2DComponent
-
layoutContainer
- Specified by:
layoutContainer
in interfaceLayoutManager
-
getOffsettingParent
Find the closest VisionContainer parent of the source component that is an offsetting parent
-