Package com.oorian.css
Class Border
java.lang.Object
com.oorian.css.Border
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this Border is equal to another object.final voidsetBottomBorder(String style, String color, String width) Sets all properties for the bottom border.final voidsetBottomColor(String color) Sets the bottom border color.final voidsetBottomStyle(String style) Sets the bottom border style.final voidsetBottomWidth(String width) Sets the bottom border width.final voidSets the color for all four sides.final voidsetLeftBorder(String style, String color, String width) Sets all properties for the left border.final voidsetLeftColor(String color) Sets the left border color.final voidsetLeftStyle(String style) Sets the left border style.final voidsetLeftWidth(String width) Sets the left border width.final voidsetRightBorder(String style, String color, String width) Sets all properties for the right border.final voidsetRightColor(String color) Sets the right border color.final voidsetRightStyle(String style) Sets the right border style.final voidsetRightWidth(String width) Sets the right border width.final voidSets the style for all four sides.final voidsetTopBorder(String style, String color, String width) Sets all properties for the top border.final voidsetTopColor(String color) Sets the top border color.final voidsetTopStyle(String style) Sets the top border style.final voidsetTopWidth(String width) Sets the top border width.final voidSets the width for all four sides.
-
Constructor Details
-
Border
public Border()Constructs a Border with no properties set. -
Border
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
Constructs a Border by copying another Border instance.- Parameters:
border- the Border to copy, or null for empty border
-
-
Method Details
-
setStyle
Sets the style for all four sides.- Parameters:
style- the border style (e.g., "solid", "dashed")
-
setColor
Sets the color for all four sides.- Parameters:
color- the border color (e.g., "#000000", "red")
-
setWidth
Sets the width for all four sides.- Parameters:
width- the border width (e.g., "1px", "2em")
-
setTopBorder
Sets all properties for the top border.- Parameters:
style- the border stylecolor- the border colorwidth- the border width
-
setTopStyle
Sets the top border style.- Parameters:
style- the border style
-
setTopColor
Sets the top border color.- Parameters:
color- the border color
-
setTopWidth
Sets the top border width.- Parameters:
width- the border width
-
setBottomBorder
Sets all properties for the bottom border.- Parameters:
style- the border stylecolor- the border colorwidth- the border width
-
setBottomStyle
Sets the bottom border style.- Parameters:
style- the border style
-
setBottomColor
Sets the bottom border color.- Parameters:
color- the border color
-
setBottomWidth
Sets the bottom border width.- Parameters:
width- the border width
-
setLeftBorder
Sets all properties for the left border.- Parameters:
style- the border stylecolor- the border colorwidth- the border width
-
setLeftStyle
Sets the left border style.- Parameters:
style- the border style
-
setLeftColor
Sets the left border color.- Parameters:
color- the border color
-
setLeftWidth
Sets the left border width.- Parameters:
width- the border width
-
setRightBorder
Sets all properties for the right border.- Parameters:
style- the border stylecolor- the border colorwidth- the border width
-
setRightStyle
Sets the right border style.- Parameters:
style- the border style
-
setRightColor
Sets the right border color.- Parameters:
color- the border color
-
setRightWidth
Sets the right border width.- Parameters:
width- the border width
-
equals
Checks if this Border is equal to another object.Two Borders are equal if all four sides have matching style, color, and width values.
-