Class BevelBorder

java.lang.Object
vaadinx.swing.border.AbstractBorder
vaadinx.swing.border.BevelBorder
All Implemented Interfaces:
Serializable, Border
Direct Known Subclasses:
SoftBevelBorder

public class BevelBorder extends AbstractBorder
Port of BevelBorder. Two-pixel raised or lowered bevel around the component.

CSS has direct border-style: inset and outset keywords that render the same visual cue the Swing bevel draws — the browser automatically derives lighter/darker shades from the border color, so we don't need to separately wire the highlight/shadow colours. Best-effort per R_best_effort_behaviour; exact highlight/shadow control is dropped (fields stored for round-trip).

See Also:
  • Field Details

    • RAISED

      public static final int RAISED
      See Also:
    • LOWERED

      public static final int LOWERED
      See Also:
    • bevelType

      protected int bevelType
    • highlightOuter

      protected Color highlightOuter
    • highlightInner

      protected Color highlightInner
    • shadowInner

      protected Color shadowInner
    • shadowOuter

      protected Color shadowOuter
  • Constructor Details

    • BevelBorder

      public BevelBorder(int bevelType)
    • BevelBorder

      public BevelBorder(int bevelType, Color highlight, Color shadow)
    • BevelBorder

      public BevelBorder(int bevelType, Color highlightOuterColor, Color highlightInnerColor, Color shadowOuterColor, Color shadowInnerColor)
  • Method Details

    • getBevelType

      public int getBevelType()
    • getHighlightOuterColor

      public Color getHighlightOuterColor(Component c)
    • getHighlightInnerColor

      public Color getHighlightInnerColor(Component c)
    • getShadowOuterColor

      public Color getShadowOuterColor(Component c)
    • getShadowInnerColor

      public Color getShadowInnerColor(Component c)
    • getHighlightOuterColor

      public Color getHighlightOuterColor()
    • getHighlightInnerColor

      public Color getHighlightInnerColor()
    • getShadowOuterColor

      public Color getShadowOuterColor()
    • getShadowInnerColor

      public Color getShadowInnerColor()
    • 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