Class CompoundBorder

java.lang.Object
vaadinx.swing.border.AbstractBorder
vaadinx.swing.border.CompoundBorder
All Implemented Interfaces:
Serializable, Border

public class CompoundBorder extends AbstractBorder
Port of CompoundBorder. Stacks an "outside" and "inside" border so they paint concentrically.

The common migration pattern is CompoundBorder(LineBorder, EmptyBorder) — outer frame + inner padding — which maps cleanly to CSS: outer's border plus inner's insets as additional padding. That shape works pixel-for-pixel in the browser.

CompoundBorder(LineBorder, LineBorder) (two concentric stroked frames) has no single-element CSS equivalent; we render the outer line correctly and add the inner's insets as padding so layouts reserve the right space — the inner line itself doesn't render. R_best_effort_behaviour accepted gap; revisit if migration targets actually use stacked lines.

See Also:
  • Field Details

    • outsideBorder

      protected final Border outsideBorder
    • insideBorder

      protected final Border insideBorder
  • Constructor Details

    • CompoundBorder

      public CompoundBorder()
    • CompoundBorder

      public CompoundBorder(Border outsideBorder, Border insideBorder)
  • Method Details

    • getOutsideBorder

      public Border getOutsideBorder()
    • getInsideBorder

      public Border getInsideBorder()
    • getBorderInsets

      public Insets getBorderInsets(Component c)
      Specified by:
      getBorderInsets in interface Border
      Overrides:
      getBorderInsets in class AbstractBorder
    • isBorderOpaque

      public boolean isBorderOpaque()
      Specified by:
      isBorderOpaque in interface Border
      Overrides:
      isBorderOpaque in class AbstractBorder
    • 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 AbstractBorder