Class CompoundBorder
java.lang.Object
vaadinx.swing.border.AbstractBorder
vaadinx.swing.border.CompoundBorder
- All Implemented Interfaces:
Serializable, Border
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyCss(com.vaadin.flow.dom.Element element) Write this border's CSS onto the target element.booleanMethods inherited from class AbstractBorder
clearBorderCss, getBorderInsets, paintBorder
-
Field Details
-
outsideBorder
-
insideBorder
-
-
Constructor Details
-
CompoundBorder
public CompoundBorder() -
CompoundBorder
-
-
Method Details
-
getOutsideBorder
-
getInsideBorder
-
getBorderInsets
- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder
-
isBorderOpaque
public boolean isBorderOpaque()- Specified by:
isBorderOpaquein interfaceBorder- Overrides:
isBorderOpaquein classAbstractBorder
-
applyCss
public void applyCss(com.vaadin.flow.dom.Element element) Description copied from class:AbstractBorderWrite this border's CSS onto the target element. Called byJComponent.setBorder(Border). Concrete border classes override to emit the CSS that represents them (padding for EmptyBorder,borderfor LineBorder, per-side for MatteBorder, …). The base implementation clears any previously-installed border CSS viaAbstractBorder.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:
applyCssin classAbstractBorder
-