private synchronized boolean isPaintingThread(){
  return (Thread.currentThread() == paintThread);
}

private synchronized boolean isPaintingThread ( ) { return ( Thread . currentThread ( ) == paintThread ) ; }
returns true if the current thread is the thread painting . this will return false if no threads are painting .
