<commit_before>/*
 Copyright aswing.org, see the LICENCE.txt.
*/

package org.aswing.table;


import flash.text.TextFieldAutoSize;
import org.aswing.Component;
	import org.aswing.JTable;
	import org.aswing.geom.IntRectangle;
	import org.aswing.plaf.ComponentUI;
import org.aswing.graphics.Graphics2D;
	import org.aswing.graphics.SolidBrush;
	import flash.text.TextField;
	/**
 * A poor table cell to render text faster.
 * @author paling
 */
class PoorTextCell extends Component  implements TableCell{
	
	private var textField:TextField;
	private var text:String;
	private var cellValue:Dynamic;
	
	public function new() {
		super();
		setOpaque(true);
		textField = new TextField();
		textField.autoSize = TextFieldAutoSize.LEFT;
		textField.selectable = false;
		textField.mouseEnabled = false;
		setFontValidated(false);
		addChild(textField);
	}
	
	override private function paint(b:IntRectangle):Void{
		var t:String= text == null ? "" : text;
		if(textField.text !=t){
			textField.text = t;
		}
		if(!isFontValidated()){
			AsWingUtils.applyTextFont(textField, getFont());
			setFontValidated(true);
		}
		AsWingUtils.applyTextColor(textField, getForeground());
		textField.x = b.x + UIManager.get("extHorizontalMarginSize");
		textField.y = b.y + (b.height-textField.textHeight)/2;
		if(isOpaque()){
			graphics.clear();<commit_msg>Fixed table text<commit_after>/*
 Copyright aswing.org, see the LICENCE.txt.
*/

package org.aswing.table;


import flash.text.TextFieldAutoSize;
import org.aswing.Component;
	import org.aswing.JTable;
	import org.aswing.geom.IntRectangle;
	import org.aswing.plaf.ComponentUI;
import org.aswing.graphics.Graphics2D;
	import org.aswing.graphics.SolidBrush;
	import flash.text.TextField;
	/**
 * A poor table cell to render text faster.
 * @author paling
 */
class PoorTextCell extends Component  implements TableCell{
	
	private var textField:TextField;
	private var text:String;
	private var cellValue:Dynamic;
	
	public function new() {
		super();
		setOpaque(true);
		textField = new TextField();
		textField.autoSize = TextFieldAutoSize.LEFT;
		textField.selectable = false;
		textField.mouseEnabled = false;
		setFontValidated(false);
		addChild(textField);
	}
	
	override private function paint(b:IntRectangle):Void{
		var t:String= text == null ? "" : text;
		if(textField.text !=t){
			textField.text = t;
		}
		if(!isFontValidated()){
			AsWingUtils.applyTextFont(textField, getFont());
			setFontValidated(true);
		}
		AsWingUtils.applyTextColor(textField, getForeground());
		textField.x = b.x + UIManager.get("textHorizontalMarginSize");
		textField.y = b.y + (b.height-textField.textHeight)/2;
		if(isOpaque()){
			graphics.clear();
{'fraction_non_alphanumeric': 0.12369597615499255, 'fraction_numerical': 0.0014903129657228018, 'mean_word_length': 4.724946695095949, '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': '4135549', 'n_tokens_mistral': 963, 'n_tokens_neox': 904, 'n_words': 185}