/** * Scales the line width for the specified graphics context. * Classes that extend this base class should not assume that the * current line width is one, because the line width may have been * set to a larger value in any graphics context created by * {@link #createGraphics(java.awt.Graphics2D,int,int,int,int)}. * @param g2d the graphics context. * @param scale the scale factor. */ protected void scaleLineWidth(Graphics2D g2d, double scale) { float lineWidth = getLineWidth(g2d); lineWidth *= scale; g2d.setStroke(new BasicStroke(lineWidth)); } }