<commit_before>package com.pump.text.html.view;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;

import javax.swing.text.Element;
import javax.swing.text.View;
import javax.swing.text.html.ParagraphView;
import javax.swing.text.html.StyleSheet;
import javax.swing.text.html.StyleSheet.BoxPainter;

import com.pump.geom.ShapeBounds;

/**
 * This ParagraphView uses the QViewHelper to support text-shadows.
 */
public class QParagraphView extends ParagraphView {
	QViewHelper helper;
	BoxPainter boxPainter;

	public QParagraphView(Element elem) {
		super(elem);

		helper = new QViewHelper(this, getStyleSheet());
	}

	@Override
	public void paint(Graphics g, Shape allocation) {
		Rectangle r = ShapeBounds.getBounds(allocation).getBounds();
		Graphics2D g2 = helper.createGraphics((Graphics2D) g, allocation,
				false);
		g2 = helper.createGraphicsWithoutBoxPainter(g2, r, boxPainter);
		helper.paintBackground(g2, r);<commit_msg>We must call helper.paintBackground(..) first<commit_after>package com.pump.text.html.view;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Shape;

import javax.swing.text.Element;
import javax.swing.text.View;
import javax.swing.text.html.ParagraphView;
import javax.swing.text.html.StyleSheet;
import javax.swing.text.html.StyleSheet.BoxPainter;

import com.pump.geom.ShapeBounds;

/**
 * This ParagraphView uses the QViewHelper to support text-shadows.
 */
public class QParagraphView extends ParagraphView {
	QViewHelper helper;
	BoxPainter boxPainter;

	public QParagraphView(Element elem) {
		super(elem);

		helper = new QViewHelper(this, getStyleSheet());
	}

	@Override
	public void paint(Graphics g, Shape allocation) {
		Rectangle r = ShapeBounds.getBounds(allocation).getBounds();
		Graphics2D g2 = helper.createGraphics((Graphics2D) g, allocation,
				false);
		helper.paintBackground(g2, r);
		g2 = helper.createGraphicsWithoutBoxPainter(g2, r, boxPainter);
{'fraction_non_alphanumeric': 0.10895522388059702, 'fraction_numerical': 0.006965174129353234, 'mean_word_length': 5.404458598726115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5322628', 'n_tokens_mistral': 686, 'n_tokens_neox': 647, 'n_words': 141}