Class ValidationBorder
- java.lang.Object
-
- io.github.jonestimd.swing.validation.ValidationBorder
-
- All Implemented Interfaces:
javax.swing.border.Border
- Direct Known Subclasses:
ValidationTooltipBorder
public class ValidationBorder extends java.lang.Object implements javax.swing.border.Border
A border that indicates a validation error by displaying a red X to the right of the contained component.
-
-
Constructor Summary
Constructors Constructor Description ValidationBorder()
ValidationBorder(java.awt.Color background)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <C extends javax.swing.JComponent & ValidatedComponent>
voidaddToViewport(C component)
java.awt.Insets
getBorderInsets(java.awt.Component c)
static int
getSize(java.awt.Component c, java.awt.Graphics g, int height)
boolean
isBorderOpaque()
boolean
isValid()
void
paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
static void
paintInvalidMarker(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
static void
paintInvalidMarker(java.awt.Graphics g, int x, int y, int width, int height, int size)
void
setValid(boolean valid)
-
-
-
Method Detail
-
getBorderInsets
public java.awt.Insets getBorderInsets(java.awt.Component c)
- Specified by:
getBorderInsets
in interfacejavax.swing.border.Border
-
isBorderOpaque
public boolean isBorderOpaque()
- Specified by:
isBorderOpaque
in interfacejavax.swing.border.Border
-
isValid
public boolean isValid()
-
setValid
public void setValid(boolean valid)
-
paintBorder
public void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
- Specified by:
paintBorder
in interfacejavax.swing.border.Border
-
paintInvalidMarker
public static void paintInvalidMarker(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
-
paintInvalidMarker
public static void paintInvalidMarker(java.awt.Graphics g, int x, int y, int width, int height, int size)
-
getSize
public static int getSize(java.awt.Component c, java.awt.Graphics g, int height)
-
addToViewport
public static <C extends javax.swing.JComponent & ValidatedComponent> void addToViewport(C component)
-
-