<commit_before>/*
 * 11/14/2003
 *
 * RTextScrollPane.java - A JScrollPane that will only accept RTextAreas
 * so that it can display line numbers, fold indicators, and icons.
 * 
 * This library is distributed under a modified BSD license.  See the included
 * RSyntaxTextArea.License.txt file for details.
 */
package org.fife.ui.rtextarea;

import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.util.Arrays;
import java.util.Stack;
import javax.swing.JScrollPane;


/**
 * An extension of <code>JScrollPane</code> that will only take
 * <code>RTextArea</code>s (or <code>javax.swing.JLayer</code>s decorating
 * <code>RTextArea</code>s) for its view.  This class has the ability to show:
 * <ul>
 *    <li>Line numbers
 *    <li>Per-line icons (for bookmarks, debugging breakpoints, error markers, etc.)
 *    <li>+/- icons to denote code folding regions.
 * </ul>
 *
 * The actual "meat" of these extras is contained in the {@link Gutter} class.
 * Each <code>RTextScrollPane</code> has a <code>Gutter</code> instance that
 * it uses as its row header.  The gutter is only made visible when one of its
 * features is being used (line numbering, folding, and/or icons).
 *
 * @author <NAME>
 * @version 1.0
 */
public class RTextScrollPane extends JScrollPane {

	private Gutter gutter;


	/**
	 * Constructor.  If you use this constructor, you must call
	 * {@link #setViewportView(Component)} and pass in an {@link RTextArea}
	 * for this scroll pane to render line numbers properly.
	 */
	public RTextScrollPane() {
		this(null, true);
	}


	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 */
	public RTextScrollPane(Component comp) {
		this(comp, true);
	}


	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 * @param lineNumbers Whether line numbers should be enabled.
	 */
	public RTextScrollPane(Component comp, boolean lineNumbers) {
		this(comp, lineNumbers, Color.GRAY);
	}


	/**
	 * Creates a scroll pane.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 * @param lineNumbers Whether line numbers are initially enabled.
	 * @param lineNumberColor The color to use for line numbers.<commit_msg>Adds removed RTextArea constructors<commit_after>/*
 * 11/14/2003
 *
 * RTextScrollPane.java - A JScrollPane that will only accept RTextAreas
 * so that it can display line numbers, fold indicators, and icons.
 * 
 * This library is distributed under a modified BSD license.  See the included
 * RSyntaxTextArea.License.txt file for details.
 */
package org.fife.ui.rtextarea;

import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Font;
import java.util.Arrays;
import java.util.Stack;
import javax.swing.JScrollPane;


/**
 * An extension of <code>JScrollPane</code> that will only take
 * <code>RTextArea</code>s (or <code>javax.swing.JLayer</code>s decorating
 * <code>RTextArea</code>s) for its view.  This class has the ability to show:
 * <ul>
 *    <li>Line numbers
 *    <li>Per-line icons (for bookmarks, debugging breakpoints, error markers, etc.)
 *    <li>+/- icons to denote code folding regions.
 * </ul>
 *
 * The actual "meat" of these extras is contained in the {@link Gutter} class.
 * Each <code>RTextScrollPane</code> has a <code>Gutter</code> instance that
 * it uses as its row header.  The gutter is only made visible when one of its
 * features is being used (line numbering, folding, and/or icons).
 *
 * @author <NAME>
 * @version 1.0
 */
public class RTextScrollPane extends JScrollPane {

	private Gutter gutter;


	/**
	 * Constructor.  If you use this constructor, you must call
	 * {@link #setViewportView(Component)} and pass in an {@link RTextArea}
	 * for this scroll pane to render line numbers properly.
	 */
	public RTextScrollPane() {
		this(null, true);
	}
	
	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param textArea The text area this scroll pane will contain.
	 */
	public RTextScrollPane(RTextArea textArea) {
		this(textArea, true);
	}

	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 */
	public RTextScrollPane(Component comp) {
		this(comp, true);
	}

	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param area The text area this scroll pane will contain.  If this is
	 *        <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an
	 *        {@link RTextArea}.
	 * @param lineNumbers Whether line numbers should be enabled.
	 */
	public RTextScrollPane(RTextArea textArea, boolean lineNumbers) {
		this(textArea, lineNumbers, Color.GRAY);
	}

	/**
	 * Creates a scroll pane.  A default value will be used for line number
	 * color (gray), and the current line's line number will be highlighted.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 * @param lineNumbers Whether line numbers should be enabled.
	 */
	public RTextScrollPane(Component comp, boolean lineNumbers) {
		this(comp, lineNumbers, Color.GRAY);
	}


	/**
	 * Creates a scroll pane.
	 *
	 * @param comp The component this scroll pane should display.  This should
	 *        be an instance of {@link RTextArea},
	 *        <code>javax.swing.JLayer</code> (or the older
	 *        <code>org.jdesktop.jxlayer.JXLayer</code>), or <code>null</code>.
	 *        If this argument is <code>null</code>, you must call
	 *        {@link #setViewportView(Component)}, passing in an instance of
	 *        one of the types above.
	 * @param lineNumbers Whether line numbers are initially enabled.
	 * @param lineNumberColor The color to use for line numbers.
{'fraction_non_alphanumeric': 0.1057550418101328, 'fraction_numerical': 0.002459419576979833, 'mean_word_length': 3.2315296566077003, 'pattern_counts': {'":': 0, '<': 89, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5448262', 'n_tokens_mistral': 2537, 'n_tokens_neox': 2352, 'n_words': 915}