Documentation of 'org.gjt.sp.jedit.syntax.SyntaxView' Java class
SyntaxView
org.gjt.sp.jedit.syntax

Class SyntaxView

  • All Implemented Interfaces:
    javax.swing.SwingConstants, javax.swing.text.TabExpander


    public class SyntaxView
    extends javax.swing.text.PlainView
    A Swing view implementation that colorizes lines of a SyntaxDocument using a TokenMarker.

    This class should not be used directly; a SyntaxEditorKit should be used instead.

    • Field Summary

      • Fields inherited from class javax.swing.text.View

        BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
      • Fields inherited from interface javax.swing.SwingConstants

        BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
    • Constructor Summary

      Constructors 
      Constructor and Description
      SyntaxView(javax.swing.text.Element elem)
      Creates a new SyntaxView for painting the specified element.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void drawLine(int lineIndex, java.awt.Graphics g, int x, int y)
      Paints the specified line.
      • Methods inherited from class javax.swing.text.PlainView

        changedUpdate, getPreferredSpan, insertUpdate, modelToView, nextTabStop, paint, removeUpdate, setSize, viewToModel
      • Methods inherited from class javax.swing.text.View

        append, breakView, createFragment, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, viewToModel
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SyntaxView

        public SyntaxView(javax.swing.text.Element elem)
        Creates a new SyntaxView for painting the specified element.
        Parameters:
        elem - The element
    • Method Detail

      • drawLine

        public void drawLine(int lineIndex,
                             java.awt.Graphics g,
                             int x,
                             int y)
        Paints the specified line.

        This method performs the following:

        • Gets the token marker and color table from the current document, typecast to a SyntaxDocument.
        • Tokenizes the required line by calling the markTokens() method of the token marker.
        • Paints each token, obtaining the color by looking up the the Token.id value in the color table.
        If either the document doesn't implement SyntaxDocument, or if the returned token marker is null, the line will be painted with no colorization.
        Overrides:
        drawLine in class javax.swing.text.PlainView
        Parameters:
        lineIndex - The line number
        g - The graphics context
        x - The x co-ordinate where the line should be painted
        y - The y co-ordinate where the line should be painted

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.