@Override public void draw(Shape s){
  Stroke stroke=getStroke();
  if (stroke instanceof BasicStroke) {
    BasicStroke lineStroke;
    BasicStroke minLineStroke=null;
    float deviceLineWidth;
    float lineWidth;
    AffineTransform deviceTransform;
    Point2D.Float penSize;
    lineStroke=(BasicStroke)stroke;
    lineWidth=lineStroke.getLineWidth();
    penSize=new Point2D.Float(lineWidth,lineWidth);
    deviceTransform=getTransform();
    deviceTransform.deltaTransform(penSize,penSize);
    deviceLineWidth=Math.min(Math.abs(penSize.x),Math.abs(penSize.y));
    if (deviceLineWidth < MIN_DEVICE_LINEWIDTH) {
      Point2D.Float minPenSize=new Point2D.Float(MIN_DEVICE_LINEWIDTH,MIN_DEVICE_LINEWIDTH);
      try {
        AffineTransform inverse;
        float minLineWidth;
        inverse=deviceTransform.createInverse();
        inverse.deltaTransform(minPenSize,minPenSize);
        minLineWidth=Math.max(Math.abs(minPenSize.x),Math.abs(minPenSize.y));
        minLineStroke=new BasicStroke(minLineWidth,lineStroke.getEndCap(),lineStroke.getLineJoin(),lineStroke.getMiterLimit(),lineStroke.getDashArray(),lineStroke.getDashPhase());
        setStroke(minLineStroke);
      }
 catch (      NoninvertibleTransformException e) {
      }
    }
    super.draw(s);
    if (minLineStroke != null) {
      setStroke(lineStroke);
    }
  }
 else {
    super.draw(s);
  }
}

@ Override public void draw ( Shape s ) { Stroke stroke = getStroke ( ) ; if ( stroke instanceof BasicStroke ) { BasicStroke lineStroke ; BasicStroke minLineStroke = null ; float deviceLineWidth ; float lineWidth ; AffineTransform deviceTransform ; Point2D . Float penSize ; lineStroke = ( BasicStroke ) stroke ; lineWidth = lineStroke . getLineWidth ( ) ; penSize = new Point2D . Float ( lineWidth , lineWidth ) ; deviceTransform = getTransform ( ) ; deviceTransform . deltaTransform ( penSize , penSize ) ; deviceLineWidth = Math . min ( Math . abs ( penSize . x ) , Math . abs ( penSize . y ) ) ; if ( deviceLineWidth < MIN_DEVICE_LINEWIDTH ) { Point2D . Float minPenSize = new Point2D . Float ( MIN_DEVICE_LINEWIDTH , MIN_DEVICE_LINEWIDTH ) ; try { AffineTransform inverse ; float minLineWidth ; inverse = deviceTransform . createInverse ( ) ; inverse . deltaTransform ( minPenSize , minPenSize ) ; minLineWidth = Math . max ( Math . abs ( minPenSize . x ) , Math . abs ( minPenSize . y ) ) ; minLineStroke = new BasicStroke ( minLineWidth , lineStroke . getEndCap ( ) , lineStroke . getLineJoin ( ) , lineStroke . getMiterLimit ( ) , lineStroke . getDashArray ( ) , lineStroke . getDashPhase ( ) ) ; setStroke ( minLineStroke ) ; } catch ( NoninvertibleTransformException e ) { } } super . draw ( s ) ; if ( minLineStroke != null ) { setStroke ( lineStroke ) ; } } else { super . draw ( s ) ; } }
strokes the outline of a shape using the settings of the current graphics state . the rendering attributes applied include the clip , transform , paint or color , composite and stroke attributes .
