APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.text.html

pack-priv Class CSSBorder

extends AbstractBorder
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.awt.Color, .Component, .Graphics, .Graphics2D, .Insets, .Polygon, .Rectangle, .Shape, java.util.HashMap, .Map, javax.swing.border.AbstractBorder, javax.swing.text.AttributeSet, .View, javax.swing.text.html.CSS.Attribute, .CSS.BorderStyle, .CSS.BorderWidthValue, .CSS.ColorValue, .CSS.CssValue, .CSS.LengthValue, .CSS.Value

CSS-style borders for HTML elements.
Author
Sergey Groznyh

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
pack-priv static class
CSSBorder.DottedDashedPainter

Painter for the "dotted" and "dashed" CSS border styles.

pack-priv static class
CSSBorder.DoublePainter

Painter for the "double" CSS border style.

pack-priv static class
CSSBorder.GrooveRidgePainter

Painter for the "groove" and "ridge" CSS border styles.

pack-priv static class
CSSBorder.InsetOutsetPainter

Painter for the "inset" and "outset" CSS border styles.

pack-priv static class
CSSBorder.NullPainter

Painter for the "none" and "hidden" CSS border styles.

pack-priv abstract static class
CSSBorder.ShadowLightPainter

Painter that defines colors for "shadow" and "light" border sides.

pack-priv static class
CSSBorder.SolidPainter

Painter for the "solid" CSS border style.

pack-priv abstract static class
CSSBorder.StrokePainter

Defines a method for painting strokes in the specified direction using the given length and color patterns.

Field Summary

Modifier and TypeField and Description
pack-priv static final CSS.Attribute[][]
ATTRIBUTES

The attribute groups.

pack-priv final AttributeSet
attrs

Attribute set containing border properties.

pack-priv static Map<CSS.Value, CSSBorder.BorderPainter>
borderPainters

Map the border style values to the border painter objects.

pack-priv static final int
BOTTOM

Indices for the box sides within the attribute group.

pack-priv static final int
COLOR

Indices for the attribute groups.

pack-priv static final Object[]
DEFAULTS

Default values for the border properties.

pack-priv static final int
LEFT

Indices for the box sides within the attribute group.

pack-priv static final CSS.CssValue[]
PARSERS

Parsers for the border properties.

pack-priv static final int
RIGHT

Indices for the box sides within the attribute group.

pack-priv static final int
STYLE

Indices for the attribute groups.

pack-priv static final int
TOP

Indices for the box sides within the attribute group.

pack-priv static final int
WIDTH

Indices for the attribute groups.

Constructor Summary

AccessConstructor and Description
pack-priv
CSSBorder(AttributeSet attrs)

Initialize the attribute set.

Method Summary

Modifier and TypeMethod and Description
pack-priv static Color
getAdjustedColor(Color c, double factor)

Return the color with brightness adjusted by the specified factor.

private Color
getBorderColor(int side)

Return the border color for the given side.

public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Reinitializes the insets parameter with this Border's current Insets.

private CSSBorder.BorderPainter
getBorderPainter(int side)

Return the border painter appropriate for the given side.

private Polygon
getBorderShape(int side)

Return border shape for side as if the border has zero interior length.

private CSS.Value
getBorderStyle(int side)

Return the border style for the given side.

private int
getBorderWidth(int side)

Return the border width for the given side.

private int[]
getWidths()

Return an array of border widths in the TOP, RIGHT, BOTTOM, LEFT order.

public void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

This default implementation does no painting.

pack-priv static void
registerBorderPainter(CSS.Value style, CSSBorder.BorderPainter painter)

Add the specified painter to the painters map.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisBorderOpaque

Field Detail

ATTRIBUTESback to summary
pack-priv static final CSS.Attribute[][] ATTRIBUTES

The attribute groups.

attrsback to summary
pack-priv final AttributeSet attrs

Attribute set containing border properties.

borderPaintersback to summary
pack-priv static Map<CSS.Value, CSSBorder.BorderPainter> borderPainters

Map the border style values to the border painter objects.

BOTTOMback to summary
pack-priv static final int BOTTOM

Indices for the box sides within the attribute group.

COLORback to summary
pack-priv static final int COLOR

Indices for the attribute groups.

DEFAULTSback to summary
pack-priv static final Object[] DEFAULTS

Default values for the border properties.

LEFTback to summary
pack-priv static final int LEFT

Indices for the box sides within the attribute group.

PARSERSback to summary
pack-priv static final CSS.CssValue[] PARSERS

Parsers for the border properties.

STYLEback to summary
pack-priv static final int STYLE

Indices for the attribute groups.

TOPback to summary
pack-priv static final int TOP

Indices for the box sides within the attribute group.

WIDTHback to summary
pack-priv static final int WIDTH

Indices for the attribute groups.

Constructor Detail

CSSBorderback to summary
pack-priv CSSBorder(AttributeSet attrs)

Initialize the attribute set.

Method Detail

getAdjustedColorback to summary
pack-priv static Color getAdjustedColor(Color c, double factor)

Return the color with brightness adjusted by the specified factor. The factor values are between 0.0 (no change) and 1.0 (turn into white). Negative factor values decrease brightness (ie, 1.0 turns into black).

getBorderColorback to summary
private Color getBorderColor(int side)

Return the border color for the given side.

getBorderInsetsback to summary
public Insets getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

Reinitializes the insets parameter with this Border's current Insets.

getBorderPainterback to summary
private CSSBorder.BorderPainter getBorderPainter(int side)

Return the border painter appropriate for the given side.

getBorderShapeback to summary
private Polygon getBorderShape(int side)

Return border shape for side as if the border has zero interior length. Shape start is at (0,0); points are added clockwise.

getBorderStyleback to summary
private CSS.Value getBorderStyle(int side)

Return the border style for the given side.

getBorderWidthback to summary
private int getBorderWidth(int side)

Return the border width for the given side.

getWidthsback to summary
private int[] getWidths()

Return an array of border widths in the TOP, RIGHT, BOTTOM, LEFT order.

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

registerBorderPainterback to summary
pack-priv static void registerBorderPainter(CSS.Value style, CSSBorder.BorderPainter painter)

Add the specified painter to the painters map.

javax.swing.text.html back to summary

pack-priv Interface CSSBorder.BorderPainter

Known Direct Implementers
javax.swing.text.html.CSSBorder.NullPainter, javax.swing.text.html.CSSBorder.SolidPainter, javax.swing.text.html.CSSBorder.StrokePainter

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.DottedDashedPainter

extends StrokePainter
Class Inheritance

Painter for the "dotted" and "dashed" CSS border styles.

Field Summary

Modifier and TypeField and Description
pack-priv final int

Constructor Summary

AccessConstructor and Description
pack-priv
DottedDashedPainter(int factor)

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from javax.swing.text.html.CSSBorder.StrokePainter:
paintStrokes

Field Detail

factorback to summary
pack-priv final int factor

Constructor Detail

DottedDashedPainterback to summary
pack-priv DottedDashedPainter(int factor)

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.DoublePainter

extends StrokePainter
Class Inheritance

Painter for the "double" CSS border style.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from javax.swing.text.html.CSSBorder.StrokePainter:
paintStrokes

Constructor Detail

DoublePainterback to summary
pack-priv DoublePainter()

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.GrooveRidgePainter

extends ShadowLightPainter
Class Inheritance

Painter for the "groove" and "ridge" CSS border styles.

Field Summary

Modifier and TypeField and Description
pack-priv final CSS.Value

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from javax.swing.text.html.CSSBorder.ShadowLightPainter:
getLightColorgetShadowColor

Field Detail

typeback to summary
pack-priv final CSS.Value type

Constructor Detail

GrooveRidgePainterback to summary
pack-priv GrooveRidgePainter(CSS.Value type)

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.InsetOutsetPainter

extends ShadowLightPainter
Class Inheritance

Painter for the "inset" and "outset" CSS border styles.

Field Summary

Modifier and TypeField and Description
pack-priv CSS.Value

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from javax.swing.text.html.CSSBorder.ShadowLightPainter:
getLightColorgetShadowColor

Field Detail

typeback to summary
pack-priv CSS.Value type

Constructor Detail

InsetOutsetPainterback to summary
pack-priv InsetOutsetPainter(CSS.Value type)

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.NullPainter

extends Object
implements BorderPainter
Class Inheritance
All Implemented Interfaces
javax.swing.text.html.CSSBorder.BorderPainter

Painter for the "none" and "hidden" CSS border styles.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

NullPainterback to summary
pack-priv NullPainter()

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv abstract Class CSSBorder.ShadowLightPainter

extends StrokePainter
Class Inheritance
Known Direct Subclasses
javax.swing.text.html.CSSBorder.GrooveRidgePainter, javax.swing.text.html.CSSBorder.InsetOutsetPainter

Painter that defines colors for "shadow" and "light" border sides.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static Color
getLightColor(Color c)

Return the "light" border side color.

pack-priv static Color
getShadowColor(Color c)

Return the "shadow" border side color.

Inherited from javax.swing.text.html.CSSBorder.StrokePainter:
paintStrokes

Constructor Detail

ShadowLightPainterback to summary
pack-priv ShadowLightPainter()

Method Detail

getLightColorback to summary
pack-priv static Color getLightColor(Color c)

Return the "light" border side color.

getShadowColorback to summary
pack-priv static Color getShadowColor(Color c)

Return the "shadow" border side color.

javax.swing.text.html back to summary

pack-priv Class CSSBorder.SolidPainter

extends Object
implements BorderPainter
Class Inheritance
All Implemented Interfaces
javax.swing.text.html.CSSBorder.BorderPainter

Painter for the "solid" CSS border style.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SolidPainterback to summary
pack-priv SolidPainter()

Method Detail

paintback to summary
public void paint(Polygon shape, Graphics g, Color color, int side)

Implements javax.swing.text.html.CSSBorder.BorderPainter.paint.

Doc from javax.swing.text.html.CSSBorder.BorderPainter.paint.

The painter should paint the border as if it were at the top and the coordinates of the NW corner of the interior area is (0, 0). The caller is responsible for the appropriate affine transformations. Clip is set by the caller to the exact border shape so it's safe to simply draw into the shape's bounding rectangle.

javax.swing.text.html back to summary

pack-priv abstract Class CSSBorder.StrokePainter

extends Object
implements BorderPainter
Class Inheritance
All Implemented Interfaces
javax.swing.text.html.CSSBorder.BorderPainter
Known Direct Subclasses
javax.swing.text.html.CSSBorder.DoublePainter, javax.swing.text.html.CSSBorder.DottedDashedPainter, javax.swing.text.html.CSSBorder.ShadowLightPainter

Defines a method for painting strokes in the specified direction using the given length and color patterns.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
paintStrokes(Rectangle r, Graphics g, int axis, int[] lengthPattern, Color[] colorPattern)

Paint strokes repeatedly using the given length and color patterns.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

StrokePainterback to summary
pack-priv StrokePainter()

Method Detail

paintStrokesback to summary
pack-priv void paintStrokes(Rectangle r, Graphics g, int axis, int[] lengthPattern, Color[] colorPattern)

Paint strokes repeatedly using the given length and color patterns.