Convenience class for drawing colored Shapes.
It's basically nothing else than a {@link BasicStroke}, that has also a {@link Color} attribute.
Usage:
Graphics2D painter; ... Pen pen = new Pen(); ... pen.apply(painter); To ease up the usage, there a also predefined PenStyles:
- {@link PenStyle#DashDotDotLine}
- {@link PenStyle#DashDotLine}
- {@link PenStyle#DashLine}
- {@link PenStyle#DotLine}
- {@link PenStyle#SolidLine}
which can be used by calling the factory method {@link #getPen(PenStyle)} like this:
Graphics2D painter; ... Pen pen = Pen.getPen(PenStyle.DashDotDotLine); ... pen.apply(painter);
@author Philipp Eichhorn