Class Border

java.lang.Object
com.oorian.css.Border

public class Border extends Object
Mutable CSS border configuration for HTML elements.

Border provides a convenient way to configure CSS border properties for each side of an element (top, right, bottom, left). Each side can have its own style, color, and width settings.

Usage:


 // Create a uniform border
 Border border = new Border("solid", "#000000", "1px");

 // Create a custom border
 Border custom = new Border();
 custom.setTopBorder("solid", "red", "2px");
 custom.setBottomBorder("dashed", "blue", "1px");
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • Border

      public Border()
      Constructs a Border with no properties set.
    • Border

      public Border(String style, String color, String width)
      Constructs a Border with uniform properties for all sides.
      Parameters:
      style - the border style (e.g., "solid", "dashed")
      color - the border color (e.g., "#000000", "red")
      width - the border width (e.g., "1px", "2em")
    • Border

      public Border(Border border)
      Constructs a Border by copying another Border instance.
      Parameters:
      border - the Border to copy, or null for empty border
  • Method Details

    • setStyle

      public final void setStyle(String style)
      Sets the style for all four sides.
      Parameters:
      style - the border style (e.g., "solid", "dashed")
    • setColor

      public final void setColor(String color)
      Sets the color for all four sides.
      Parameters:
      color - the border color (e.g., "#000000", "red")
    • setWidth

      public final void setWidth(String width)
      Sets the width for all four sides.
      Parameters:
      width - the border width (e.g., "1px", "2em")
    • setTopBorder

      public final void setTopBorder(String style, String color, String width)
      Sets all properties for the top border.
      Parameters:
      style - the border style
      color - the border color
      width - the border width
    • setTopStyle

      public final void setTopStyle(String style)
      Sets the top border style.
      Parameters:
      style - the border style
    • setTopColor

      public final void setTopColor(String color)
      Sets the top border color.
      Parameters:
      color - the border color
    • setTopWidth

      public final void setTopWidth(String width)
      Sets the top border width.
      Parameters:
      width - the border width
    • setBottomBorder

      public final void setBottomBorder(String style, String color, String width)
      Sets all properties for the bottom border.
      Parameters:
      style - the border style
      color - the border color
      width - the border width
    • setBottomStyle

      public final void setBottomStyle(String style)
      Sets the bottom border style.
      Parameters:
      style - the border style
    • setBottomColor

      public final void setBottomColor(String color)
      Sets the bottom border color.
      Parameters:
      color - the border color
    • setBottomWidth

      public final void setBottomWidth(String width)
      Sets the bottom border width.
      Parameters:
      width - the border width
    • setLeftBorder

      public final void setLeftBorder(String style, String color, String width)
      Sets all properties for the left border.
      Parameters:
      style - the border style
      color - the border color
      width - the border width
    • setLeftStyle

      public final void setLeftStyle(String style)
      Sets the left border style.
      Parameters:
      style - the border style
    • setLeftColor

      public final void setLeftColor(String color)
      Sets the left border color.
      Parameters:
      color - the border color
    • setLeftWidth

      public final void setLeftWidth(String width)
      Sets the left border width.
      Parameters:
      width - the border width
    • setRightBorder

      public final void setRightBorder(String style, String color, String width)
      Sets all properties for the right border.
      Parameters:
      style - the border style
      color - the border color
      width - the border width
    • setRightStyle

      public final void setRightStyle(String style)
      Sets the right border style.
      Parameters:
      style - the border style
    • setRightColor

      public final void setRightColor(String color)
      Sets the right border color.
      Parameters:
      color - the border color
    • setRightWidth

      public final void setRightWidth(String width)
      Sets the right border width.
      Parameters:
      width - the border width
    • equals

      public boolean equals(Object object)
      Checks if this Border is equal to another object.

      Two Borders are equal if all four sides have matching style, color, and width values.

      Overrides:
      equals in class Object
      Parameters:
      object - the object to compare against
      Returns:
      true if the objects represent the same border configuration