Class Borders

java.lang.Object
com.github.miachm.sods.Borders

public class Borders extends Object
This a class which represents the nature of the borders of a cell.
  • Constructor Details

    • Borders

      public Borders()
    • Borders

      public Borders(boolean border)
      Constructor with all borders the same, and default properties: 0.035cm solid #000000
      Parameters:
      border - Boolean setting all borders on/off.
    • Borders

      public Borders(boolean border, String borderProperties)
      Constructor with all borders the same, specifying its properties.
      Parameters:
      border - Boolean setting all borders on/off.
      borderProperties - Border properties.
    • Borders

      public Borders(boolean borderTop, boolean borderBottom, boolean borderLeft, boolean borderRight)
      Constructor specifying which borders to activate, with default properties: 0.035cm solid #000000.
      Parameters:
      borderTop - Boolean setting top border on/off.
      borderBottom - Boolean setting bottom border on/off.
      borderLeft - Boolean setting left border on/off.
      borderRight - Boolean setting right border on/off.
    • Borders

      public Borders(boolean borderTop, String borderTopProperties, boolean borderBottom, String borderBottomProperties, boolean borderLeft, String borderLeftProperties, boolean borderRight, String borderRightProperties)
      Constructor specifying which borders to activate, specifying their properties.
      Parameters:
      borderTop - Boolean setting top border on/off.
      borderTopProperties - Top border properties.
      borderBottom - Boolean setting bottom border on/off.
      borderBottomProperties - Bottom border properties.
      borderLeft - Boolean setting left border on/off.
      borderLeftProperties - Left border properties.
      borderRight - Boolean setting right border on/off.
      borderRightProperties - Right border properties.
  • Method Details

    • isBorder

      public boolean isBorder()
      Determines if the style has all borders or not.
      Returns:
      true if the style has all borders, false otherwise.
    • setBorder

      public void setBorder(boolean border)
      Sets all borders on/off.
      Parameters:
      border - Boolean representing all borders set on/off.
    • getBorderProperties

      public String getBorderProperties()
      Gets global border properties.
      Returns:
      Global border properties.
    • setBorderProperties

      public void setBorderProperties(String borderProperties)
      Sets global border properties.
      Parameters:
      borderProperties - Global border properties.
    • isBorderTop

      public boolean isBorderTop()
      Determines if the style has top border or not.
      Returns:
      true if the style has top border, false otherwise.
    • setBorderTop

      public void setBorderTop(boolean borderTop)
      Sets top border on/off.
      Parameters:
      borderTop - Boolean representing top border set on/off.
    • getBorderTopProperties

      public String getBorderTopProperties()
      Gets top border properties.
      Returns:
      Top border properties.
    • setBorderTopProperties

      public void setBorderTopProperties(String borderTopProperties)
      Sets top border properties.
      Parameters:
      borderTopProperties - Top border properties.
    • isBorderBottom

      public boolean isBorderBottom()
      Determines if the style has bottom border or not.
      Returns:
      true if the style has bottom border, false otherwise.
    • setBorderBottom

      public void setBorderBottom(boolean borderBottom)
      Sets bottom border on/off.
      Parameters:
      borderBottom - Boolean representing bottom border set on/off.
    • getBorderBottomProperties

      public String getBorderBottomProperties()
      Gets bottom border properties.
      Returns:
      Bottom border properties.
    • setBorderBottomProperties

      public void setBorderBottomProperties(String borderBottomProperties)
      Sets bottom border properties.
      Parameters:
      borderBottomProperties - Bottom border properties.
    • isBorderLeft

      public boolean isBorderLeft()
      Determines if the style has left border or not.
      Returns:
      true if the style has left border, false otherwise.
    • setBorderLeft

      public void setBorderLeft(boolean borderLeft)
      Sets left border on/off.
      Parameters:
      borderLeft - Boolean representing left border set on/off.
    • getBorderLeftProperties

      public String getBorderLeftProperties()
      Gets left border properties.
      Returns:
      Left border properties.
    • setBorderLeftProperties

      public void setBorderLeftProperties(String borderLeftProperties)
      Sets left border properties.
      Parameters:
      borderLeftProperties - Left border properties.
    • isBorderRight

      public boolean isBorderRight()
      Determines if the style has right border or not.
      Returns:
      true if the style has right border, false otherwise.
    • setBorderRight

      public void setBorderRight(boolean borderRight)
      Sets right border on/off.
      Parameters:
      borderRight - Boolean representing right border set on/off.
    • getBorderRightProperties

      public String getBorderRightProperties()
      Gets right border properties.
      Returns:
      Right border properties.
    • setBorderRightProperties

      public void setBorderRightProperties(String borderRightProperties)
      Sets right border properties.
      Parameters:
      borderRightProperties - Right border properties.
    • anyBorder

      public boolean anyBorder()
      Tells if there is any border set on.
      Returns:
      true if there is any border, false otherwise.
    • getCssStyles

      public Map<String,String> getCssStyles()
      Returns a Map representing this class as css-styles. For example, if you set top and bottom borders without specifying their properties, you will get a Map with 2 keys: border-top = 0.035cm solid #000000 border-bottom = 0.035cm solid #000000
      Returns:
      A map with the CSS representation of this class
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object