<commit_before>
package com.badlogic.gdx.scenes.scene2d.ui;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
import com.badlogic.gdx.graphics.g2d.BitmapFontCache;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table;

/** A table that can be dragged and act as a modal window.
 * <p>
 * The preferred size of a window is the preferred size of the children as layed out by the table. After adding children to the
 * window, it can be convenient to call {@link #pack()} to size the window to the size of the children.
 * @author <NAME> */
public class Window extends Table {
	private WindowStyle style;
	private String title;
	private BitmapFontCache titleCache;
	private boolean isMovable = true, isModal;
	private final Vector2 dragOffset = new Vector2();
	private boolean dragging;

	public Window (Stage stage, Skin skin) {
		this("", stage, skin.getStyle(WindowStyle.class), null);
	}

	public Window (String title, Stage stage, Skin skin) {
		this(title, stage, skin.getStyle(WindowStyle.class), null);
	}

	public Window (String title, Stage stage, WindowStyle style) {
		this(title, stage, style, null);
	}

	public Window (String title, Stage stage, WindowStyle style, String name) {
		super(null, null, name);
		if (title == null) throw new IllegalArgumentException("title cannot be null.");
		if (stage == null) throw new IllegalArgumentException("stage cannot be null.");
		setClip(true);
		this.title = title;
		setStyle(style);<commit_msg>[fixed] Window sets stage before calling setClip() in constructor.<commit_after>
package com.badlogic.gdx.scenes.scene2d.ui;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.BitmapFont.TextBounds;
import com.badlogic.gdx.graphics.g2d.BitmapFontCache;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.tablelayout.Table;

/** A table that can be dragged and act as a modal window.
 * <p>
 * The preferred size of a window is the preferred size of the children as layed out by the table. After adding children to the
 * window, it can be convenient to call {@link #pack()} to size the window to the size of the children.
 * @author <NAME> */
public class Window extends Table {
	private WindowStyle style;
	private String title;
	private BitmapFontCache titleCache;
	private boolean isMovable = true, isModal;
	private final Vector2 dragOffset = new Vector2();
	private boolean dragging;

	public Window (Stage stage, Skin skin) {
		this("", stage, skin.getStyle(WindowStyle.class), null);
	}

	public Window (String title, Stage stage, Skin skin) {
		this(title, stage, skin.getStyle(WindowStyle.class), null);
	}

	public Window (String title, Stage stage, WindowStyle style) {
		this(title, stage, style, null);
	}

	public Window (String title, Stage stage, WindowStyle style, String name) {
		super(null, null, name);
		if (title == null) throw new IllegalArgumentException("title cannot be null.");
		if (stage == null) throw new IllegalArgumentException("stage cannot be null.");
		this.stage = stage;
		setClip(true);
		this.title = title;
		setStyle(style);
{'fraction_non_alphanumeric': 0.1068785968758564, 'fraction_numerical': 0.006577144423129624, 'mean_word_length': 4.830670926517572, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7483211', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1129, 'n_words': 369}