<commit_before>package aimax.osm.viewer.swing;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;

import aimax.osm.viewer.UColor;
import aimax.osm.viewer.UnifiedImageBuilder;

/**
 * Specialized image builder for AWT images.
 * 
 * @author <NAME>
 */
public class AWTImageBuilder implements UnifiedImageBuilder {

	private Image result;
	private Graphics2D g2;
	boolean areaFillMode;

	public void initImage(Image image) {
		result = image;
		g2 = (Graphics2D) image.getGraphics();
	}

	/** Returns the width of the image under construction. */
	@Override
	public int getWidth() {
		return result.getWidth(null);
	}

	/** Returns the height of the image under construction. */
	@Override
	public int getHeight() {
		return result.getHeight(null);
	}

	@Override
	public void drawLine(int x1, int y1, int x2, int y2) {
		g2.drawLine(x1, y1, x2, y2);
	}

	@Override
	public void drawRect(int x, int y, int width, int height) {
		if (areaFillMode)
			g2.fillRect(x, y, width, height);
		else
			g2.drawRect(x, y, width, height);

	}

	@Override
	public void drawOval(int x, int y, int width, int height) {
		if (areaFillMode)<commit_msg>- Anti-aliasing enabled (pull request #88)<commit_after>package aimax.osm.viewer.swing;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.RenderingHints;

import aimax.osm.viewer.UColor;
import aimax.osm.viewer.UnifiedImageBuilder;

/**
 * Specialized image builder for AWT images.
 * 
 * @author <NAME>
 */
public class AWTImageBuilder implements UnifiedImageBuilder {

	private Image result;
	private Graphics2D g2;
	boolean areaFillMode;

	public void initImage(Image image) {
		result = image;
		g2 = (Graphics2D) image.getGraphics();
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
	}

	/** Returns the width of the image under construction. */
	@Override
	public int getWidth() {
		return result.getWidth(null);
	}

	/** Returns the height of the image under construction. */
	@Override
	public int getHeight() {
		return result.getHeight(null);
	}

	@Override
	public void drawLine(int x1, int y1, int x2, int y2) {
		g2.drawLine(x1, y1, x2, y2);
	}

	@Override
	public void drawRect(int x, int y, int width, int height) {
		if (areaFillMode)
			g2.fillRect(x, y, width, height);
		else
			g2.drawRect(x, y, width, height);

	}

	@Override
	public void drawOval(int x, int y, int width, int height) {
		if (areaFillMode)
{'fraction_non_alphanumeric': 0.1117693522906793, 'fraction_numerical': 0.01382306477093207, 'mean_word_length': 4.137931034482759, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3140490', 'n_tokens_mistral': 935, 'n_tokens_neox': 884, 'n_words': 252}