protected void writeStroke(Stroke stroke) throws IOException {
  if (stroke instanceof BasicStroke) {
    BasicStroke ns=(BasicStroke)stroke;
    int currentCap=-1, currentJoin=-1;
    float currentWidth=-1, currentLimit=-1, currentDashPhase=-1;
    float[] currentDashArray=null;
    if ((currentStroke != null) && (currentStroke instanceof BasicStroke)) {
      BasicStroke cs=(BasicStroke)currentStroke;
      currentCap=cs.getEndCap();
      currentJoin=cs.getLineJoin();
      currentWidth=cs.getLineWidth();
      currentLimit=cs.getMiterLimit();
      currentDashArray=cs.getDashArray();
      currentDashPhase=cs.getDashPhase();
    }
    float width=ns.getLineWidth();
    writeWidth(width);
    int cap=ns.getEndCap();
    if (currentCap != cap) {
      writeCap(cap);
    }
    int join=ns.getLineJoin();
    if (currentJoin != join) {
      writeJoin(join);
    }
    float limit=ns.getMiterLimit();
    if ((currentLimit != limit) && (limit >= 1.0f)) {
      writeMiterLimit(limit);
    }
    if (ns.getDashArray() != null) {
      writeDash(ns.getDashArray(),ns.getDashPhase());
    }
 else {
      writeDash(new float[0],ns.getDashPhase());
    }
  }
}

protected void writeStroke ( Stroke stroke ) throws IOException { if ( stroke instanceof BasicStroke ) { BasicStroke ns = ( BasicStroke ) stroke ; int currentCap = - 1 , currentJoin = - 1 ; float currentWidth = - 1 , currentLimit = - 1 , currentDashPhase = - 1 ; float [ ] currentDashArray = null ; if ( ( currentStroke != null ) && ( currentStroke instanceof BasicStroke ) ) { BasicStroke cs = ( BasicStroke ) currentStroke ; currentCap = cs . getEndCap ( ) ; currentJoin = cs . getLineJoin ( ) ; currentWidth = cs . getLineWidth ( ) ; currentLimit = cs . getMiterLimit ( ) ; currentDashArray = cs . getDashArray ( ) ; currentDashPhase = cs . getDashPhase ( ) ; } float width = ns . getLineWidth ( ) ; writeWidth ( width ) ; int cap = ns . getEndCap ( ) ; if ( currentCap != cap ) { writeCap ( cap ) ; } int join = ns . getLineJoin ( ) ; if ( currentJoin != join ) { writeJoin ( join ) ; } float limit = ns . getMiterLimit ( ) ; if ( ( currentLimit != limit ) && ( limit >= 1.0f ) ) { writeMiterLimit ( limit ) ; } if ( ns . getDashArray ( ) != null ) { writeDash ( ns . getDashArray ( ) , ns . getDashPhase ( ) ) ; } else { writeDash ( new float [ 0 ] , ns . getDashPhase ( ) ) ; } } }
writes the current stroke . if stroke is an instance of basicstroke it will call writewidth , writecap , writejoin , writemiterlimit and writedash , if any were different than the current stroke .
