<commit_before>/*
   
Copyright 2010, <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
   
 */

package eu.stefaner.elasticlists.ui {
	import com.bit101.components.PushButton;

	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.filters.DropShadowFilter;
	import flash.text.AntiAliasType;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;

	/**
	 * @author mo
	 */
	public class DefaultGraphicsFactory {

		[Embed(source="/assets/PTS55F.ttf", fontName="regularFont", advancedAntiAliasing="true", mimeType="application/x-font-truetype")]

		private var regularFont : Class;

		[Embed(source="/assets/Aller_Bd.ttf", fontName="boldFont",  fontWeight='bold',  advancedAntiAliasing="true", mimeType="application/x-font-truetype")]
		private var boldFont : Class;

		public static function getTextField() : TextField {
			var t : TextField = new TextField();
			t.autoSize = TextFieldAutoSize.LEFT;
			t.multiline = false;
			t.embedFonts = true;
			t.antiAliasType = AntiAliasType.ADVANCED;
			var tf : TextFormat = new TextFormat("regularFont", 10, 0x333333);
			t.defaultTextFormat = tf;
		
			return t;
		}

		public static function getFacetBoxContainerBackground() : Sprite {
			var s : Sprite = getPanelBackground();
			s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getFacetBoxBackground() : Sprite {
			return getPanelBackground();
		}

		public static function getContentItemBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			//s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getSelectionMarker() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xDDFF99);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getTitleTextField() : TextField {
			var t : TextField = new TextField();
			t.autoSize = TextFieldAutoSize.LEFT;
			t.multiline = false;
			t.embedFonts = true;
			t.antiAliasType = AntiAliasType.ADVANCED;
			var tf : TextFormat = new TextFormat("boldFont", 12, 0x333333, true);
			t.defaultTextFormat = tf;
			return t;
		}

		public static function getPanelBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF, 1);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getContentAreaBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xF0F0F0, 0);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getElasticListEntryBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getButton(p : DisplayObjectContainer, x : Number = 0, y : Number = 0, label : String = "", handler : Function = null) : PushButton {
			return new PushButton(p, x, y, label, handler);
		}

		public static function getMapMarkerBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0x333333);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawCircle(0, 0, 1);
			return s;
		}

		public static function getMapMarkerSelectionMarker() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xDDFF99);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawCircle(0, 0, 1);
			return s;
		}

		public static function getSliderFacetBoxElementBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			return s;
		}

		public static function getSliderFacetBoxElementLocalBar() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xF0F0F0);
			s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(-1, -2, 2, 2);
			s.filters = [new DropShadowFilter(0, 45, 0, .2)];
			return s;
		}

		public static function getSliderFacetBoxElementGlobalBar() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xBBBBBB);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(-1, -2, 2, 2);
			return s;
		}<commit_msg>graphics updates for distinctiveness display<commit_after>/*
   
Copyright 2010, <NAME>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
   
 */

package eu.stefaner.elasticlists.ui {
	import com.bit101.components.PushButton;

	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.filters.DropShadowFilter;
	import flash.text.AntiAliasType;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;

	/**
	 * @author mo
	 */
	public class DefaultGraphicsFactory {

		[Embed(source="/assets/PTS55F.ttf", fontName="regularFont", advancedAntiAliasing="true", mimeType="application/x-font-truetype")]

		private var regularFont : Class;

		[Embed(source="/assets/Aller_Bd.ttf", fontName="boldFont",  fontWeight='bold',  advancedAntiAliasing="true", mimeType="application/x-font-truetype")]
		private var boldFont : Class;

		public static function getTextField() : TextField {
			var t : TextField = new TextField();
			t.autoSize = TextFieldAutoSize.LEFT;
			t.multiline = false;
			t.embedFonts = true;
			t.antiAliasType = AntiAliasType.ADVANCED;
			var tf : TextFormat = new TextFormat("regularFont", 10, 0x333333);
			t.defaultTextFormat = tf;
		
			return t;
		}

		public static function getFacetBoxContainerBackground() : Sprite {
			var s : Sprite = getPanelBackground();
			s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getFacetBoxBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xDDDDDD, 1);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getContentItemBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			//s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getSelectionMarker() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xDDFF99);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getTitleTextField() : TextField {
			var t : TextField = new TextField();
			t.autoSize = TextFieldAutoSize.LEFT;
			t.multiline = false;
			t.embedFonts = true;
			t.antiAliasType = AntiAliasType.ADVANCED;
			var tf : TextFormat = new TextFormat("boldFont", 12, 0x333333, true);
			t.defaultTextFormat = tf;
			return t;
		}

		public static function getPanelBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xF0F0F0, 1);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getContentAreaBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xF0F0F0, 0);
			s.graphics.drawRect(0, 0, 100, 100);
			return s;
		}

		public static function getElasticListEntryBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			s.filters = [new DropShadowFilter(2, 45, 0, .2)];
			return s;
		}

		public static function getButton(p : DisplayObjectContainer, x : Number = 0, y : Number = 0, label : String = "", handler : Function = null) : PushButton {
			return new PushButton(p, x, y, label, handler);
		}

		public static function getMapMarkerBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0x333333);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawCircle(0, 0, 1);
			return s;
		}

		public static function getMapMarkerSelectionMarker() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xDDFF99);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawCircle(0, 0, 1);
			return s;
		}

		public static function getSliderFacetBoxElementBackground() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(0, 0, 200, 100);
			return s;
		}

		public static function getSliderFacetBoxElementLocalBar() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xFFFFFF);
			s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(-1, -2, 2, 2);
			s.filters = [new DropShadowFilter(0, 45, 0, .2)];
			return s;
		}

		public static function getSliderFacetBoxElementGlobalBar() : Sprite {
			var s : Sprite = new Sprite();
			s.graphics.beginFill(0xBBBBBB);
			//s.graphics.lineStyle(0, 0xCCCCCC, 1);
			s.graphics.drawRect(-1, -2, 2, 2);
			return s;
		}
{'fraction_non_alphanumeric': 0.12247983870967742, 'fraction_numerical': 0.03407258064516129, 'mean_word_length': 3.804358353510896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2889018', 'n_tokens_mistral': 3970, 'n_tokens_neox': 3296, 'n_words': 891}