Class GridEngine


  • public class GridEngine
    extends java.lang.Object
    GridEngine class contains the main logic of the Grid Helper
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int HORIZONTAL  
      static int VERTICAL  
    • Constructor Summary

      Constructors 
      Constructor Description
      GridEngine()  
      GridEngine​(int rows, int columns)  
      GridEngine​(int rows, int columns, int numWidgets)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int bottomOfWidget​(int i)
      Get the boxView for the widget i to add a constraint on the bottom
      int leftOfWidget​(int i)
      Get the boxView for the widget i to add a constraint on the left
      int rightOfWidget​(int i)
      Get the boxView for the widget i to add a constraint on the right
      void setColumns​(int columns)
      set new columns value
      void setNumWidgets​(int num)
      Set new NumWidgets value
      void setOrientation​(int orientation)
      set new orientation value
      void setRows​(int rows)
      set new rows value
      void setSkips​(java.lang.String skips)
      set new skips value
      void setSpans​(java.lang.CharSequence spans)
      set new spans value
      void setup()
      Set up the Grid engine.
      int topOfWidget​(int i)
      Get the boxView for the widget i to add a constraint on the top
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GridEngine

        public GridEngine()
      • GridEngine

        public GridEngine​(int rows,
                          int columns)
      • GridEngine

        public GridEngine​(int rows,
                          int columns,
                          int numWidgets)
    • Method Detail

      • setup

        public void setup()
        Set up the Grid engine.
      • setSpans

        public void setSpans​(java.lang.CharSequence spans)
        set new spans value
        Parameters:
        spans - new spans value
      • setSkips

        public void setSkips​(java.lang.String skips)
        set new skips value
        Parameters:
        skips - new spans value
      • setOrientation

        public void setOrientation​(int orientation)
        set new orientation value
        Parameters:
        orientation - new orientation value
      • setNumWidgets

        public void setNumWidgets​(int num)
        Set new NumWidgets value
        Parameters:
        num - how many widgets to be arranged in Grid
      • setRows

        public void setRows​(int rows)
        set new rows value
        Parameters:
        rows - new rows value
      • setColumns

        public void setColumns​(int columns)
        set new columns value
        Parameters:
        columns - new rows value
      • leftOfWidget

        public int leftOfWidget​(int i)
        Get the boxView for the widget i to add a constraint on the left
        Parameters:
        i - the widget that has the order as i in the constraint_reference_ids
        Returns:
        the boxView to add a constraint on the left
      • topOfWidget

        public int topOfWidget​(int i)
        Get the boxView for the widget i to add a constraint on the top
        Parameters:
        i - the widget that has the order as i in the constraint_reference_ids
        Returns:
        the boxView to add a constraint on the top
      • rightOfWidget

        public int rightOfWidget​(int i)
        Get the boxView for the widget i to add a constraint on the right
        Parameters:
        i - the widget that has the order as i in the constraint_reference_ids
        Returns:
        the boxView to add a constraint on the right
      • bottomOfWidget

        public int bottomOfWidget​(int i)
        Get the boxView for the widget i to add a constraint on the bottom
        Parameters:
        i - the widget that has the order as i in the constraint_reference_ids
        Returns:
        the boxView to add a constraint on the bottom