You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/01/11 21:55:57 UTC
[13/20] git commit: [flex-asjs] [refs/heads/mavenfolders] -
rename/restructure folders for maven
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
deleted file mode 100644
index 5d4d918..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleApplication.as
+++ /dev/null
@@ -1,102 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- COMPILE::AS3
- {
- import flash.display.DisplayObject;
- import flash.display.Sprite;
- import flash.display.StageAlign;
- import flash.display.StageQuality;
- import flash.display.StageScaleMode;
- import flash.events.Event;
- import flash.system.ApplicationDomain;
- import flash.utils.getQualifiedClassName;
- }
-
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.MouseEvent;
- import org.apache.flex.events.utils.MouseEventConverter;
- import org.apache.flex.utils.MXMLDataInterpreter;
-
- /**
- * The SimpleApplication class can be used as the main class and entry point
- * for low-level ActionScript-only FlexJS
- * applications. It is not indended for use in MXML applications or most
- * of the FlexJS components as they expect a certain application lifecycle
- * in the org.apache.flex.core.Application class.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleApplication extends ApplicationBase
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleApplication()
- {
- super();
- COMPILE::AS3
- {
- if (stage)
- {
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- // should be opt-in
- //stage.quality = StageQuality.HIGH_16X16_LINEAR;
- }
-
- loaderInfo.addEventListener(flash.events.Event.INIT, initHandler);
- }
- }
-
- COMPILE::AS3
- private function initHandler(event:flash.events.Event):void
- {
- start();
- }
-
- /**
- * The entry point. Override this and put all of your code in here.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function start():void
- {
- COMPILE::JS
- {
- this.element = document.getElementsByTagName('body')[0];
- this.element.flexjs_wrapper = this;
- this.element.className = 'SimpleApplication';
- }
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSStyles.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSStyles.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSStyles.as
deleted file mode 100644
index 6e83b2d..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSStyles.as
+++ /dev/null
@@ -1,106 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The SimpleCSSStyles class contains CSS style
- * properties supported by SimpleCSSValuesImpl.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleCSSStyles
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleCSSStyles()
- {
- super();
- }
-
- public var styleList:Object = {
- "top": 1,
- "bottom": 1,
- "left": 1,
- "right": 1,
- "padding": 1,
- "paddingLeft": 1,
- "paddingRight": 1,
- "paddingTop": 1,
- "paddingBottom": 1,
- "margin": 1,
- "marginLeft": 1,
- "marginRight": 1,
- "marginTop": 1,
- "marginBottom": 1,
- "verticalAlign": 1,
- "fontFamily": 1,
- "fontSize": 1,
- "color": 1,
- "fontWeight": 1,
- "fontStyle": 1,
- "backgroundAlpha": 1,
- "backgroundColor": 1,
- "backgroundImage": 1,
- "borderColor": 1,
- "borderStyle": 1,
- "borderRadius": 1,
- "borderWidth": 1
- };
-
- public var top:*;
- public var bottom:*;
- public var left:*;
- public var right:*;
- public var padding:*;
- public var paddingLeft:*;
- public var paddingRight:*;
- public var paddingTop:*;
- public var paddingBottom:*;
- public var margin:*;
- public var marginLeft:*;
- public var marginRight:*;
- public var marginTop:*;
- public var marginBottom:*;
- public var verticalAlign:*;
- public var fontFamily:*;
- public var fontSize:*;
- public var color:*;
- public var fontWeight:*;
- public var fontStyle:*;
- public var backgroundAlpha:*;
- public var backgroundColor:*;
- public var backgroundImage:*;
- public var borderColor:*;
- public var borderStyle:*;
- public var borderRadius:*;
- public var borderWidth:*;
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
deleted file mode 100644
index e64a517..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ /dev/null
@@ -1,765 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- COMPILE::AS3
- {
- import flash.system.ApplicationDomain;
- import flash.utils.getDefinitionByName;
- import flash.utils.getQualifiedClassName;
- import flash.utils.getQualifiedSuperclassName;
- }
-
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.events.ValueChangeEvent;
- import org.apache.flex.events.ValueEvent;
- import org.apache.flex.utils.CSSUtils;
-
- /**
- * The SimpleCSSValuesImpl class implements a minimal set of
- * CSS lookup rules that is sufficient for most applications.
- * It does not support attribute selectors or descendant selectors
- * or id selectors. It will filter on a custom -flex-flash
- * media query but not other media queries. It can be
- * replaced with other implementations that handle more complex
- * selector lookups.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleCSSValuesImpl extends EventDispatcher implements IValuesImpl
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleCSSValuesImpl()
- {
- super();
- }
-
- private var mainClass:Object;
-
- private var conditionCombiners:Object;
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#init()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public function init(mainClass:Object):void
- {
- var styleClassName:String;
- var c:Class;
- if (!values)
- {
- values = {};
- this.mainClass = mainClass;
- var mainClassName:String = getQualifiedClassName(mainClass);
- styleClassName = "_" + mainClassName + "_Styles";
- c = ApplicationDomain.currentDomain.getDefinition(styleClassName) as Class;
- generateCSSStyleDeclarations(c["factoryFunctions"], c["data"]);
- }
- c = mainClass.constructor as Class;
- generateCSSStyleDeclarations(c["factoryFunctions"], c["data"]);
- if (hasEventListener("init"))
- dispatchEvent(new ValueEvent("init", false, false, c["fontFaces"]));
-
- var i:int = 1;
- while (true)
- {
- var ffName:String = "factoryFunctions" + i.toString();
- var ff:Object = c[ffName];
- if (ff == null)
- break;
- generateCSSStyleDeclarations(c[ffName], c["data" + i.toString()]);
- if (hasEventListener("init"))
- dispatchEvent(new ValueEvent("init", false, false, c["fontFaces" + i.toString()]));
- i++;
- }
- }
-
- COMPILE::JS
- public function init(mainClass:Object):void
- {
- var cssData:Array = mainClass.cssData;
- var values:Object = this.values;
- if (values == null)
- values = {};
-
- if (cssData) {
- var n:int = cssData.length;
- var i:int = 0;
- while (i < n)
- {
- var numMQ:int = cssData[i++];
- if (numMQ > 0)
- {
- // skip MediaQuery tests for now
- i += numMQ;
- }
- var numSel:int = cssData[i++];
- var props:Object = {};
- for (var j:int = 0; j < numSel; j++)
- {
- var selName:String = cssData[i++];
- if (values[selName])
- props = values[selName];
- values[selName] = props;
- }
- var numProps:int = cssData[i++];
- for (j = 0; j < numProps; j++)
- {
- var propName:String = cssData[i++];
- var propValue:Object = cssData[i++];
- props[propName] = propValue;
- }
- }
- }
-
- this.values = values;
- }
-
- /**
- * Process the encoded CSS data into data structures. Usually not called
- * directly by application developers.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public function generateCSSStyleDeclarations(factoryFunctions:Object, arr:Array):void
- {
- if (factoryFunctions == null)
- return;
- if (arr == null)
- return;
-
- var declarationName:String = "";
- var segmentName:String = "";
- var n:int = arr.length;
- for (var i:int = 0; i < n; i++)
- {
- var className:int = arr[i];
- if (className == CSSClass.CSSSelector)
- {
- var selectorName:String = arr[++i];
- segmentName = selectorName + segmentName;
- if (declarationName != "")
- declarationName += " ";
- declarationName += segmentName;
- segmentName = "";
- }
- else if (className == CSSClass.CSSCondition)
- {
- if (!conditionCombiners)
- {
- conditionCombiners = {};
- conditionCombiners["class"] = ".";
- conditionCombiners["id"] = "#";
- conditionCombiners["pseudo"] = ':';
- }
- var conditionType:String = arr[++i];
- var conditionName:String = arr[++i];
- segmentName = segmentName + conditionCombiners[conditionType] + conditionName;
- }
- else if (className == CSSClass.CSSStyleDeclaration)
- {
- var factoryName:int = arr[++i]; // defaultFactory or factory
- var defaultFactory:Boolean = factoryName == CSSFactory.DefaultFactory;
- /*
- if (defaultFactory)
- {
- mergedStyle = styleManager.getMergedStyleDeclaration(declarationName);
- style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
- }
- else
- {
- style = styleManager.getStyleDeclaration(declarationName);
- if (!style)
- {
- style = new CSSStyleDeclaration(selector, styleManager, mergedStyle == null);
- if (factoryName == CSSFactory.Override)
- newSelectors.push(style);
- }
- }
- */
- var mq:String = null;
- var o:Object;
- if (i < n - 2)
- {
- // peek ahead to see if there is a media query
- if (arr[i + 1] == CSSClass.CSSMediaQuery)
- {
- mq = arr[i + 2];
- i += 2;
- declarationName = mq + "_" + declarationName;
- }
- }
- var finalName:String;
- var valuesFunction:Function;
- var valuesObject:Object;
- if (defaultFactory)
- {
- valuesFunction = factoryFunctions[declarationName];
- valuesObject = new valuesFunction();
- }
- else
- {
- valuesFunction = factoryFunctions[declarationName];
- valuesObject = new valuesFunction();
- }
- if (isValidStaticMediaQuery(mq))
- {
- finalName = fixNames(declarationName, mq);
- o = values[finalName];
- if (o == null)
- values[finalName] = valuesObject;
- else
- {
- valuesFunction["prototype"] = o;
- values[finalName] = new valuesFunction();
- }
- }
- declarationName = "";
- }
- }
-
- }
-
- private function isValidStaticMediaQuery(mq:String):Boolean
- {
- if (mq == null)
- return true;
-
- if (mq == "-flex-flash")
- return true;
-
- // TODO: (aharui) other media query
-
- return false;
- }
-
- private function fixNames(s:String, mq:String):String
- {
- if (mq != null)
- s = s.substr(mq.length + 1); // 1 more for the hyphen
-
- if (s == "")
- return "*";
-
- var arr:Array = s.split(" ");
- var n:int = arr.length;
- for (var i:int = 0; i < n; i++)
- {
- var segmentName:String = arr[i];
- if (segmentName.charAt(0) == "#" || segmentName.charAt(0) == ".")
- continue;
-
- var c:int = segmentName.lastIndexOf(".");
- if (c > -1) // it is 0 for class selectors
- {
- segmentName = segmentName.substr(0, c) + "::" + segmentName.substr(c + 1);
- arr[i] = segmentName;
- }
- }
- return arr.join(" ");
- }
-
- /**
- * The map of values. The format is not documented and it is not recommended
- * to manipulate this structure directly.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var values:Object;
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#getValue()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getValue(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
- {
- var c:int = valueName.indexOf("-");
- while (c != -1)
- {
- valueName = valueName.substr(0, c) +
- valueName.charAt(c + 1).toUpperCase() +
- valueName.substr(c + 2);
- c = valueName.indexOf("-");
- }
-
- var value:*;
- var o:Object;
- var className:String;
- var selectorName:String;
-
- if (thisObject is IStyleableObject)
- {
- var styleable:IStyleableObject = IStyleableObject(thisObject);
- if (styleable.style != null)
- {
- try {
- value = styleable.style[valueName];
- }
- catch (e:Error) {
- value = undefined;
- }
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- if (styleable.id != null)
- {
- o = values["#" + styleable.id];
- if (o)
- {
- value = o[valueName];
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- }
- var classNames:String = styleable.className;
- if (classNames)
- {
- var classNameList:Array = classNames.split(" ");
- for each (className in classNameList)
- {
- if (state)
- {
- selectorName = className + ":" + state;
- o = values["." + selectorName];
- if (o)
- {
- value = o[valueName];
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- }
-
- o = values["." + className];
- if (o)
- {
- value = o[valueName];
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- }
- }
- }
-
- COMPILE::AS3
- {
- className = getQualifiedClassName(thisObject);
- }
- COMPILE::JS
- {
- className = thisObject.FLEXJS_CLASS_INFO.names[0].qName;
- }
- var thisInstance:Object = thisObject;
- while (className != "Object")
- {
- if (state)
- {
- selectorName = className + ":" + state;
- o = values[selectorName];
- if (o)
- {
- value = o[valueName];
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- }
-
- o = values[className];
- if (o)
- {
- value = o[valueName];
- if (value == "inherit")
- return getInheritingValue(thisObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- COMPILE::AS3
- {
- className = getQualifiedSuperclassName(thisInstance);
- thisInstance = getDefinitionByName(className);
- }
- COMPILE::JS
- {
- var constructorAsObject:Object = thisInstance["constructor"];
- thisInstance = constructorAsObject.superClass_;
- if (!thisInstance || !thisInstance.FLEXJS_CLASS_INFO)
- break;
-
- className = thisInstance.FLEXJS_CLASS_INFO.names[0].qName;
- }
- }
-
- if (inheritingStyles[valueName] != null &&
- thisObject is IChild)
- {
- var parentObject:Object = IChild(thisObject).parent;
- if (parentObject)
- return getValue(parentObject, valueName, state, attrs);
- }
-
- o = values["global"];
- if (o)
- {
- value = o[valueName];
- if (value !== undefined)
- return value;
- }
- o = values["*"];
- if(o)
- {
- return o[valueName];
- }
- return undefined;
- }
-
- private function getInheritingValue(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
- {
- var value:*;
- if (thisObject is IChild)
- {
- var parentObject:Object = IChild(thisObject).parent;
- if (parentObject)
- {
- value = getValue(parentObject, valueName, state, attrs);
- if (value == "inherit" || value === undefined)
- return getInheritingValue(parentObject, valueName, state, attrs);
- if (value !== undefined)
- return value;
- }
- return undefined;
- }
- return "inherit";
- }
-
- /**
- * A method that stores a value to be shared with other objects.
- * It is global, not per instance. Fancier implementations
- * may store shared values per-instance.
- *
- * @param thisObject An object associated with this value. Thiis
- * parameter is ignored.
- * @param valueName The name or key of the value being stored.
- * @param The value to be stored.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function setValue(thisObject:Object, valueName:String, value:*):void
- {
- var c:int = valueName.indexOf("-");
- while (c != -1)
- {
- valueName = valueName.substr(0, c) +
- valueName.charAt(c + 1).toUpperCase() +
- valueName.substr(c + 2);
- c = valueName.indexOf("-");
- }
- var oldValue:Object = values[valueName];
- if (oldValue != value)
- {
- values[valueName] = value;
- dispatchEvent(new ValueChangeEvent(ValueChangeEvent.VALUE_CHANGE, false, false, oldValue, value));
- }
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#newInstance()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function newInstance(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
- {
- var c:Class = getValue(thisObject, valueName, state, attrs);
- if (c)
- return new c();
- return null;
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#getInstance()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- * @flexjsignorecoercion Function
- */
- public function getInstance(valueName:String):Object
- {
- var o:Object = values["global"];
- o = o[valueName];
- COMPILE::AS3
- {
- var i:Class = o as Class;
- }
- COMPILE::JS
- {
- var i:Function = null;
- if (typeof(o) === "function")
- i = o as Function;
- }
- if (i)
- {
- o[valueName] = new i();
- var d:IDocument = o[valueName] as IDocument;
- if (d)
- d.setDocument(mainClass);
- }
- return o;
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#convertColor()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function convertColor(value:Object):uint
- {
- return CSSUtils.toColor(value);
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#parseStyles()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function parseStyles(styles:String):Object
- {
- var obj:Object = {};
- var parts:Array = styles.split(";");
- for each (var part:String in parts)
- {
- var pieces:Array = part.split(":");
- var value:String = pieces[1];
- if (value == "null")
- obj[pieces[0]] = null;
- else if (value == "true")
- obj[pieces[0]] = true;
- else if (value == "false")
- obj[pieces[0]] = false;
- else
- {
- var n:Number = Number(value);
- if (isNaN(n))
- {
- if (value.charAt(0) == "#")
- {
- obj[pieces[0]] = CSSUtils.toColor(value);
- }
- else
- {
- if (value.charAt(0) == "'")
- value = value.substr(1, value.length - 2);
- else if (value.charAt(0) == '"')
- value = value.substr(1, value.length - 2);
- obj[pieces[0]] = value;
- }
- }
- else
- obj[pieces[0]] = n;
- }
- }
- return obj;
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#addRule()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addRule(ruleName:String, values:Object):void
- {
- var asValues:Object = {};
- for (var valueName:String in values)
- {
- var v:* = values[valueName];
- var c:int = valueName.indexOf("-");
- while (c != -1)
- {
- valueName = valueName.substr(0, c) +
- valueName.charAt(c + 1).toUpperCase() +
- valueName.substr(c + 2);
- c = valueName.indexOf("-");
- }
- asValues[valueName] = v;
- }
- this.values[ruleName] = asValues;
- }
-
- /**
- * A map of inheriting styles
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public static var inheritingStyles:Object = {
- "color" : 1,
- "fontFamily" : 1,
- "fontSize" : 1,
- "fontStyle" : 1,
- "textAlign" : 1
- }
-
- /**
- * The styles that apply to each UI widget
- */
- COMPILE::JS
- public static var perInstanceStyles:Object = {
- 'backgroundColor': 1,
- 'backgroundImage': 1,
- 'color': 1,
- 'fontFamily': 1,
- 'fontWeight': 1,
- 'fontSize': 1,
- 'fontStyle': 1
- }
-
-
- /**
- * The styles that use color format #RRGGBB
- */
- COMPILE::JS
- public static var colorStyles:Object = {
- 'backgroundColor': 1,
- 'borderColor': 1,
- 'color': 1
- }
-
-
- /**
- * The properties that enumerate that we skip
- */
- COMPILE::JS
- public static var skipStyles:Object = {
- 'constructor': 1
- }
-
-
-
- /**
- * @param thisObject The object to apply styles to;
- * @param styles The styles.
- */
- COMPILE::JS
- public function applyStyles(thisObject:IUIBase, styles:Object):void
- {
- var styleList:Object = SimpleCSSValuesImpl.perInstanceStyles;
- var colorStyles:Object = SimpleCSSValuesImpl.colorStyles;
- var skipStyles:Object = SimpleCSSValuesImpl.skipStyles;
- var listObj:Object = styles;
- if (styles.styleList)
- listObj = styles.styleList;
- for (var p:String in listObj)
- {
- //if (styleList[p])
- if (skipStyles[p])
- continue;
- var value:* = styles[p];
- if (value === undefined)
- continue;
- if (typeof(value) == 'number') {
- if (colorStyles[p])
- value = '#' + value.toString(16);
- else
- value = value.toString() + 'px';
- }
- else if (p == 'backgroundImage') {
- if (p.indexOf('url') !== 0)
- value = 'url(' + value + ')';
- }
- thisObject.element.style[p] = value;
- }
- }
- }
-}
-
-COMPILE::AS3
-class CSSClass
-{
- public static const CSSSelector:int = 0;
- public static const CSSCondition:int = 1;
- public static const CSSStyleDeclaration:int = 2;
- public static const CSSMediaQuery:int = 3;
-}
-
-COMPILE::AS3
-class CSSFactory
-{
- public static const DefaultFactory:int = 0;
- public static const Factory:int = 1;
- public static const Override:int = 2;
-}
-
-COMPILE::AS3
-class CSSDataType
-{
- public static const Native:int = 0;
- public static const Definition:int = 1;
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleStatesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleStatesImpl.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleStatesImpl.as
deleted file mode 100644
index 4a27318..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleStatesImpl.as
+++ /dev/null
@@ -1,222 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import org.apache.flex.states.AddItems;
- import org.apache.flex.states.SetEventHandler;
- import org.apache.flex.states.SetProperty;
- import org.apache.flex.states.State;
-
- import org.apache.flex.core.IChild;
- import org.apache.flex.core.IParent;
- import org.apache.flex.core.IStatesObject;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.ValueChangeEvent;
- import org.apache.flex.utils.MXMLDataInterpreter;
-
- /**
- * The SimpleStatesImpl class implements a minimal set of
- * view state functionality that is sufficient for most applications.
- * It only supports AddItems and SetProperty changes at this time.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleStatesImpl extends EventDispatcher implements IStatesImpl, IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function SimpleStatesImpl()
- {
- super();
- }
-
- private var _strand:IStrand;
-
- private var sawInitComplete:Boolean;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- IEventDispatcher(_strand).addEventListener("currentStateChange", stateChangeHandler);
- IEventDispatcher(_strand).addEventListener("initComplete", initialStateHandler);
- }
-
- private function initialStateHandler(event:org.apache.flex.events.Event):void
- {
- sawInitComplete = true;
- stateChangeHandler(new ValueChangeEvent("currentStateChange", false, false, null,
- IStatesObject(_strand).currentState));
- }
-
- private function stateChangeHandler(event:ValueChangeEvent):void
- {
- if (!sawInitComplete)
- return;
-
- var doc:IStatesObject = _strand as IStatesObject;
- var arr:Array = doc.states;
- for each (var s:State in arr)
- {
- if (s.name == event.oldValue)
- {
- revert(s);
- break;
- }
- }
- for each (s in arr)
- {
- if (s.name == event.newValue)
- {
- apply(s);
- break;
- }
- }
- doc.dispatchEvent(new Event("stateChangeComplete"));
- }
-
- private function revert(s:State):void
- {
- var arr:Array = s.overrides;
- for each (var o:Object in arr)
- {
- if (o is AddItems)
- {
- var ai:AddItems = AddItems(o);
- for each (var item:IChild in ai.items)
- {
- var parent:IParent = item.parent as IParent;
- parent.removeElement(item);
- }
- if (parent is IContainer)
- IContainer(parent).childrenAdded();
- }
- else if (o is SetProperty)
- {
- var sp:SetProperty = SetProperty(o);
- if (sp.target != null)
- sp.document[sp.target][sp.name] = sp.previousValue;
- else
- sp.document[sp.name] = sp.previousValue;
- }
- else if (o is SetEventHandler)
- {
- var seh:SetEventHandler = SetEventHandler(o);
- if (seh.target != null)
- {
- seh.document[seh.target].removeEventListener(seh.name, seh.handlerFunction);
- }
- else
- {
- seh.document.removeEventListener(seh.name, seh.handlerFunction);
- }
- }
- }
- }
-
- private function apply(s:State):void
- {
- var arr:Array = s.overrides;
- for each (var o:Object in arr)
- {
- if (o is AddItems)
- {
- var ai:AddItems = AddItems(o);
- if (ai.items == null)
- {
- ai.items = ai.itemsDescriptor.items as Array;
- if (ai.items == null)
- {
- ai.items =
- MXMLDataInterpreter.generateMXMLArray(ai.document,
- null, ai.itemsDescriptor.descriptor);
- ai.itemsDescriptor.items = ai.items;
- }
- }
- for each (var item:IChild in ai.items)
- {
- var parent:IParent = ai.document as IParent;
- if (ai.destination != null)
- parent = parent[ai.destination] as IParent;
- if (ai.relativeTo != null)
- {
- var child:Object = ai.document[ai.relativeTo];
- if (ai.destination == null)
- parent = child.parent as IParent;
- var index:int = parent.getElementIndex(child);
- if (ai.position == "after")
- index++;
- parent.addElementAt(item, index);
- }
- else
- {
- parent.addElement(item);
- }
- }
- if (parent is IContainer)
- IContainer(parent).childrenAdded();
- }
- else if (o is SetProperty)
- {
- var sp:SetProperty = SetProperty(o);
- if (sp.target != null)
- {
- sp.previousValue = sp.document[sp.target][sp.name];
- sp.document[sp.target][sp.name] = sp.value;
- }
- else
- {
- sp.previousValue = sp.document[sp.name];
- sp.document[sp.name] = sp.value;
- }
- }
- else if (o is SetEventHandler)
- {
- var seh:SetEventHandler = SetEventHandler(o);
- if (seh.target != null)
- {
- seh.document[seh.target].addEventListener(seh.name, seh.handlerFunction);
- }
- else
- {
- seh.document.addEventListener(seh.name, seh.handlerFunction);
- }
- }
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleValuesImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleValuesImpl.as b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleValuesImpl.as
deleted file mode 100644
index 527f59e..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleValuesImpl.as
+++ /dev/null
@@ -1,188 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import org.apache.flex.events.EventDispatcher;
- import org.apache.flex.events.ValueChangeEvent;
-
- /**
- * The SimpleValuesImpl class implements a simple lookup rules that is
- * sufficient for many very simple applications. Every value
- * is essential global and shared by other instances. Values
- * are set via calls to setValue.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class SimpleValuesImpl extends EventDispatcher implements IValuesImpl
- {
- public function SimpleValuesImpl()
- {
- super();
- }
-
- /**
- * The map of values. The format is not documented and it is not recommended
- * to manipulate this structure directly.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var values:Object;
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#getValue()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getValue(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
- {
- return values[valueName];
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#newInstance()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function newInstance(thisObject:Object, valueName:String, state:String = null, attrs:Object = null):*
- {
- var c:Class = values[valueName];
- if (c)
- return new c();
- return null;
- }
-
- /**
- * A method that stores a value to be shared with other objects.
- * It is global, not per instance. Fancier implementations
- * may store shared values per-instance.
- *
- * @param thisObject An object associated with this value. Thiis
- * parameter is ignored.
- * @param valueName The name or key of the value being stored.
- * @param value The value to be stored.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function setValue(thisObject:Object, valueName:String, value:Object):void
- {
- var oldValue:Object = values[valueName];
- if (oldValue != value)
- {
- values[valueName] = value;
- dispatchEvent(new ValueChangeEvent(ValueChangeEvent.VALUE_CHANGE, false, false, oldValue, value));
- }
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#getInstance()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getInstance(valueName:String):Object
- {
- return values[valueName];
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#init()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function init(mainClass:Object):void
- {
- // do nothing
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#convertColor()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function convertColor(value:Object):uint
- {
- if (!(value is String))
- return uint(value);
-
- var stringValue:String = value as String;
- if (stringValue.charAt(0) == '#')
- return uint(stringValue.substr(1));
- return uint(stringValue);
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#parseStyles()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function parseStyles(value:String):Object
- {
- value = value.replace(/;/g, ",");
- return JSON.parse("{" + value + "}");
- }
-
- /**
- * @copy org.apache.flex.core.IValuesImpl#addRule()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addRule(ruleName:String, values:Object):void
- {
- // ignore ruleName since all values are global
- for (var p:String in values)
- values[p] = values[p];
- }
-
- COMPILE::JS
- public function applyStyles(thisObject:IUIBase, styles:Object):void
- {
- // to do or not needed?
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/StageProxy.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/StageProxy.as b/frameworks/projects/Core/as/src/org/apache/flex/core/StageProxy.as
deleted file mode 100644
index 1afe763..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/StageProxy.as
+++ /dev/null
@@ -1,127 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import flash.display.Stage;
- import flash.events.Event;
-
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
-
- /**
- * The StageProxy class wraps the stage and
- * presents it as a FlexJS IEventDispatcher.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public class StageProxy implements IEventDispatcher
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function StageProxy(stage:Stage)
- {
- super();
- _stage = stage;
- _stage.addEventListener("removedFromStage", removedFromStageHandler);
- }
-
- private var _stage:Stage;
-
- private function removedFromStageHandler(event:flash.events.Event):void
- {
- _stage.removeEventListener("removedFromStage", removedFromStageHandler);
- dispatchEvent(new org.apache.flex.events.Event("removedFromStage"));
- }
-
- /**
- * @copy org.apache.flex.core.IEventDispatcher#addEventListener()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReferences:Boolean = false):void
- {
- _stage.addEventListener(type, listener, useCapture);
- }
-
- /**
- * @copy org.apache.flex.core.IEventDispatcher#removeEventListener()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
- {
- _stage.removeEventListener(type, listener, useCapture);
- }
-
- /**
- * @copy org.apache.flex.core.IEventDispatcher#removeEventListener()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function dispatchEvent(event:flash.events.Event):Boolean
- {
- return _stage.dispatchEvent(event);
- }
-
- /**
- * @copy org.apache.flex.core.IEventDispatcher#willTriger()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function willTrigger(eventName:String):Boolean
- {
- return _stage.willTrigger(eventName);
- }
-
- /**
- * @copy org.apache.flex.core.IEventDispatcher#hasEventListener()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function hasEventListener(eventName:String):Boolean
- {
- return _stage.hasEventListener(eventName);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/Strand.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/Strand.as b/frameworks/projects/Core/as/src/org/apache/flex/core/Strand.as
deleted file mode 100644
index b0318d6..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/Strand.as
+++ /dev/null
@@ -1,182 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import org.apache.flex.events.Event;
- import org.apache.flex.events.EventDispatcher;
-
- /**
- * The Strand class is the base class for non-display object
- * that implement a strand.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class Strand extends EventDispatcher implements IStrand
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function Strand()
- {
- super();
- }
-
-
- private var _model:IBeadModel;
-
- /**
- * An IBeadModel that serves as the data model for the component.
- * Note that there is no controller or view properties since
- * this not a display object.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get model():IBeadModel
- {
- if (_model == null)
- {
- // addbead will set _model
- addBead(new (ValuesManager.valuesImpl.getValue(this, "iBeadModel")) as IBead);
- }
- return _model;
- }
-
- /**
- * @private
- */
- public function set model(value:IBeadModel):void
- {
- if (_model != value)
- {
- addBead(value as IBead);
- dispatchEvent(new Event("modelChanged"));
- }
- }
-
- private var _id:String;
-
- /**
- * An id property for MXML documents.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get id():String
- {
- return _id;
- }
- public function set id(value:String):void
- {
- if (_id != value)
- {
- _id = value;
- dispatchEvent(new Event("idChanged"));
- }
- }
-
- /**
- * @copy org.apache.flex.core.Application#beads
- *
- * The beads are not automatically added to the
- * strand. Subclasses must decide when to
- * add the beads.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var beads:Array;
-
- private var _beads:Vector.<IBead>;
-
- /**
- * @copy org.apache.flex.core.IStrand#addBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function addBead(bead:IBead):void
- {
- if (!_beads)
- _beads = new Vector.<IBead>;
- _beads.push(bead);
- if (bead is IBeadModel)
- _model = bead as IBeadModel;
- bead.strand = this;
- }
-
- /**
- * @copy org.apache.flex.core.IStrand#getBeadByType()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function getBeadByType(classOrInterface:Class):IBead
- {
- for each (var bead:IBead in _beads)
- {
- if (bead is classOrInterface)
- return bead;
- }
- return null;
- }
-
- /**
- * @copy org.apache.flex.core.IStrand#removeBead()
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function removeBead(value:IBead):IBead
- {
- var n:int = _beads.length;
- for (var i:int = 0; i < n; i++)
- {
- var bead:IBead = _beads[i];
- if (bead == value)
- {
- _beads.splice(i, 1);
- return bead;
- }
- }
- return null;
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a903508e/frameworks/projects/Core/as/src/org/apache/flex/core/StyleableCSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/StyleableCSSTextField.as b/frameworks/projects/Core/as/src/org/apache/flex/core/StyleableCSSTextField.as
deleted file mode 100644
index 79e2a7d..0000000
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/StyleableCSSTextField.as
+++ /dev/null
@@ -1,201 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You 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 org.apache.flex.core
-{
- import flash.display.DisplayObjectContainer;
- import flash.text.Font;
-
- import org.apache.flex.core.IStyleableObject;
- import org.apache.flex.events.Event;
-
- /**
- * The StyleableCSSTextField class implements more CSS text styles in a TextField.
- * This makes it easier to use one in a "shadow DOM" in a complex skin.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- COMPILE::AS3
- public class StyleableCSSTextField extends CSSTextField implements IStyleableObject, IChild
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function StyleableCSSTextField()
- {
- super();
- // this is the object passed into CSS lookups since it can
- // have its own individual styles and isn't subordinate
- // to a parent.
- styleParent = this;
- }
-
- /**
- * @private
- * The CSSParent property is set if the CSSTextField
- * is used in a SimpleButton-based instance because
- * the parent property is null, defeating CSS lookup.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var CSSParent:Object;
-
- override public function get parent():DisplayObjectContainer
- {
- if (CSSParent)
- return CSSParent as DisplayObjectContainer;
-
- return super.parent;
- }
-
- private var _id:String;
-
- /**
- * An id property for MXML documents.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get id():String
- {
- return _id;
- }
-
- /**
- * @private
- */
- public function set id(value:String):void
- {
- if (_id != value)
- {
- _id = value;
- dispatchEvent(new Event("idChanged"));
- }
- }
-
- private var _styles:Object;
-
- /**
- * The object that contains
- * "styles" and other associated
- * name-value pairs. You can
- * also specify a string in
- * HTML style attribute format.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get style():Object
- {
- return _styles;
- }
-
- /**
- * @private
- */
- public function set style(value:Object):void
- {
- if (_styles != value)
- {
- if (value is String)
- {
- _styles = ValuesManager.valuesImpl.parseStyles(value as String);
- }
- else
- _styles = value;
- dispatchEvent(new Event("stylesChanged"));
- }
- }
-
- /**
- * A list of type names. Often used for CSS
- * type selector lookups.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public var typeNames:String;
-
- private var _className:String;
-
- /**
- * The classname. Often used for CSS
- * class selector lookups.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get className():String
- {
- return _className;
- }
-
- /**
- * @private
- */
- public function set className(value:String):void
- {
- if (_className != value)
- {
- _className = value;
- dispatchEvent(new Event("classNameChanged"));
- }
- }
-
- /**
- * @private
- */
- override public function set text(value:String):void
- {
- super.text = value;
- var font:String = ValuesManager.valuesImpl.getValue(this, "fontFamily") as String;
- var embeddedFonts:Array = Font.enumerateFonts();
- if (embeddedFonts.length)
- embedFonts = isEmbedded(embeddedFonts, font);
- }
-
- private function isEmbedded(list:Array, name:String):Boolean
- {
- for each (var f:Font in list)
- {
- if (f.fontName == name)
- return true;
- }
- return false;
- }
- }
-}