<commit_before>package jsettlers.lookandfeel.ui;

import jsettlers.graphics.map.draw.ImageProvider;
import jsettlers.lookandfeel.DrawHelper;

import javax.swing.*;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * Button UI Implementation
 * 
 * @author <NAME>
 */
public class ButtonUIStone extends BasicButtonUI {

	/**
	 * Background Image
	 */
	private final BufferedImage backgroundImage;

	/**
	 * Background Image for pressed button
	 */
	private final BufferedImage backgroundPressedImage;

	/**
	 * Constructor
	 */
	public ButtonUIStone() {
		ImageProvider prv = ImageProvider.getInstance();
		backgroundImage = prv.getGuiImage(3, 326).generateBufferedImage();
		backgroundPressedImage = prv.getGuiImage(3, 329).generateBufferedImage();
	}

	@Override
	public void installDefaults(AbstractButton b) {
		b.setFont(UIDefaults.FONT);
		b.setForeground(UIDefaults.LABEL_TEXT_COLOR);
		b.setPreferredSize(getPreferredSize(b));
	}

	@Override
	public void uninstallDefaults(AbstractButton b) {
	}

	@Override
	public void paint(Graphics g1, JComponent c) {
		Graphics2D g = DrawHelper.antialiasingOn(g1);

		AbstractButton b = (AbstractButton) c;
		ButtonModel model = b.getModel();

		boolean pressed = false;
		// perform UI specific press action, e.g. Windows L&F shifts text
		if (model.isArmed() && model.isPressed()) {
			pressed = true;
			g.drawImage(backgroundPressedImage, 0, 0, b.getWidth(), b.getHeight(), c);
		} else {
			g.drawImage(backgroundImage, 0, 0, b.getWidth(), b.getHeight(), c);
		}

		int y = b.getHeight() / 2 + (g.getFontMetrics().getAscent() / 2);
		int x = 10;

		if (pressed) {
			x += 1;
			y += 1;
		}<commit_msg>fix hidden buttons<commit_after>package jsettlers.lookandfeel.ui;

import jsettlers.graphics.map.draw.ImageProvider;
import jsettlers.lookandfeel.DrawHelper;

import javax.swing.*;
import javax.swing.plaf.basic.BasicButtonUI;
import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * Button UI Implementation
 *
 * @author <NAME>
 */
public class ButtonUIStone extends BasicButtonUI {

	/**
	 * Background Image
	 */
	private final BufferedImage backgroundImage;

	/**
	 * Background Image for pressed button
	 */
	private final BufferedImage backgroundPressedImage;

	/**
	 * Constructor
	 */
	public ButtonUIStone() {
		ImageProvider prv = ImageProvider.getInstance();
		backgroundImage = prv.getGuiImage(3, 326).generateBufferedImage();
		backgroundPressedImage = prv.getGuiImage(3, 329).generateBufferedImage();
	}

	@Override
	public void installDefaults(AbstractButton b) {
		b.setFont(UIDefaults.FONT);
		b.setForeground(UIDefaults.LABEL_TEXT_COLOR);
	}

	@Override
	public void uninstallDefaults(AbstractButton b) {
	}

	@Override
	public void paint(Graphics g1, JComponent c) {
		Graphics2D g = DrawHelper.antialiasingOn(g1);

		AbstractButton b = (AbstractButton) c;
		ButtonModel model = b.getModel();

		boolean pressed = false;
		// perform UI specific press action, e.g. Windows L&F shifts text
		if (model.isArmed() && model.isPressed()) {
			pressed = true;
			g.drawImage(backgroundPressedImage, 0, 0, b.getWidth(), b.getHeight(), c);
		} else {
			g.drawImage(backgroundImage, 0, 0, b.getWidth(), b.getHeight(), c);
		}

		int y = b.getHeight() / 2 + (g.getFontMetrics().getAscent() / 2);
		int x = 10;

		if (pressed) {
			x += 1;
			y += 1;
		}
{'fraction_non_alphanumeric': 0.12666469369635988, 'fraction_numerical': 0.012429712932820362, 'mean_word_length': 4.248447204968944, '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': '4333604', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1095, 'n_words': 255}