Class EtchedBorder

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

public class EtchedBorder extends AbstractBorder
Port of EtchedBorder. Low-relief etched border (groove or ridge).

CSS border-style: groove and ridge render the same visual pattern — etched into or raised from the surface. Browsers synthesise the highlight/shadow pair from the single border-color. R_best_effort_behaviour best-effort: the hand-picked highlight / shadow constructor fields are stored for round-trip but don't influence the rendered colour (the browser picks).

See Also:
  • Field Details

  • Constructor Details

    • EtchedBorder

      public EtchedBorder()
    • EtchedBorder

      public EtchedBorder(int etchType)
    • EtchedBorder

      public EtchedBorder(Color highlight, Color shadow)
    • EtchedBorder

      public EtchedBorder(int etchType, Color highlight, Color shadow)
  • Method Details

    • getEtchType

      public int getEtchType()
    • getHighlightColor

      public Color getHighlightColor(Component c)
    • getHighlightColor

      public Color getHighlightColor()
    • getShadowColor

      public Color getShadowColor(Component c)
    • getShadowColor

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