SyntaxDocument syntaxDocument; TokenMarker tokenMarker;  Document document = getDocument();  if(document instanceof SyntaxDocument) { syntaxDocument = (SyntaxDocument)document; tokenMarker = syntaxDocument.getTokenMarker(); } else { syntaxDocument = null; tokenMarker = null; }
SyntaxDocument document = (SyntaxDocument)getDocument(); TokenMarker tokenMarker = document.getTokenMarker();
	public void drawLine(int lineIndex, Graphics g, int x, int y)	{		SyntaxDocument syntaxDocument;		TokenMarker tokenMarker;		Document document = getDocument();		if(document instanceof SyntaxDocument)		{			syntaxDocument = (SyntaxDocument)document;			tokenMarker = syntaxDocument.getTokenMarker();		}		else		{			syntaxDocument = null;			tokenMarker = null;		}		FontMetrics metrics = g.getFontMetrics();		Color def = getDefaultColor();		try		{			Element lineElement = getElement()				.getElement(lineIndex);			int start = lineElement.getStartOffset();			int end = lineElement.getEndOffset();			document.getText(start,end - (start + 1),line);			if(tokenMarker == null)			{				g.setColor(def);				Utilities.drawTabbedText(line,x,y,g,this,0);			}			else			{				paintSyntaxLine(line,lineIndex,x,y,g,					syntaxDocument,tokenMarker,def);				if(tokenMarker.isNextLineRequested())					forceRepaint(g,x,y);			}		}		catch(BadLocationException bl)		{			// shouldn't happen			bl.printStackTrace();		}	}