Class CssGridSizes

All Implemented Interfaces:
Serializable, Cloneable, Copyable, DictionaryBean, UifDictionaryBean

public class CssGridSizes extends UifDictionaryBeanBase
CssGridSizes are used by CssGridLayoutManagers to determine how much "column/cell" width an item will take up in a css grid layout. It is important to note that sizes set will affect that screen size AND all screen sizes larger than that size unless those screen sizes also have a size explicitly set. Each "row" is 12 across, so no sizes in this object are allowed to exceed this value.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • CssGridSizes

      public CssGridSizes()
    • CssGridSizes

      public CssGridSizes(int xsSize, int smSize, int mdSize, int lgSize)
  • Method Details

    • getCssClassString

      public String getCssClassString()
      Gets the css class string to use on the cell div of this item, by concatnating the appropriate css classes based on the size values set on this object
      Returns:
      the css class string that represents the size of the "cell" div for this item at different screen sizes
    • getXsSize

      public int getXsSize()
      The size this Component's "cell" div will take up at an extra small screen size (phone).

      If 0 this setting will be ignored (default). This setting CANNOT exceed 12.

      Returns:
      the extra small size
    • setXsSize

      public void setXsSize(int xsSize)
      See Also:
    • getSmSize

      public int getSmSize()
      The size this Component's "cell" div will take up at a small screen size (tablet).

      If 0 this setting will be ignored (default). This setting CANNOT exceed 12.

      Returns:
      the small size
    • setSmSize

      public void setSmSize(int smSize)
      See Also:
    • getMdSize

      public int getMdSize()
      The size this Component's "cell" div will take up at a medium screen size (desktop).

      If 0 this setting will be ignored (default). This setting CANNOT exceed 12.

      Returns:
      the medium size
    • setMdSize

      public void setMdSize(int mdSize)
      See Also:
    • getLgSize

      public int getLgSize()
      The size this Component's "cell" div will take up at a large screen size (large desktop).

      If 0 this setting will be ignored (default). This setting CANNOT exceed 12.

      Returns:
      the large size
    • setLgSize

      public void setLgSize(int lgSize)
      See Also:
    • getSmOffset

      public int getSmOffset()
      The offset (amount "pushed over") the div will have before the Component content at a small screen size (tablet).

      If -1 this setting will be ignored (default). This setting CANNOT exceed 12 AND should not be set to 12 as it will cause unintended behaviors (maximum should be 11 in most cases). When using offset it is recommended that the size of content in the "row" PLUS the offset and size of this "cell" at each screen size DOES NOT exceed 12 or unintended layouts WILL result. There is no extra small (xs) offset.

      Returns:
      the small size offset
    • setSmOffset

      public void setSmOffset(int smOffset)
      See Also:
    • getMdOffset

      public int getMdOffset()
      The offset (amount "pushed over") the div will have before the Component content at a medium screen size (desktop), this can be set to 0 to override previous screen size offsets.

      If -1 this setting will be ignored (default). This setting CANNOT exceed 12 AND should not be set to 12 as it will cause unintended behaviors (maximum should be 11 in most cases). When using offset it is recommended that the size of content in the "row" PLUS the offset and size of this "cell" at each screen size DOES NOT exceed 12 or unintended layouts WILL result. There is no extra small (xs) offset.

      Returns:
      the medium size offset
    • setMdOffset

      public void setMdOffset(int mdOffset)
      See Also:
    • getLgOffset

      public int getLgOffset()
      The offset (amount "pushed over") the div will have before the Component content at a large screen size (large desktop); this can be set to 0 to override previous screen size offsets.

      If -1 this setting will be ignored (default). This setting CANNOT exceed 12 AND should not be set to 12 as it will cause unintended behaviors (maximum should be 11 in most cases). When using offset it is recommended that the size of content in the "row" PLUS the offset and size of this "cell" at each screen size DOES NOT exceed 12 or unintended layouts WILL result. There is no extra small (xs) offset.

      Returns:
      the large size offset
    • setLgOffset

      public void setLgOffset(int lgOffset)
      See Also:
    • setSizes

      public void setSizes(int[] sizes)
      Convenience setter for sizes which takes in 4 integers in this order: xsSize, smSize, mdSize, lgSize

      The length of this array MUST be 4. Any values 0 or less will have the same affect as not setting that size.

      Parameters:
      sizes - the sizes in order of xs, sm, md, lg
    • setOffsets

      public void setOffsets(int[] offsets)
      Convenience setter for offsets which takes in 3 integers in this order: smOffset, mdOffset, lgOffset

      The length of this array MUST be 3. Any values -1 or less will have the same affect as not setting that size because (unlike sizes) 0 is a valid value for offsets.

      Parameters:
      offsets - the sizes in order of sm, md, lg
    • getTotalSmSize

      public int getTotalSmSize()
      Helper method to get the total space this div will take up at a small screen size, taking size, offset, and other size settings into account
      Returns:
      the total small size
    • getTotalMdSize

      public int getTotalMdSize()
      Helper method to get the total space this div will take up at a medium screen size, taking size, offset, and other size settings into account
      Returns:
      the total medium size
    • getTotalLgSize

      public int getTotalLgSize()
      Helper method to get the total space this div will take up at a large screen size, taking size, offset, and other size settings into account
      Returns:
      the total large size