Class Direct


  • public class Direct
    extends java.lang.Object
    Direct resolution engine This walks through the graph of dependencies and infer final position. This allows us to skip the linear solver in many situations, as well as skipping intermediate measure passes. Widgets are solved independently in horizontal and vertical. Any widgets not fully resolved will be computed later on by the linear solver.
    • Constructor Summary

      Constructors 
      Constructor Description
      Direct()  
    • Constructor Detail

      • Direct

        public Direct()
    • Method Detail

      • solvingPass

        public static void solvingPass​(ConstraintWidgetContainer layout,
                                       BasicMeasure.Measurer measurer)
        Walk the dependency graph and solves it.
        Parameters:
        layout - the container we want to optimize
        measurer - the measurer used to measure the widget
      • ls

        public static java.lang.String ls​(int level)
        Small utility function to indent logs depending on the level
        Returns:
        a formatted string for the indentation
      • solveChain

        public static boolean solveChain​(ConstraintWidgetContainer container,
                                         LinearSystem system,
                                         int orientation,
                                         int offset,
                                         ChainHead chainHead,
                                         boolean isChainSpread,
                                         boolean isChainSpreadInside,
                                         boolean isChainPacked)
        Try to directly resolve the chain
        Returns:
        true if fully resolved