Class MatteBorder

All Implemented Interfaces:
Serializable, Border

public class MatteBorder extends EmptyBorder
Port of MatteBorder. Per-side coloured border (LineBorder with independent widths on each side) or tile-filled border (via Icon).

The (top, left, bottom, right, Color) ctor is the common case and maps cleanly to per-side CSS border-top/right/bottom/left. The Icon form has no simple CSS analogue — our ctor accepts it for API parity but logs a WARN on install and falls back to a plain-insets EmptyBorder-equivalent rendering until icon rendering lands.

See Also:
  • Field Details

    • color

      protected final Color color
    • tileIcon

      protected final Icon tileIcon
  • Constructor Details

    • MatteBorder

      public MatteBorder(int top, int left, int bottom, int right, Color matteColor)
    • MatteBorder

      public MatteBorder(Insets borderInsets, Color matteColor)
    • MatteBorder

      public MatteBorder(int top, int left, int bottom, int right, Icon tileIcon)
    • MatteBorder

      public MatteBorder(Insets borderInsets, Icon tileIcon)
    • MatteBorder

      public MatteBorder(Icon tileIcon)
  • Method Details

    • getMatteColor

      public Color getMatteColor()
    • getTileIcon

      public Icon getTileIcon()
    • isBorderOpaque

      public boolean isBorderOpaque()
      Specified by:
      isBorderOpaque in interface Border
      Overrides:
      isBorderOpaque in class EmptyBorder
    • applyCss

      public void applyCss(com.vaadin.flow.dom.Element element)
      Description copied from class: AbstractBorder
      Write this border's CSS onto the target element. Called by JComponent.setBorder(Border). Concrete border classes override to emit the CSS that represents them (padding for EmptyBorder, border for LineBorder, per-side for MatteBorder, …). The base implementation clears any previously-installed border CSS via AbstractBorder.clearBorderCss(Element) and writes nothing, which is the honest behaviour for a user-authored custom AbstractBorder that didn't override this hook.

      Typical override: clearBorderCss(e); set("border", …);. Always clear first so a previous border's keys don't linger.

      Overrides:
      applyCss in class EmptyBorder