<commit_before>
Ui.CanvasElement.extend('Ui.ButtonGraphic', {
	text: undefined,
	icon: undefined,
	iconSize: 24,
	orientation: 'vertical',
	isEnable: true,
	isDown: false,
	radius: 4,
	spacing: 3,
	color: undefined,
	contentColor: undefined,
	fontSize: 16,
	fontFamily: 'Sans-serif',
	fontWeight: 'normal',
	textWidth: 0,
	textMeasureValid: false,

	constructor: function(config) {
		this.color = new Ui.Color({ r: 0.31, g: 0.66, b: 1 });
	},

	getText: function() {
		return this.text;
	},

	setText: function(text) {
		if(this.text != text) {
			this.text = text;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getIcon: function() {
		return this.icon;
	},

	setIcon: function(icon) {
		if(this.icon != icon) {
			this.icon = icon;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setIconSize: function(size) {
		if(this.iconSize != size) {
			this.iconSize = size;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getOrientation: function() {
		return this.orientation;
	},

	setOrientation: function(orientation) {
		if(this.orientation != orientation) {
			this.orientation = orientation;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setFontSize: function(fontSize) {
		if(this.fontSize != fontSize) {
			this.fontSize = fontSize;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontSize: function() {
		return this.fontSize;
	},

	setFontFamily: function(fontFamily) {
		if(this.fontFamily != fontFamily) {
			this.fontFamily = fontFamily;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontFamily: function() {
		return this.fontFamily;
	},

	setFontWeight: function(fontWeight) {
		if(this.fontWeight != fontWeight) {
			this.fontWeight = fontWeight;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontWeight: function() {
		return this.fontWeight;
	},

	getIsDown: function() {
		return this.isDown;
	},

	setIsDown: function(isDown) {
		if(this.isDown != isDown) {
			this.isDown = isDown;
			this.invalidateDraw();
		}
	},

	getIsEnable: function() {
		return this.isEnable;
	},

	setIsEnable: function(isEnable) {
		if(this.isEnable != isEnable) {
			this.isEnable = isEnable;
			this.invalidateDraw();
		}
	},

	setRadius: function(radius) {
		if(this.radius != radius) {
			this.radius = radius;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setSpacing: function(spacing) {
		if(this.spacing != spacing) {
			this.spacing = spacing;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setColor: function(color) {
		if(this.color != color) {
			this.color = Ui.Color.create(color);
			this.invalidateDraw();
		}
	},

	setContentColor: function(color) {
		if(this.contentColor != color) {
			this.contentColor = Ui.Color.create(color);
			this.invalidateDraw();
		}
	},

	getGradient: function() {
		var yuv = this.color.getYuv();
		var deltaY = 0;
		if(this.getIsDown())
			deltaY = -0.20;
		return new Ui.LinearGradient({ stops: [
			{ offset: 0, color: new Ui.Color({ y: yuv.y + 0.10 + deltaY, u: yuv.u, v: yuv.v }) },
			{ offset: 1, color: new Ui.Color({ y: yuv.y - 0.10 + deltaY, u: yuv.u, v: yuv.v }) }
		] });
	},

	getContentColor: function() {
		var deltaY = 0;
		if(this.getIsDown())
			deltaY = 0.20;
		if(this.contentColor != undefined) {
			yuv = this.contentColor.getYuv();
			return new Ui.Color({ y: yuv.y + deltaY, u: yuv.u, v: yuv.v });
		}
		else {
			var yuv = this.color.getYuv();
			if(yuv.y < 0.4)
				return new Ui.Color({ y: yuv.y + (0.60 + deltaY), u: yuv.u, v: yuv.v });
			else
				return new Ui.Color({ y: yuv.y - (0.60 + deltaY), u: yuv.u, v: yuv.v });
		}
	},

	getLightColor: function() {
		var yuv = this.color.getYuv();
		var deltaY = 0;
		if(this.getIsDown())<commit_msg>correct a missing local declaration<commit_after>
Ui.CanvasElement.extend('Ui.ButtonGraphic', {
	text: undefined,
	icon: undefined,
	iconSize: 24,
	orientation: 'vertical',
	isEnable: true,
	isDown: false,
	radius: 4,
	spacing: 3,
	color: undefined,
	contentColor: undefined,
	fontSize: 16,
	fontFamily: 'Sans-serif',
	fontWeight: 'normal',
	textWidth: 0,
	textMeasureValid: false,

	constructor: function(config) {
		this.color = new Ui.Color({ r: 0.31, g: 0.66, b: 1 });
	},

	getText: function() {
		return this.text;
	},

	setText: function(text) {
		if(this.text != text) {
			this.text = text;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getIcon: function() {
		return this.icon;
	},

	setIcon: function(icon) {
		if(this.icon != icon) {
			this.icon = icon;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setIconSize: function(size) {
		if(this.iconSize != size) {
			this.iconSize = size;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getOrientation: function() {
		return this.orientation;
	},

	setOrientation: function(orientation) {
		if(this.orientation != orientation) {
			this.orientation = orientation;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setFontSize: function(fontSize) {
		if(this.fontSize != fontSize) {
			this.fontSize = fontSize;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontSize: function() {
		return this.fontSize;
	},

	setFontFamily: function(fontFamily) {
		if(this.fontFamily != fontFamily) {
			this.fontFamily = fontFamily;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontFamily: function() {
		return this.fontFamily;
	},

	setFontWeight: function(fontWeight) {
		if(this.fontWeight != fontWeight) {
			this.fontWeight = fontWeight;
			this.textMeasureValid = false;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	getFontWeight: function() {
		return this.fontWeight;
	},

	getIsDown: function() {
		return this.isDown;
	},

	setIsDown: function(isDown) {
		if(this.isDown != isDown) {
			this.isDown = isDown;
			this.invalidateDraw();
		}
	},

	getIsEnable: function() {
		return this.isEnable;
	},

	setIsEnable: function(isEnable) {
		if(this.isEnable != isEnable) {
			this.isEnable = isEnable;
			this.invalidateDraw();
		}
	},

	setRadius: function(radius) {
		if(this.radius != radius) {
			this.radius = radius;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setSpacing: function(spacing) {
		if(this.spacing != spacing) {
			this.spacing = spacing;
			this.invalidateMeasure();
			this.invalidateDraw();
		}
	},

	setColor: function(color) {
		if(this.color != color) {
			this.color = Ui.Color.create(color);
			this.invalidateDraw();
		}
	},

	setContentColor: function(color) {
		if(this.contentColor != color) {
			this.contentColor = Ui.Color.create(color);
			this.invalidateDraw();
		}
	},

	getGradient: function() {
		var yuv = this.color.getYuv();
		var deltaY = 0;
		if(this.getIsDown())
			deltaY = -0.20;
		return new Ui.LinearGradient({ stops: [
			{ offset: 0, color: new Ui.Color({ y: yuv.y + 0.10 + deltaY, u: yuv.u, v: yuv.v }) },
			{ offset: 1, color: new Ui.Color({ y: yuv.y - 0.10 + deltaY, u: yuv.u, v: yuv.v }) }
		] });
	},

	getContentColor: function() {
		var deltaY = 0;
		if(this.getIsDown())
			deltaY = 0.20;
		if(this.contentColor != undefined) {
			var yuv = this.contentColor.getYuv();
			return new Ui.Color({ y: yuv.y + deltaY, u: yuv.u, v: yuv.v });
		}
		else {
			var yuv = this.color.getYuv();
			if(yuv.y < 0.4)
				return new Ui.Color({ y: yuv.y + (0.60 + deltaY), u: yuv.u, v: yuv.v });
			else
				return new Ui.Color({ y: yuv.y - (0.60 + deltaY), u: yuv.u, v: yuv.v });
		}
	},

	getLightColor: function() {
		var yuv = this.color.getYuv();
		var deltaY = 0;
		if(this.getIsDown())
{'fraction_non_alphanumeric': 0.1617497456765005, 'fraction_numerical': 0.009918616480162767, 'mean_word_length': 3.443502824858757, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7113878', 'n_tokens_mistral': 3356, 'n_tokens_neox': 2917, 'n_words': 572}