A Painter that paints java.awt.Shapes. It uses a stroke and a fillPaint to do so. The shape is painted as is, at a specific location. If no Shape is specified, nothing will be painted. If no stroke is specified, the default for the Graphics2D will be used. If no fillPaint is specified, the component background color will be used. The shape can be positioned using the insets, horizontal, and vertical properties.
Here is an example that draws a rectangle aligned on the center right:
Rectangle2D.Double rect = new Rectangle2D.Double(0, 0, 50, 50); ShapePainter p = new ShapePainter(rect); p.setHorizontal(HorizontalAlignment.RIGHT); p.setVertical(VerticalAlignment.CENTER);
@author rbair
|
|
|
|