Package com.bric.plaf
Class PlafPaintUtils
- java.lang.Object
-
- com.bric.plaf.PlafPaintUtils
-
public class PlafPaintUtils extends java.lang.Object
Some static methods for some common painting functions.
-
-
Constructor Summary
Constructors Constructor Description PlafPaintUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
drawBevel(java.awt.Graphics2D g, java.awt.Rectangle r)
Uses translucent shades of white and black to draw highlights and shadows around a rectangle, and then frames the rectangle with a shade of gray (120).static java.awt.TexturePaint
getCheckerBoard(int checkerSize)
static java.awt.Color
getFocusRingColor()
static void
paintFocus(java.awt.Graphics2D g, java.awt.Shape shape, int pixelSize)
Paints 3 different strokes around a shape to indicate focus.
-
-
-
Method Detail
-
getFocusRingColor
public static java.awt.Color getFocusRingColor()
- Returns:
- the color used to indicate when a component has
focus. By default this uses the color (64,113,167), but you can
override this by calling:
UIManager.put("focusRing",customColor);
-
paintFocus
public static void paintFocus(java.awt.Graphics2D g, java.awt.Shape shape, int pixelSize)
Paints 3 different strokes around a shape to indicate focus. The widest stroke is the most transparent, so this achieves a nice "glow" effect.The catch is that you have to render this underneath the shape, and the shape should be filled completely.
- Parameters:
g
- the graphics to paint toshape
- the shape to outlinepixelSize
- the number of pixels the outline should cover.
-
drawBevel
public static void drawBevel(java.awt.Graphics2D g, java.awt.Rectangle r)
Uses translucent shades of white and black to draw highlights and shadows around a rectangle, and then frames the rectangle with a shade of gray (120).This should be called to add a finishing touch on top of existing graphics.
- Parameters:
g
- the graphics to paint to.r
- the rectangle to paint.
-
getCheckerBoard
public static java.awt.TexturePaint getCheckerBoard(int checkerSize)
-
-