View | Details | Raw Unified | Return to bug 63360
Collapse All | Expand All

(-)a/jsyntaxpane/src/main/java/jsyntaxpane/SyntaxView.java (-2 / +9 lines)
Lines 24-34 import java.util.Iterator; Link Here
24
import java.util.Map;
24
import java.util.Map;
25
import java.util.logging.Level;
25
import java.util.logging.Level;
26
import java.util.logging.Logger;
26
import java.util.logging.Logger;
27
27
import javax.swing.text.BadLocationException;
28
import javax.swing.text.BadLocationException;
29
import javax.swing.text.Document;
28
import javax.swing.text.Element;
30
import javax.swing.text.Element;
29
import javax.swing.text.PlainView;
31
import javax.swing.text.PlainView;
30
import javax.swing.text.Segment;
32
import javax.swing.text.Segment;
31
import javax.swing.text.ViewFactory;
33
import javax.swing.text.ViewFactory;
34
32
import jsyntaxpane.util.Configuration;
35
import jsyntaxpane.util.Configuration;
33
36
34
public class SyntaxView extends PlainView {
37
public class SyntaxView extends PlainView {
Lines 61-71 public class SyntaxView extends PlainView { Link Here
61
64
62
    @Override
65
    @Override
63
    protected int drawUnselectedText(Graphics graphics, int x, int y, int p0,
66
    protected int drawUnselectedText(Graphics graphics, int x, int y, int p0,
64
            int p1) {
67
            int p1) throws BadLocationException {
65
        setRenderingHits((Graphics2D) graphics);
68
        setRenderingHits((Graphics2D) graphics);
66
        Font saveFont = graphics.getFont();
69
        Font saveFont = graphics.getFont();
67
        Color saveColor = graphics.getColor();
70
        Color saveColor = graphics.getColor();
68
        SyntaxDocument doc = (SyntaxDocument) getDocument();
71
        Document document = getDocument();
72
        if (!(document instanceof SyntaxDocument)) {
73
            return super.drawUnselectedText(graphics, x, y, p0, p1);
74
        }
75
        SyntaxDocument doc = (SyntaxDocument) document;
69
        Segment segment = getLineBuffer();
76
        Segment segment = getLineBuffer();
70
        // Draw the right margin first, if needed.  This way the text overlays
77
        // Draw the right margin first, if needed.  This way the text overlays
71
        // the margin
78
        // the margin

Return to bug 63360