public synchronized OMGraphicList prepare(){
  JGraphicList emptyList=new JGraphicList();
  if (isCancelled()) {
    dirtybits|=PREMATURE_FINISH;
    if (Debug.debugging("basic")) {
      Debug.output(getName() + "|CSpecLayer.prepare(): aborted.");
    }
    return emptyList;
  }
  if (Debug.debugging("basic")) {
    Debug.output(getName() + "|CSpecLayer.prepare(): doing it");
  }
  dirtybits=0;
  setAcceptingEvents(false);
  Projection projection=getProjection();
  UGraphic[] specGraphics=getSpecGraphics(projection);
  if (isCancelled()) {
    dirtybits|=PREMATURE_FINISH;
    if (Debug.debugging("basic"))     Debug.output(getName() + "|CSpecLayer.prepare(): " + "aborted during/after getRectangle().");
    return emptyList;
  }
  if (specGraphics == null) {
    return emptyList;
  }
  long start=System.currentTimeMillis();
  JGraphicList graphics=createGraphicsList(specGraphics,projection);
  long stop=System.currentTimeMillis();
  if (Debug.debugging("cspec")) {
    Debug.output(getName() + "|CSpecLayer.prepare(): generated " + specGraphics.length+ " graphics in "+ ((stop - start) / 1000d)+ " seconds.");
  }
  if (isCancelled()) {
    dirtybits|=PREMATURE_FINISH;
    if (Debug.debugging("basic")) {
      Debug.output(getName() + "|CSpecLayer.prepare(): " + "aborted while generating graphics.");
    }
    return emptyList;
  }
  if (Debug.debugging("basic")) {
    Debug.output(getName() + "|CSpecLayer.prepare(): finished preparing " + graphics.size()+ " graphics");
  }
  setAcceptingEvents(true);
  return graphics;
}

public synchronized OMGraphicList prepare ( ) { JGraphicList emptyList = new JGraphicList ( ) ; if ( isCancelled ( ) ) { dirtybits |= PREMATURE_FINISH ; if ( Debug . debugging ( "basic" ) ) { Debug . output ( getName ( ) + "|CSpecLayer.prepare(): aborted." ) ; } return emptyList ; } if ( Debug . debugging ( "basic" ) ) { Debug . output ( getName ( ) + "|CSpecLayer.prepare(): doing it" ) ; } dirtybits = 0 ; setAcceptingEvents ( false ) ; Projection projection = getProjection ( ) ; UGraphic [ ] specGraphics = getSpecGraphics ( projection ) ; if ( isCancelled ( ) ) { dirtybits |= PREMATURE_FINISH ; if ( Debug . debugging ( "basic" ) ) Debug . output ( getName ( ) + "|CSpecLayer.prepare(): " + "aborted during/after getRectangle()." ) ; return emptyList ; } if ( specGraphics == null ) { return emptyList ; } long start = System . currentTimeMillis ( ) ; JGraphicList graphics = createGraphicsList ( specGraphics , projection ) ; long stop = System . currentTimeMillis ( ) ; if ( Debug . debugging ( "cspec" ) ) { Debug . output ( getName ( ) + "|CSpecLayer.prepare(): generated " + specGraphics . length + " graphics in " + ( ( stop - start ) / 1000d ) + " seconds." ) ; } if ( isCancelled ( ) ) { dirtybits |= PREMATURE_FINISH ; if ( Debug . debugging ( "basic" ) ) { Debug . output ( getName ( ) + "|CSpecLayer.prepare(): " + "aborted while generating graphics." ) ; } return emptyList ; } if ( Debug . debugging ( "basic" ) ) { Debug . output ( getName ( ) + "|CSpecLayer.prepare(): finished preparing " + graphics . size ( ) + " graphics" ) ; } setAcceptingEvents ( true ) ; return graphics ; }
prepares the graphics for the layer . < p > occasionally it is necessary to abort a prepare call . when this happens , the doprepare ( ) call will set the cancel bit on the swingworker . the worker will get restarted after it finishes doing its cleanup .
