Class LineBorder
java.lang.Object
vaadinx.swing.border.AbstractBorder
vaadinx.swing.border.LineBorder
- All Implemented Interfaces:
Serializable, Border
Port of
LineBorder. Solid rectangular border
around the component. Optional rounded corners.
CSS mapping: border: <thickness>px solid <color> plus a
border-radius when rounded — close-enough to Swing's paint output for
R_best_effort_behaviour best-effort. Thick line borders render identically in both stacks;
the difference is inner-pixel-perfect anti-aliasing, which R_layouts_close_enough carves out.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Colorprotected final booleanprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionLineBorder(Color color) LineBorder(Color color, int thickness) LineBorder(Color color, int thickness, boolean roundedCorners) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyCss(com.vaadin.flow.dom.Element element) Write this border's CSS onto the target element.static LineBorderstatic LineBordergetBorderInsets(Component c, Insets target) Fill-the-arg variant of getBorderInsets — concrete borders override when they want to avoid the Insets allocation.booleanintbooleanMethods inherited from class AbstractBorder
clearBorderCss, paintBorder
-
Field Details
-
lineColor
-
thickness
protected final int thickness -
roundedCorners
protected final boolean roundedCorners
-
-
Constructor Details
-
LineBorder
-
LineBorder
-
LineBorder
-
-
Method Details
-
getLineColor
-
getThickness
public int getThickness() -
getRoundedCorners
public boolean getRoundedCorners() -
getBorderInsets
- Specified by:
getBorderInsetsin interfaceBorder- Overrides:
getBorderInsetsin classAbstractBorder
-
getBorderInsets
Description copied from class:AbstractBorderFill-the-arg variant of getBorderInsets — concrete borders override when they want to avoid the Insets allocation. Default readsAbstractBorder.getBorderInsets(vaadinx.awt.Component)and copies.- 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
-
createBlackLineBorder
-
createGrayLineBorder
-