java.lang.Object
com.inductiveautomation.factorypmi.application.components.util.FPMILayout
All Implemented Interfaces:
LayoutManager

public class FPMILayout extends Object implements LayoutManager
  • Field Details

  • Constructor Details

    • FPMILayout

      public FPMILayout()
  • Method Details

    • 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(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(String name, Component comp)
      Specified by:
      addLayoutComponent in interface LayoutManager
    • removeLayoutComponent

      public void removeLayoutComponent(Component comp)
      Specified by:
      removeLayoutComponent in interface LayoutManager
    • preferredLayoutSize

      public Dimension preferredLayoutSize(Container parent)
      Specified by:
      preferredLayoutSize in interface LayoutManager
    • minimumLayoutSize

      public Dimension minimumLayoutSize(Container parent)
      Specified by:
      minimumLayoutSize in interface LayoutManager
    • getPreferredBounds

      public static Rectangle2D getPreferredBounds(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 Point2D _getPrefSize(JComponent comp)
    • setPreferredBounds

      public static void setPreferredBounds(JComponent comp, Rectangle2D bounds)
      Set the preferred bounding box of a component. This function detects for the two strategies for storing this: normal JComponent vs Bounds2DComponent
    • getBounds

      public static Rectangle2D getBounds(JComponent comp)
      Provides a consistent way to get the bounds of a component. Detects the two major kinds of components - Bounds2DComponent and normal JComponent.
    • getBounds

      public static Rectangle2D getBounds(JComponent comp, Rectangle2D rv)
    • setBounds

      public static void setBounds(JComponent comp, Rectangle2D bounds)
      Sets the actual bounds of a component. This function detects for the two strategies for storing this: normal JComponent vs Bounds2DComponent
    • layoutContainer

      public void layoutContainer(Container parent)
      Specified by:
      layoutContainer in interface LayoutManager
    • getOffsettingParent

      public static JComponent getOffsettingParent(JComponent source)
      Find the closest VisionContainer parent of the source component that is an offsetting parent