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 2015/07/28 20:40:27 UTC
[01/36] git commit: [flex-asjs] [refs/heads/develop] - improve CSS
support to handle FlatUI-like CSS for Buttons
Repository: flex-asjs
Updated Branches:
refs/heads/develop d3b4e7434 -> d54c90d92
improve CSS support to handle FlatUI-like CSS for Buttons
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3ceb21b6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3ceb21b6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3ceb21b6
Branch: refs/heads/develop
Commit: 3ceb21b6ac5cb4592945db21b739d55490b2c629
Parents: 6487085
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 9 12:42:47 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 9 12:42:47 2015 -0700
----------------------------------------------------------------------
frameworks/projects/Core/as/src/CoreClasses.as | 3 +-
.../as/src/org/apache/flex/core/CSSTextField.as | 27 +-
.../org/apache/flex/core/SimpleCSSValuesImpl.as | 17 +-
.../as/src/org/apache/flex/core/UIButtonBase.as | 6 +-
.../as/src/org/apache/flex/utils/CSSUtils.as | 299 +++++++++++++++++++
.../org/apache/flex/utils/SolidBorderUtil.as | 12 +-
.../src/org/apache/flex/utils/StringTrimmer.as | 175 +++++++++++
frameworks/projects/HTML/as/defaults.css | 28 +-
.../org/apache/flex/html/beads/CSSButtonView.as | 56 +++-
.../apache/flex/html/beads/CSSTextButtonView.as | 83 +++--
10 files changed, 638 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as b/frameworks/projects/Core/as/src/CoreClasses.as
index 43abbdc..337e5f3 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -81,14 +81,15 @@ internal class CoreClasses
import org.apache.flex.events.utils.MouseUtils; MouseUtils;
import org.apache.flex.geom.Point; Point;
import org.apache.flex.geom.Rectangle; Rectangle;
- import org.apache.flex.utils.UIUtils; UIUtils;
import org.apache.flex.utils.BinaryData; BinaryData;
import org.apache.flex.utils.BeadMetrics; BeadMetrics;
+ import org.apache.flex.utils.CSSUtils; CSSUtils;
import org.apache.flex.utils.dbg.DOMPathUtil; DOMPathUtil;
import org.apache.flex.utils.EffectTimer; EffectTimer;
import org.apache.flex.utils.MixinManager; MixinManager;
import org.apache.flex.utils.PNGEncoder; PNGEncoder;
import org.apache.flex.utils.SolidBorderUtil; SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer; StringTrimmer;
import org.apache.flex.utils.Timer; Timer;
import org.apache.flex.utils.UIUtils; UIUtils;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
index 12248b8..e32b199 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
@@ -24,6 +24,7 @@ package org.apache.flex.core
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
+ import org.apache.flex.utils.CSSUtils;
/**
* The CSSTextField class implements CSS text styles in a TextField.
@@ -64,11 +65,23 @@ package org.apache.flex.core
/**
* @private
+ * The parentDrawsBackground property is set if the CSSTextField
+ * shouldn't draw a background
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var parentDrawsBackground:Boolean;
+
+ /**
+ * @private
*/
override public function set text(value:String):void
{
var sp:Object = parent;
- if (!sp)
+ if (styleParent)
sp = styleParent;
sp.addEventListener("classNameChanged", updateStyles);
@@ -96,16 +109,14 @@ package org.apache.flex.core
tf.align = "right";
autoSize = TextFieldAutoSize.NONE;
}
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color");
- if (backgroundColor != null)
+ if (!parentDrawsBackground)
{
- this.background = true;
- if (backgroundColor is String)
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color");
+ if (backgroundColor != null)
{
- backgroundColor = backgroundColor.replace("#", "0x");
- backgroundColor = uint(backgroundColor);
+ this.background = true;
+ this.backgroundColor = CSSUtils.toColor(backgroundColor);
}
- this.backgroundColor = backgroundColor as uint;
}
defaultTextFormat = tf;
super.text = value;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/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
index 4e4bbaf..bbbd6c0 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -25,7 +25,8 @@ package org.apache.flex.core
import org.apache.flex.events.EventDispatcher;
import org.apache.flex.events.ValueChangeEvent;
-
+ import org.apache.flex.utils.CSSUtils;
+
/**
* The SimpleCSSValuesImpl class implements a minimal set of
* CSS lookup rules that is sufficient for most applications.
@@ -481,13 +482,7 @@ package org.apache.flex.core
*/
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);
+ return CSSUtils.toColor(value);
}
/**
@@ -518,10 +513,8 @@ package org.apache.flex.core
if (isNaN(n))
{
if (value.charAt(0) == "#")
- {
- value = value.replace("#", "0x");
- n = parseInt(value);
- obj[pieces[0]] = n;
+ {
+ obj[pieces[0]] = CSSUtils.toColor(value);
}
else
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as b/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
index 5a93300..4656329 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/UIButtonBase.as
@@ -280,8 +280,7 @@ package org.apache.flex.core
{
var w:Number = _width;
if (isNaN(w)) w = $width;
- var metrics:UIMetrics = BeadMetrics.getMetrics(this);
- return w + metrics.left + metrics.right;
+ return w;
}
else
return explicitWidth;
@@ -331,8 +330,7 @@ package org.apache.flex.core
{
var h:Number = _height;
if (isNaN(h)) h = $height;
- var metrics:UIMetrics = BeadMetrics.getMetrics(this);
- return h + metrics.top + metrics.bottom;
+ return h;
}
else
return explicitHeight;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
new file mode 100644
index 0000000..b023c4f
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
@@ -0,0 +1,299 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+ /**
+ * The CSSUtils class is a collection of static functions that provide utility
+ * features for managing CSS values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSUtils
+ {
+ /**
+ * @private
+ */
+ public function CSSUtils()
+ {
+ throw new Error("CSSUtils should not be instantiated.");
+ }
+
+ /**
+ * Converts a String to number.
+ *
+ * @param str The String.
+ * @param reference A Number that will be used to convert percentages.
+ *
+ * @return Number.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function toNumber(str:String, reference:Number = 0):Number
+ {
+ var c:int = str.indexOf("px");
+ if (c != -1)
+ return Number(str.substr(0, c));
+
+ c = str.indexOf("%");
+ if (c != -1)
+ return Number(str.substr(0, c)) * reference / 100;
+
+ return Number(str);
+ }
+
+ /**
+ * Converts a value describing a color to a uint
+ *
+ * @param value The value.
+ *
+ * @return uint of the color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function toColor(value:Object):uint
+ {
+ return toColorWithAlpha(value) & 0xFFFFFF;
+ }
+
+ /**
+ * Converts a value describing a color and alpha in a uint
+ *
+ * @param value The value.
+ *
+ * @return uint of the color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function toColorWithAlpha(value:Object):uint
+ {
+ if (!(value is String))
+ return uint(value);
+
+ var c:int;
+ var c2:int;
+
+ var stringValue:String = value as String;
+ if (stringValue.charAt(0) == '#')
+ {
+ if (stringValue.length == 4)
+ return uint("0x" + stringValue.charAt(1) + stringValue.charAt(1) +
+ stringValue.charAt(2) + stringValue.charAt(2) +
+ stringValue.charAt(3) + stringValue.charAt(3));
+ return uint("0x" + stringValue.substr(1));
+ }
+ else if ((c = stringValue.indexOf("rgb(")) != -1)
+ {
+ c2 = stringValue.indexOf(")");
+ stringValue = stringValue.substring(c + 4, c2);
+ var parts3:Array = stringValue.split(",");
+ return (uint(parts3[0]) << 16 +
+ uint(parts3[1]) << 8 +
+ uint(parts3[2]));
+ }
+ else if ((c = stringValue.indexOf("rgba(")) != -1)
+ {
+ c2 = stringValue.indexOf(")");
+ stringValue = stringValue.substring(c + 4, c2);
+ var parts4:Array = stringValue.split(",");
+ return (uint(parts4[3]) << 24 +
+ uint(parts3[0]) << 16 +
+ uint(parts3[1]) << 8 +
+ uint(parts3[2]));
+ }
+
+ if (colorMap.hasOwnProperty(stringValue))
+ return colorMap[stringValue];
+ return uint(stringValue);
+ }
+
+ /**
+ * Computes paddingLeft or marginLeft.
+ *
+ * @param value The value of padding-left or margin-left.
+ * @param values The value of padding or margin.
+ * @param reference A Number that will be used to convert percentages.
+ *
+ * @return Number.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function getLeftValue(value:Object, values:Object, reference:Number = NaN):Number
+ {
+ if (value is Number)
+ return value as Number;
+
+ if (value != null)
+ return toNumber(value as String, reference);
+ if (values is Array)
+ {
+ var arr:Array = values as Array;
+ var n:int = arr.length;
+ // shouldn't be n == 1. values would not be an array
+ var index:int = n < 3 ? 1 : 3;
+ value = arr[index];
+ if (value is String)
+ return toNumber(value as String, reference);
+ return value as Number;
+ }
+ return toNumber(values as String, reference);
+ }
+
+ /**
+ * Computes paddingRight or marginRight.
+ *
+ * @param value The value of padding-right or margin-right.
+ * @param values The value of padding or margin.
+ * @param reference A Number that will be used to convert percentages.
+ *
+ * @return Number.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function getRightValue(value:Object, values:Object, reference:Number = NaN):Number
+ {
+ if (value is Number)
+ return value as Number;
+
+ if (value != null)
+ return toNumber(value as String, reference);
+ if (values is Array)
+ {
+ var arr:Array = values as Array;
+ value = arr[1];
+ if (value is String)
+ return toNumber(value as String, reference);
+ return value as Number;
+ }
+ return toNumber(values as String, reference);
+ }
+
+ /**
+ * Computes paddingTop or marginTop.
+ *
+ * @param value The value of padding-top or margin-top.
+ * @param values The value of padding or margin.
+ * @param reference A Number that will be used to convert percentages.
+ *
+ * @return Number.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function getTopValue(value:Object, values:Object, reference:Number = NaN):Number
+ {
+ if (value is Number)
+ return value as Number;
+
+ if (value != null)
+ return toNumber(value as String, reference);
+ if (values is Array)
+ {
+ var arr:Array = values as Array;
+ value = arr[0];
+ if (value is String)
+ return toNumber(value as String, reference);
+ return value as Number;
+ }
+ return toNumber(values as String, reference);
+ }
+
+ /**
+ * Computes paddingBottom or marginBottom.
+ *
+ * @param value The value of padding-bottom or margin-bottom.
+ * @param values The value of padding or margin.
+ * @param reference A Number that will be used to convert percentages.
+ *
+ * @return Number.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function getBottomValue(value:Object, values:Object, reference:Number = NaN):Number
+ {
+ if (value is Number)
+ return value as Number;
+
+ if (value != null)
+ return toNumber(value as String, reference);
+ if (values is Array)
+ {
+ var arr:Array = values as Array;
+ var n:int = arr.length;
+ // shouldn't be n == 1. values would not be an array
+ var index:int = n == 2 ? 0 : 2;
+ value = arr[index];
+ if (value is String)
+ return toNumber(value as String, reference);
+ return value as Number;
+ }
+ return toNumber(values as String, reference);
+ }
+
+ /**
+ * The map of color names to uints.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static var colorMap:Object = {
+ white: 0xFFFFFF,
+ silver: 0xC0C0C0,
+ gray: 0x808080,
+ black: 0x000000,
+ red: 0xFF0000,
+ maroon: 0x800000,
+ yellow: 0xFFFF00,
+ olive: 0x808000,
+ lime: 0x00FF00,
+ green: 0x008000,
+ aqua: 0x00FFFF,
+ teal: 0x008080,
+ blue: 0x0000FF,
+ navy: 0x000080,
+ fuchsia: 0xFF00FF,
+ purple: 0x800080
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index 8c65c79..aca4275 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -56,15 +56,19 @@ public class SolidBorderUtil
public static function drawBorder(g:Graphics, x:Number, y:Number,
width:Number, height:Number,
color:uint, backgroundColor:Object = null,
- thickness:int = 1, alpha:Number = 1.0):void
+ thickness:int = 1, alpha:Number = 1.0,
+ ellipseWidth:Number = NaN, ellipseHeight:Number = NaN):void
{
g.clear();
- g.lineStyle(thickness, color, alpha);
+ g.lineStyle(thickness, color, thickness == 0 ? 0 : 1);
if (backgroundColor != null)
- g.beginFill(uint(backgroundColor));
+ g.beginFill(uint(backgroundColor), alpha);
- g.drawRect(x, y, width, height);
+ if (!isNaN(ellipseWidth))
+ g.drawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);
+ else
+ g.drawRect(x, y, width, height);
if (backgroundColor != null)
g.endFill();
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as
new file mode 100644
index 0000000..b6de591
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as
@@ -0,0 +1,175 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+
+ /**
+ * The StringTrimmer class is a collection of static functions that provide utility
+ * features for trimming whitespace off Strings.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class StringTrimmer
+ {
+ /**
+ * @private
+ */
+ public function StringTrimmer()
+ {
+ throw new Error("StringTrimmer should not be instantiated.");
+ }
+
+ /**
+ * Removes all whitespace characters from the beginning and end
+ * of the specified string.
+ *
+ * @param str The String whose whitespace should be trimmed.
+ *
+ * @return Updated String where whitespace was removed from the
+ * beginning and end.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function trim(str:String):String
+ {
+ if (str == null) return '';
+
+ var startIndex:int = 0;
+ while (isWhitespace(str.charAt(startIndex)))
+ ++startIndex;
+
+ var endIndex:int = str.length - 1;
+ while (isWhitespace(str.charAt(endIndex)))
+ --endIndex;
+
+ if (endIndex >= startIndex)
+ return str.slice(startIndex, endIndex + 1);
+ else
+ return "";
+ }
+
+ /**
+ * Removes all whitespace characters from the beginning and end
+ * of each element in an Array, where the Array is stored as a String.
+ *
+ * @param value The String whose whitespace should be trimmed.
+ *
+ * @param separator The String that delimits each Array element in the string.
+ *
+ * @return Array where whitespace was removed from the
+ * beginning and end of each element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function splitAndTrim(value:String, delimiter:String):Array
+ {
+ if (value != "" && value != null)
+ {
+ var items:Array = value.split(delimiter);
+
+ var len:int = items.length;
+ for (var i:int = 0; i < len; i++)
+ {
+ items[i] = StringTrimmer.trim(items[i]);
+ }
+ return items;
+ }
+
+ return [];
+ }
+
+ /**
+ * Removes all whitespace characters from the beginning and end
+ * of each element in an Array, where the Array is stored as a String.
+ *
+ * @param value The String whose whitespace should be trimmed.
+ *
+ * @param separator The String that delimits each Array element in the string.
+ *
+ * @return Updated String where whitespace was removed from the
+ * beginning and end of each element.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function trimArrayElements(value:String, delimiter:String):String
+ {
+ if (value != "" && value != null)
+ {
+ var items:Array = splitAndTrim(value, delimiter);
+ if (items.length > 0)
+ {
+ value = items.join(delimiter);
+ }
+ }
+
+ return value;
+ }
+
+ /**
+ * Returns <code>true</code> if the specified string is
+ * a single space, tab, carriage return, newline, or formfeed character.
+ *
+ * @param str The String that is is being queried.
+ *
+ * @return <code>true</code> if the specified string is
+ * a single space, tab, carriage return, newline, or formfeed character.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function isWhitespace(character:String):Boolean
+ {
+ switch (character)
+ {
+ case " ":
+ case "\t":
+ case "\r":
+ case "\n":
+ case "\f":
+ // non breaking space
+ case "\u00A0":
+ // line seperator
+ case "\u2028":
+ // paragraph seperator
+ case "\u2029":
+ // ideographic space
+ case "\u3000":
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 7d57d1b..81658b2 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -25,6 +25,8 @@
{
font-family: "Arial";
font-size: 12px;
+ color: #34495e;
+ background-color: #fff;
}
*:active
@@ -47,23 +49,31 @@
Button
{
- background-color: #d8d8d8;
- border: 1px solid #000000;
- padding: 4px;
+ color: #fff;
+ background-color: #1abc9c;
+ padding: 10px 15px;
+ font-size: 15px;
+ font-weight: normal;
+ line-height: 1.4;
+ border: none;
+ border-radius: 4px;
+ -webkit-transition: border .25s linear, color .25s linear, background-color .25s linear;
+ transition: border .25s linear, color .25s linear, background-color .25s linear;
+
+ -webkit-font-smoothing: subpixel-antialiased;
}
Button:hover
{
- background-color: #9fa0a1;
- border: 1px solid #000000;
- padding: 4px;
+ color: #fff;
+ background-color: #48c9b0;
+ border-color: #48c9b0;
}
Button:active
{
- background-color: #929496;
- border: 1px solid #000000;
- padding: 4px;
+ outline: none;
+ box-shadow: none;
}
ButtonBar
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
index f93ca3e..a40c7a9 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -18,6 +18,7 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.html.beads
{
+ import flash.display.DisplayObject;
import flash.display.Loader;
import flash.display.Shape;
import flash.display.SimpleButton;
@@ -25,12 +26,14 @@ package org.apache.flex.html.beads
import flash.events.Event;
import flash.net.URLRequest;
- import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.BeadViewBase;
import org.apache.flex.core.IBeadView;
import org.apache.flex.core.IStrand;
import org.apache.flex.core.ITextModel;
import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.utils.CSSUtils;
import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
/**
* The CSSButtonView class is the default view for
@@ -103,6 +106,8 @@ package org.apache.flex.html.beads
borderStyle = borderStyles[1];
borderThickness = borderStyles[0];
}
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
if (value != null)
borderStyle = value as String;
@@ -112,23 +117,58 @@ package org.apache.flex.html.beads
value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
if (value != null)
borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = value as Number;
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ }
+ }
var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- if (paddingLeft == null) paddingLeft = padding;
- if (paddingRight == null) paddingRight = padding;
- if (paddingTop == null) paddingTop = padding;
- if (paddingBottom == null) paddingBottom = padding;
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
+ var bgColor:uint;
+ var bgAlpha:Number = 1;
+ if (backgroundColor != null)
+ {
+ bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
+ if (bgColor & 0xFF000000)
+ {
+ bgAlpha = bgColor >> 24 / 255;
+ bgColor = bgColor & 0xFFFFFF;
+ }
+ }
if (borderStyle == "solid")
{
SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, sprite.width + Number(paddingLeft) + Number(paddingRight),
- sprite.height + Number(paddingTop) + Number(paddingBottom),
- borderColor, backgroundColor, borderThickness);
+ 0, 0, sprite.width + pl + pr,
+ sprite.height + pt + pb,
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3ceb21b6/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index a250dff..fd48998 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -37,7 +37,9 @@ package org.apache.flex.html.beads
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
import org.apache.flex.html.TextButton;
- import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
/**
* The CSSTextButtonView class is the default view for
@@ -106,6 +108,12 @@ package org.apache.flex.html.beads
shape.graphics.beginFill(0xCCCCCC);
shape.graphics.drawRect(0, 0, 10, 10);
shape.graphics.endFill();
+ upTextField.styleParent = _strand;
+ downTextField.styleParent = _strand;
+ overTextField.styleParent = _strand;
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
SimpleButton(value).upState = upSprite;
SimpleButton(value).downState = downSprite;
SimpleButton(value).overState = overSprite;
@@ -125,7 +133,8 @@ package org.apache.flex.html.beads
{
setupSkin(overSprite, overTextField, "hover");
setupSkin(downSprite, downTextField, "active");
- setupSkin(upSprite, upTextField);
+ setupSkin(upSprite, upTextField);
+ updateHitArea();
}
private function setupSkin(sprite:Sprite, textField:TextField, state:String = null):void
@@ -146,6 +155,8 @@ package org.apache.flex.html.beads
borderStyle = borderStyles[1];
borderThickness = borderStyles[0];
}
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
if (value != null)
borderStyle = value as String;
@@ -155,29 +166,66 @@ package org.apache.flex.html.beads
value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
if (value != null)
borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = value as Number;
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ }
+ }
+
var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- if (paddingLeft == null) paddingLeft = padding;
- if (paddingRight == null) paddingRight = padding;
- if (paddingTop == null) paddingTop = padding;
- if (paddingBottom == null) paddingBottom = padding;
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
+ var bgColor:uint;
+ var bgAlpha:Number = 1;
+ if (backgroundColor != null)
+ {
+ bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
+ if (bgColor & 0xFF000000)
+ {
+ bgAlpha = bgColor >> 24 / 255;
+ bgColor = bgColor & 0xFFFFFF;
+ }
+ }
if (borderStyle == "solid")
{
var useWidth:Number = Math.max(sw,textField.textWidth);
var useHeight:Number = Math.max(sh,textField.textHeight);
- if ((useWidth-Number(paddingLeft)-Number(paddingRight)-2*borderThickness) < textField.textWidth)
- useWidth = textField.textWidth+Number(paddingLeft)+Number(paddingRight)+2*borderThickness;
- if ((useHeight-Number(paddingTop)-Number(paddingBottom)-2*borderThickness) < textField.textHeight)
- useHeight = textField.textHeight+Number(paddingTop)+Number(paddingBottom)+2*borderThickness;
+ if ((useWidth-pl-pr-2*borderThickness) < textField.textWidth)
+ useWidth = textField.textWidth+pl+pr+2*borderThickness;
+ if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
+ useHeight = textField.textHeight+pt+pb+2*borderThickness;
SolidBorderUtil.drawBorder(sprite.graphics,
0, 0, useWidth, useHeight,
- borderColor, backgroundColor, borderThickness);
+ borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
+ borderEllipseWidth, borderEllipseHeight);
textField.y = (useHeight - textField.textHeight) / 2;
textField.x = (useWidth - textField.textWidth) / 2;
}
@@ -207,16 +255,7 @@ package org.apache.flex.html.beads
textField.textColor = Number(textColor);
}
}
-
- private function drawSkin() : void
- {
- setupSkin(overSprite, overTextField, "hover");
- setupSkin(downSprite, downTextField, "active");
- setupSkin(upSprite, upTextField);
-
- updateHitArea();
- }
-
+
private function textChangeHandler(event:org.apache.flex.events.Event):void
{
text = textModel.text;
@@ -229,7 +268,7 @@ package org.apache.flex.html.beads
private function sizeChangeHandler(event:org.apache.flex.events.Event):void
{
- drawSkin();
+ setupSkins();
}
private var upTextField:CSSTextField;
[20/36] git commit: [flex-asjs] [refs/heads/develop] - most of a
flat-ui-like dropdownlist
Posted by ah...@apache.org.
most of a flat-ui-like dropdownlist
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9d1950f5
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9d1950f5
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9d1950f5
Branch: refs/heads/develop
Commit: 9d1950f52ddf6e54470face7ef26d2183b150f78
Parents: 2eda749
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 24 06:15:51 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 24 06:15:51 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/src/MyInitialView.mxml | 2 +-
frameworks/projects/Core/as/src/CoreClasses.as | 3 +
.../as/src/org/apache/flex/core/CSSShape.as | 162 ++++++++++++++
.../as/src/org/apache/flex/core/CSSSprite.as | 162 ++++++++++++++
.../src/org/apache/flex/utils/CSSBorderUtils.as | 218 +++++++++++++++++++
.../as/src/org/apache/flex/utils/CSSUtils.as | 4 +-
.../org/apache/flex/utils/SolidBorderUtil.as | 58 +++--
frameworks/projects/HTML/as/defaults.css | 38 +++-
.../org/apache/flex/html/beads/CSSButtonView.as | 2 +-
.../apache/flex/html/beads/CSSTextButtonView.as | 2 +-
.../apache/flex/html/beads/DropDownListView.as | 102 +++++----
.../flex/html/beads/SingleLineBorderBead.as | 108 +--------
.../flex/html/beads/SolidBackgroundBead.as | 36 ++-
.../beads/controllers/DropDownListController.as | 3 +-
.../html/supportClasses/DropDownListList.as | 1 +
.../js/src/org/apache/flex/html/DropDownList.js | 57 ++---
16 files changed, 730 insertions(+), 228 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/examples/DataBindingTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/MyInitialView.mxml b/examples/DataBindingTest/src/MyInitialView.mxml
index 0d14f92..59bfd77 100644
--- a/examples/DataBindingTest/src/MyInitialView.mxml
+++ b/examples/DataBindingTest/src/MyInitialView.mxml
@@ -126,7 +126,7 @@ limitations under the License.
<js:beads>
<js:VerticalLayout />
</js:beads>
- <js:DropDownList id="list" width="100" height="30"
+ <js:DropDownList id="list" width="100" height="43"
change="_symbol = list.selectedItem as String; dispatchEvent(new CustomEvent('listChanged'))"
dataProvider="{MyModel(applicationModel).strings}" />
<js:RadioButton id="radio1" text="Price" value="Ask" groupName="group1" change="radioChanged(event)"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as b/frameworks/projects/Core/as/src/CoreClasses.as
index 0c04ca4..0b575af 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -29,6 +29,8 @@ internal class CoreClasses
{
import org.apache.flex.core.BeadViewBase; BeadViewBase;
import org.apache.flex.core.BrowserWindow; BrowserWindow;
+ import org.apache.flex.core.CSSShape; CSSShape;
+ import org.apache.flex.core.CSSSprite; CSSSprite;
import org.apache.flex.core.CSSTextField; CSSTextField;
import org.apache.flex.core.StyleableCSSTextField; StyleableCSSTextField;
import org.apache.flex.core.ItemRendererClassFactory; ItemRendererClassFactory;
@@ -85,6 +87,7 @@ internal class CoreClasses
import org.apache.flex.utils.BinaryData; BinaryData;
import org.apache.flex.utils.BeadMetrics; BeadMetrics;
import org.apache.flex.utils.CSSUtils; CSSUtils;
+ import org.apache.flex.utils.CSSBorderUtils; CSSBorderUtils;
import org.apache.flex.utils.dbg.DOMPathUtil; DOMPathUtil;
import org.apache.flex.utils.EffectTimer; EffectTimer;
import org.apache.flex.utils.MixinManager; MixinManager;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/org/apache/flex/core/CSSShape.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSShape.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSShape.as
new file mode 100644
index 0000000..e1e238c
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSShape.as
@@ -0,0 +1,162 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Graphics;
+ import flash.display.Shape;
+
+ import org.apache.flex.core.IChild;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.CSSBorderUtils;
+
+ /**
+ * The Border class is a class used internally by many
+ * controls to draw a border. The border actually drawn
+ * is dictated by the IBeadView in the CSS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSShape extends Shape implements IStyleableObject, IChild
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSShape()
+ {
+ super();
+ }
+
+ 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 _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 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"));
+ }
+ }
+
+ public var state:String;
+
+ /**
+ * Draw the contents based on styles
+ *
+ * @param width The width.
+ * @param height The height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function draw(w:Number, h:Number):void
+ {
+ CSSBorderUtils.draw(this.graphics, w, h, this, state, true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/org/apache/flex/core/CSSSprite.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSSprite.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSSprite.as
new file mode 100644
index 0000000..fcd2716
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSSprite.as
@@ -0,0 +1,162 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Graphics;
+ import flash.display.Sprite;
+
+ import org.apache.flex.core.IChild;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.CSSBorderUtils;
+
+ /**
+ * The Border class is a class used internally by many
+ * controls to draw a border. The border actually drawn
+ * is dictated by the IBeadView in the CSS.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSSprite extends Sprite implements IStyleableObject, IChild
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSSprite()
+ {
+ super();
+ }
+
+ 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 _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 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"));
+ }
+ }
+
+ public var state:String;
+
+ /**
+ * Draw the contents based on styles
+ *
+ * @param width The width.
+ * @param height The height.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function draw(w:Number, h:Number):void
+ {
+ CSSBorderUtils.draw(this.graphics, w, h, this, state, true);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
new file mode 100644
index 0000000..5a80e31
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
@@ -0,0 +1,218 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.utils
+{
+ import flash.display.DisplayObject;
+ import flash.display.Graphics;
+
+ import org.apache.flex.core.IStatesObject;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSBorderUtils class is shared code for getting the styles
+ * regarding borders and drawing one.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSBorderUtils
+ {
+ /**
+ * @private
+ */
+ public function CSSBorderUtils()
+ {
+ throw new Error("CSSBorderUtils should not be instantiated.");
+ }
+
+ /**
+ * Get the related styles and draw a border
+ *
+ * @param g The flash.display.Graphics to draw into.
+ * @param width The width.
+ * @param height The height.
+ * @param host The object to pull styles from.
+ * @param state The pseudo-state, if any.
+ * @param drawBackground True if area inside border should be filled with backgroundColor.
+ * @param clear True if graphics.clear() should be called.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function draw(g:Graphics, width:Number, height:Number,
+ host:DisplayObject, state:String = null,
+ drawBackground:Boolean = false, clear:Boolean = true):void
+ {
+ if (clear)
+ g.clear();
+
+ var needBorderColor:Boolean = true;
+ var borderColor:uint;
+ var borderThickness:uint = 0;
+ var borderStyle:String = "none";
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(host, "border", state);
+ if (borderStyles is Array)
+ {
+ borderColor = CSSUtils.toColor(borderStyles[2]);
+ borderStyle = borderStyles[1];
+ borderThickness = borderStyles[0];
+ needBorderColor = false;
+ }
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
+ var value:Object = ValuesManager.valuesImpl.getValue(host, "border-style", state);
+ if (value != null)
+ borderStyle = value as String;
+ value = ValuesManager.valuesImpl.getValue(host, "border-color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ else if (needBorderColor)
+ {
+ value = ValuesManager.valuesImpl.getValue(host, "color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ }
+ // if alpha = 0; assume that alpha just wasn't specified
+ if ((borderColor & 0xFF000000) == 0)
+ borderColor = borderColor | 0xFF000000;
+ value = ValuesManager.valuesImpl.getValue(host, "border-width", state);
+ if (value != null)
+ borderThickness = value as uint;
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(host, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = value as Number;
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ }
+ }
+ if (borderStyle == "none" && isNaN(borderEllipseWidth))
+ {
+ var n:int;
+ var values:Array;
+ var colorTop:uint;
+ var colorLeft:uint;
+ var colorRight:uint;
+ var colorBottom:uint;
+ var widthTop:int = -1;
+ var widthLeft:int = -1;
+ var widthBottom:int = -1;
+ var widthRight:int = -1;
+ value = ValuesManager.valuesImpl.getValue(host, "border-top", state);
+ if (value != null)
+ {
+ if (value is Array)
+ values = value as Array;
+ else
+ values = value.split(" ");
+ n = values.length;
+ widthTop = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorTop = CSSUtils.toColorWithAlpha(values[2]);
+ else
+ colorTop = borderColor;
+ }
+ value = ValuesManager.valuesImpl.getValue(host, "border-left", state);
+ if (value != null)
+ {
+ if (value is Array)
+ values = value as Array;
+ else
+ values = value.split(" ");
+ n = values.length;
+ widthLeft = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorLeft = CSSUtils.toColorWithAlpha(values[2]);
+ else
+ colorLeft = borderColor;
+ }
+ value = ValuesManager.valuesImpl.getValue(host, "border-bottom", state);
+ if (value != null)
+ {
+ if (value is Array)
+ values = value as Array;
+ else
+ values = value.split(" ");
+ n = values.length;
+ widthBottom = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorBottom = CSSUtils.toColorWithAlpha(values[2]);
+ else
+ colorBottom = borderColor;
+ }
+ value = ValuesManager.valuesImpl.getValue(host, "border-right", state);
+ if (value != null)
+ {
+ if (value is Array)
+ values = value as Array;
+ else
+ values = value.split(" ");
+ n = values.length;
+ widthRight = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorRight = CSSUtils.toColorWithAlpha(values[2]);
+ else
+ colorRight = borderColor;
+ }
+ SolidBorderUtil.drawDetailedBorder(g, 0, 0, width, height,
+ colorTop, colorRight, colorBottom, colorLeft,
+ widthTop, widthRight, widthBottom, widthLeft);
+ }
+ else
+ {
+ if (borderStyle == "none")
+ borderThickness = 0;
+ var backgroundColor:Object = null;
+ if (drawBackground)
+ {
+ value = ValuesManager.valuesImpl.getValue(host, "background-color", state);
+ if (value != null)
+ backgroundColor = CSSUtils.toColorWithAlpha(value);
+ }
+ SolidBorderUtil.drawBorder(g,
+ 0, 0, width, height,
+ borderColor, backgroundColor, borderThickness, 1,
+ borderEllipseWidth, borderEllipseHeight);
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
index bb290b6..3dbee10 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
@@ -96,7 +96,7 @@ package org.apache.flex.utils
public static function toColorWithAlpha(value:Object):uint
{
if (!(value is String))
- return uint(value);
+ return uint(value) | 0xFF000000; // css parser converted #rrggbb without alpha channel
var c:int;
var c2:int;
@@ -108,6 +108,8 @@ package org.apache.flex.utils
return uint("0x" + stringValue.charAt(1) + stringValue.charAt(1) +
stringValue.charAt(2) + stringValue.charAt(2) +
stringValue.charAt(3) + stringValue.charAt(3));
+ if (stringValue.length == 7)
+ return uint("0xFF" + stringValue.substr(1));
return uint("0x" + stringValue.substr(1));
}
else if ((c = stringValue.indexOf("rgb(")) != -1)
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index 59c0fcf..d814a2a 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -130,44 +130,58 @@ public class SolidBorderUtil
{
g.lineStyle(); // don't draw the line, it tends to get aligned on half-pixels
+ var color:uint;
+ var alpha:Number;
if (thicknessTop > 0)
{
- g.beginFill(colorTop & 0xFFFFFF, colorTop >> 24 / 255);
- g.moveTo(-thicknessLeft, -thicknessTop);
- g.lineTo(width + thicknessRight, -thicknessTop);
- g.lineTo(width, 0);
+ color = colorTop & 0xFFFFFF;
+ alpha = (colorTop >>> 24 & 0xFF) / 255;
+ g.beginFill(color, alpha);
+ g.moveTo(0, 0);
+ g.lineTo(width + thicknessRight + thicknessLeft, 0);
+ if (width > 0)
+ g.lineTo(width + thicknessLeft, thicknessTop);
+ g.lineTo(thicknessLeft, thicknessTop);
g.lineTo(0, 0);
- g.lineTo(-thicknessLeft, -thicknessTop);
g.endFill();
}
if (thicknessLeft > 0)
{
- g.beginFill(colorLeft & 0xFFFFFF, colorLeft >> 24 / 255);
- g.moveTo(-thicknessLeft, -thicknessTop);
+ color = colorLeft & 0xFFFFFF;
+ alpha = (colorLeft >>> 24 & 0xFF) / 255;
+ g.beginFill(color, alpha);
+ g.moveTo(0, 0);
+ g.lineTo(thicknessLeft, thicknessTop);
+ if (height > 0)
+ g.lineTo(thicknessLeft, thicknessTop + height);
+ g.lineTo(0, height + thicknessBottom);
g.lineTo(0, 0);
- g.lineTo(0, height);
- g.lineTo(-thicknessLeft, height + thicknessBottom);
- g.lineTo(-thicknessLeft, -thicknessTop);
g.endFill();
}
if (thicknessRight > 0)
{
- g.beginFill(colorRight & 0xFFFFFF, colorRight >> 24 / 255);
- g.moveTo(width + thicknessRight, -thicknessTop);
- g.lineTo(width + thicknessRight, height + thicknessBottom);
- g.lineTo(width, height);
- g.lineTo(width, 0);
- g.lineTo(width + thicknessRight, -thicknessTop);
+ color = colorRight & 0xFFFFFF;
+ alpha = (colorRight >>> 24 & 0xFF) / 255;
+ g.beginFill(color, alpha);
+ g.moveTo(width + thicknessRight + thicknessLeft, 0);
+ g.lineTo(width + thicknessRight + thicknessLeft, height + thicknessBottom + thicknessTop);
+ if (height > 0)
+ g.lineTo(width + thicknessLeft, height + thicknessTop);
+ g.lineTo(width + thicknessLeft, thicknessTop);
+ g.lineTo(width + thicknessRight + thicknessLeft, 0);
g.endFill();
}
if (thicknessBottom > 0)
{
- g.beginFill(colorBottom & 0xFFFFFF, colorBottom >> 24 / 255);
- g.moveTo(-thicknessLeft, height + thicknessBottom);
- g.lineTo(0, height);
- g.lineTo(width, height);
- g.lineTo(width + thicknessRight, height + thicknessBottom);
- g.lineTo(-thicknessLeft, height + thicknessBottom);
+ color = colorBottom & 0xFFFFFF;
+ alpha = (colorBottom >>> 24 & 0xFF) / 255;
+ g.beginFill(color, alpha);
+ g.moveTo(0, height + thicknessBottom + thicknessTop);
+ g.lineTo(thicknessLeft, height + thicknessBottom);
+ if (width > 0)
+ g.lineTo(width + thicknessLeft, height + thicknessTop);
+ g.lineTo(width + thicknessRight + thicknessLeft + thicknessLeft, height + thicknessBottom);
+ g.lineTo(-0, height + thicknessRight + thicknessBottom);
g.endFill();
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 1f7eeb7..aa3ef9d 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -36,18 +36,6 @@
background-color: #fff;
}
-*:active
-{
- font-family: "Arial";
- font-size: 12px;
-}
-
-*:hover
-{
- font-family: "Arial";
- font-size: 12px;
-}
-
.flexjs *, . flexjs *:before, . flexjs *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
@@ -229,6 +217,7 @@ DateField {
}
.dropdown-menu {
+ position: absolute;
z-index: 1000;
min-width: 220px;
padding: 0;
@@ -238,6 +227,7 @@ DateField {
border: none;
border-radius: 4px;
box-shadow: none;
+ list-style: none;
}
.dropdown-menu-divider {
height: 2px;
@@ -248,10 +238,32 @@ DateField {
.dropdown-menu-item-renderer {
padding: 8px 16px;
line-height: 1.429;
+ font-size: inherit;
color: #606d7a;
+ background-color: transparent;
+}
+.dropdown-menu-item-renderer-selected {
+ padding: 8px 16px;
+ line-height: 1.875;
+ font-size: inherit;
+ color: #fff;
+ background-color: #1abc9c;
+}
+.dropdown-menu-item-renderer:hover {
+ font-size: inherit;
+ color: #55606c;
+ background-color: rgba(202, 206, 209, .5);
}
.dropdown-toggle-open-btn {
+ border-radius: 4px;
+ color: #fff;
+ background-color: #1abc9c;
+ border-color: #1abc9c;
+ }
+
+.dropdown-toggle-open-btn:hover {
+ border-radius: 4px;
color: #fff;
background-color: #48c9b0;
border-color: #48c9b0;
@@ -259,6 +271,8 @@ DateField {
.dropdown-caret {
display: inline-block;
+ color: inherit;
+ background-color: inherit;
width: 0;
height: 0;
margin-left: 5px;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
index c41bbd7..72038e1 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -158,7 +158,7 @@ package org.apache.flex.html.beads
bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
if (bgColor & 0xFF000000)
{
- bgAlpha = bgColor >> 24 / 255;
+ bgAlpha = bgColor >>> 24 / 255;
bgColor = bgColor & 0xFFFFFF;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index 866259e..0ee0b8d 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -213,7 +213,7 @@ package org.apache.flex.html.beads
bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
if (bgColor & 0xFF000000)
{
- bgAlpha = bgColor >> 24 / 255;
+ bgAlpha = bgColor >>> 24 / 255;
bgColor = bgColor & 0xFFFFFF;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
index d2a4945..30df676 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
@@ -28,15 +28,18 @@ package org.apache.flex.html.beads
import org.apache.flex.core.BeadViewBase;
import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.CSSShape;
+ import org.apache.flex.core.CSSSprite;
import org.apache.flex.core.IBeadView;
import org.apache.flex.core.IPopUpHost;
import org.apache.flex.core.ISelectionModel;
import org.apache.flex.core.IStrand;
import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.IUIBase;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
-
+
/**
* The DropDownListView class is the default view for
* the org.apache.flex.html.DropDownList class.
@@ -61,71 +64,45 @@ package org.apache.flex.html.beads
*/
public function DropDownListView()
{
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
+ upSprite = new CSSSprite();
+ upSprite.className = 'dropdown-toggle-open-btn';
+ downSprite = new CSSSprite();
+ downSprite.className = 'dropdown-toggle-open-btn';
+ overSprite = new CSSSprite();
+ overSprite.className = 'dropdown-toggle-open-btn';
+ overSprite.state = 'hover';
upTextField = new CSSTextField();
downTextField = new CSSTextField();
overTextField = new CSSTextField();
upSprite.addChild(upTextField);
overSprite.addChild(overTextField);
downSprite.addChild(downTextField);
- upTextField.border = true;
- downTextField.border = true;
- overTextField.border = true;
- upTextField.background = true;
- downTextField.background = true;
- overTextField.background = true;
- upTextField.borderColor = 0;
- downTextField.borderColor = 0;
- overTextField.borderColor = 0;
- upTextField.backgroundColor = 0xEEEEEE;
- downTextField.backgroundColor = 0x808080;
- overTextField.backgroundColor = 0xFFFFFF;
upTextField.selectable = false;
+ upTextField.parentDrawsBackground = true;
upTextField.type = TextFieldType.DYNAMIC;
downTextField.selectable = false;
+ downTextField.parentDrawsBackground = true;
downTextField.type = TextFieldType.DYNAMIC;
overTextField.selectable = false;
+ overTextField.parentDrawsBackground = true;
overTextField.type = TextFieldType.DYNAMIC;
// auto-size collapses if no text
//upTextField.autoSize = "left";
//downTextField.autoSize = "left";
//overTextField.autoSize = "left";
- upArrows = new Shape();
- overArrows = new Shape();
- downArrows = new Shape();
+ upArrows = new CSSShape();
+ upArrows.className = 'dropdown-caret';
+ overArrows = new CSSShape();
+ overArrows.className = 'dropdown-caret';
+ downArrows = new CSSShape();
+ downArrows.className = 'dropdown-caret';
upSprite.addChild(upArrows);
overSprite.addChild(overArrows);
downSprite.addChild(downArrows);
- drawArrows(upArrows, 0xEEEEEE);
- drawArrows(overArrows, 0xFFFFFF);
- drawArrows(downArrows, 0x808080);
}
- private function drawArrows(shape:Shape, color:uint):void
- {
- var g:Graphics = shape.graphics;
- g.beginFill(color);
- g.drawRect(0, 0, 16, 17);
- g.endFill();
- g.beginFill(0);
- g.moveTo(8, 2);
- g.lineTo(12, 6);
- g.lineTo(4, 6);
- g.lineTo(8, 2);
- g.endFill();
- g.beginFill(0);
- g.moveTo(8, 14);
- g.lineTo(12, 10);
- g.lineTo(4, 10);
- g.lineTo(8, 14);
- g.endFill();
- g.lineStyle(1, 0);
- g.drawRect(0, 0, 16, 17);
- }
private var selectionModel:ISelectionModel;
@@ -176,15 +153,29 @@ package org.apache.flex.html.beads
{
var ww:Number = DisplayObject(_strand).width;
var hh:Number = DisplayObject(_strand).height;
+ upArrows.draw(0, 0);
+ overArrows.draw(0, 0);
+ downArrows.draw(0, 0);
+ upSprite.draw(ww, hh);
+ overSprite.draw(ww, hh);
+ downSprite.draw(ww, hh);
+
upArrows.x = ww - upArrows.width;
overArrows.x = ww - overArrows.width;
downArrows.x = ww - downArrows.width;
+ upArrows.y = (hh - upArrows.height) / 2;
+ overArrows.y = (hh - overArrows.height) / 2;
+ downArrows.y = (hh - downArrows.height) / 2;
+
upTextField.width = upArrows.x;
downTextField.width = downArrows.x;
overTextField.width = overArrows.x;
- upTextField.height = hh;
- downTextField.height = hh;
- overTextField.height = hh;
+ upTextField.height = upTextField.textHeight + 5;
+ downTextField.height = downTextField.textHeight + 5;
+ overTextField.height = overTextField.textHeight + 5;
+ upTextField.y = (hh - upTextField.height) / 2;
+ downTextField.y = (hh - downTextField.height) / 2;
+ overTextField.y = (hh - overTextField.height) / 2;
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
shape.graphics.drawRect(0, 0, ww, hh);
@@ -194,12 +185,12 @@ package org.apache.flex.html.beads
private var upTextField:CSSTextField;
private var downTextField:CSSTextField;
private var overTextField:CSSTextField;
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var upArrows:Shape;
- private var downArrows:Shape;
- private var overArrows:Shape;
+ private var upSprite:CSSSprite;
+ private var downSprite:CSSSprite;
+ private var overSprite:CSSSprite;
+ private var upArrows:CSSShape;
+ private var downArrows:CSSShape;
+ private var overArrows:CSSShape;
/**
* The text that is displayed in the view.
@@ -224,7 +215,12 @@ package org.apache.flex.html.beads
upTextField.text = value;
downTextField.text = value;
overTextField.text = value;
-
+ upTextField.height = upTextField.textHeight + 5;
+ downTextField.height = downTextField.textHeight + 5;
+ overTextField.height = overTextField.textHeight + 5;
+ upTextField.y = (hh - upTextField.height) / 2;
+ downTextField.y = (hh - downTextField.height) / 2;
+ overTextField.y = (hh - overTextField.height) / 2;
}
private var _popUp:IStrand;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
index 6a39157..49f3608 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
@@ -27,9 +27,7 @@ package org.apache.flex.html.beads
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.SolidBorderUtil;
- import org.apache.flex.utils.StringTrimmer;
+ import org.apache.flex.utils.CSSBorderUtils;
/**
* The SingleLineBorderBead class draws a single line solid border.
@@ -86,110 +84,8 @@ package org.apache.flex.html.beads
var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
if( this == gd ) g.clear();
-
- var borderColor:uint;
- var borderThickness:uint;
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
- if (borderStyles is Array)
- {
- borderColor = CSSUtils.toColor(borderStyles[2]);
- borderStyle = borderStyles[1];
- borderThickness = borderStyles[0];
- }
- else if (borderStyles is String)
- borderStyle = borderStyles as String;
- var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
- if (value != null)
- borderStyle = value as String;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
- if (value != null)
- borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
- if (value != null)
- borderThickness = value as uint;
- var borderRadius:String;
- var borderEllipseWidth:Number = NaN;
- var borderEllipseHeight:Number = NaN;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
- if (value != null)
- {
- if (value is Number)
- borderEllipseWidth = value as Number;
- else
- {
- borderRadius = value as String;
- var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = CSSUtils.toNumber(arr[0]);
- if (arr.length > 1)
- borderEllipseHeight = CSSUtils.toNumber(arr[1]);
- }
- }
- if (borderStyle == "none")
- {
- var n:int;
- var values:Array;
- var colorTop:uint;
- var colorLeft:uint;
- var colorRight:uint;
- var colorBottom:uint;
- var widthTop:int = -1;
- var widthLeft:int = -1;
- var widthBottom:int = -1;
- var widthRight:int = -1;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-top", state);
- if (value != null)
- {
- values = value.split(" ");
- n = values.length;
- widthTop = CSSUtils.toNumber(values[0]);
- // assume solid for now
- if (n > 2)
- colorTop = CSSUtils.toColorWithAlpha(values[2]);
- }
- value = ValuesManager.valuesImpl.getValue(_strand, "border-left", state);
- if (value != null)
- {
- values = value.split(" ");
- n = values.length;
- widthLeft = CSSUtils.toNumber(values[0]);
- // assume solid for now
- if (n > 2)
- colorLeft = CSSUtils.toColorWithAlpha(values[2]);
- }
- value = ValuesManager.valuesImpl.getValue(_strand, "border-bottom", state);
- if (value != null)
- {
- values = value.split(" ");
- n = values.length;
- widthBottom = CSSUtils.toNumber(values[0]);
- // assume solid for now
- if (n > 2)
- colorBottom = CSSUtils.toColorWithAlpha(values[2]);
- }
- value = ValuesManager.valuesImpl.getValue(_strand, "border-right", state);
- if (value != null)
- {
- values = value.split(" ");
- n = values.length;
- widthRight = CSSUtils.toNumber(values[0]);
- // assume solid for now
- if (n > 2)
- colorRight = CSSUtils.toColorWithAlpha(values[2]);
- }
- SolidBorderUtil.drawDetailedBorder(g, 0, 0, w, h,
- colorTop, colorRight, colorBottom, colorLeft,
- widthTop, widthRight, widthBottom, widthLeft);
- }
- else
- {
- borderThickness = 0;
- SolidBorderUtil.drawBorder(g,
- 0, 0, w, h,
- borderColor, null, borderThickness, 1,
- borderEllipseWidth, borderEllipseHeight);
- }
+ CSSBorderUtils.draw(g, w, h, host, state, false, false);
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
index ffa5502..8c755de 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
@@ -86,6 +86,12 @@ package org.apache.flex.html.beads
if( bgAlpha != null ) {
opacity = Number(bgAlpha);
}
+
+ var corner:Object = ValuesManager.valuesImpl.getValue(host, "border-radius");
+ if( corner != null ) {
+ borderRadius = Number(corner);
+ }
+
changeHandler(null);
}
@@ -139,6 +145,31 @@ package org.apache.flex.html.beads
changeHandler(null);
}
+ private var _borderRadius:Number;
+
+ /**
+ * The opacity (alpha).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get borderRadius():Number
+ {
+ return _borderRadius;
+ }
+
+ /**
+ * @private
+ */
+ public function set borderRadius(value:Number):void
+ {
+ _borderRadius = value;
+ if( _strand )
+ changeHandler(null);
+ }
+
private function changeHandler(event:Event):void
{
var g:Graphics = Sprite(host).graphics;
@@ -149,7 +180,10 @@ package org.apache.flex.html.beads
if( this == gd ) g.clear();
g.beginFill(backgroundColor,opacity);
- g.drawRect(0, 0, w, h);
+ if (isNaN(borderRadius))
+ g.drawRect(0, 0, w, h);
+ else
+ g.drawRoundRect(0, 0, w, h, borderRadius);
g.endFill();
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
index 48d9a6a..cc295fc 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
@@ -82,8 +82,7 @@ package org.apache.flex.html.beads.controllers
popUpModel.dataProvider = selectionModel.dataProvider;
popUpModel.selectedIndex = selectionModel.selectedIndex;
DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
- DisplayObject(viewBead.popUp).height = 200;
- var pt:Point = new Point(DisplayObject(_strand).x, DisplayObject(_strand).y);
+ var pt:Point = new Point(DisplayObject(_strand).x, DisplayObject(_strand).y + DisplayObject(_strand).height);
pt = DisplayObject(_strand).parent.localToGlobal(pt);
DisplayObject(viewBead.popUp).x = pt.x;
DisplayObject(viewBead.popUp).y = pt.y;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
index b2a8a14..199744b 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
@@ -58,6 +58,7 @@ package org.apache.flex.html.supportClasses
public function DropDownListList()
{
super();
+ className = "dropdown-menu";
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9d1950f5/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
index df61633..ed89c9a 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
@@ -83,14 +83,14 @@ org.apache.flex.html.DropDownList.prototype.selectChanged =
function(event) {
var select;
- select = event.currentTarget;
+ select = event.target;
- this.selectedItem = select.options[select.selectedIndex].value;
+ this.selectedIndex = parseInt(select.id, 10);
- this.popup.parentNode.removeChild(this.popup);
- this.popup = null;
+ this.menu.parentNode.removeChild(this.menu);
+ this.menu = null;
- this.dispatchEvent(event);
+ this.dispatchEvent('change');
};
@@ -101,9 +101,9 @@ org.apache.flex.html.DropDownList.prototype.selectChanged =
org.apache.flex.html.DropDownList.prototype.dismissPopup =
function(opt_event) {
// remove the popup if it already exists
- if (this.popup) {
- this.popup.parentNode.removeChild(this.popup);
- this.popup = null;
+ if (this.menu) {
+ this.menu.parentNode.removeChild(this.menu);
+ this.menu = null;
}
};
@@ -135,6 +135,7 @@ org.apache.flex.html.DropDownList.prototype.buttonClicked =
left = pn.offsetLeft;
width = pn.offsetWidth;
+ /*
popup = document.createElement('div');
popup.className = 'dropdown-menu';
popup.id = 'test';
@@ -145,40 +146,40 @@ org.apache.flex.html.DropDownList.prototype.buttonClicked =
popup.style.margin = '0px auto';
popup.style.padding = '0px';
popup.style.zIndex = '10000';
+ */
- this.menu = select = document.createElement('select');
+ this.menu = select = document.createElement('ul');
select.style.width = width.toString() + 'px';
- goog.events.listen(select, 'change', goog.bind(this.selectChanged, this));
- opts = select.options;
+ goog.events.listen(select, 'click', goog.bind(this.selectChanged, this));
+ select.className = 'dropdown-menu';
dp = /** @type {Array.<string>} */ (this.dataProvider);
n = dp.length;
for (i = 0; i < n; i++) {
- opt = document.createElement('option');
- opt.className = 'dropdown-menu-item-renderer';
- opt.text = dp[i];
- opts.add(opt);
- }
-
- select.size = n;
-
- si = this.selectedIndex;
- if (si < 0) {
- select.value = null;
- } else {
- select.value = dp[si];
+ opt = document.createElement('li');
+ opt.style.backgroundColor = 'transparent';
+ var ir = document.createElement('a');
+ ir.innerHTML = dp[i];
+ ir.id = i.toString();
+ if (i == this.selectedIndex)
+ ir.className = 'dropdown-menu-item-renderer-selected';
+ else
+ ir.className = 'dropdown-menu-item-renderer';
+ opt.appendChild(ir);
+ select.appendChild(opt);
}
- this.popup = popup;
-
- popup.appendChild(select);
- document.body.appendChild(popup);
+ this.element.appendChild(select);
};
Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
dataProvider: {
/** @this {org.apache.flex.html.DropDownList} */
+ get: function() {
+ return this.model.dataProvider;
+ },
+ /** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
var dp, i, n, opt;
[32/36] git commit: [flex-asjs] [refs/heads/develop] - fix border on
flat dropdown
Posted by ah...@apache.org.
fix border on flat dropdown
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0763bbbe
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0763bbbe
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0763bbbe
Branch: refs/heads/develop
Commit: 0763bbbe4535190a4a44106f679e1a3badc912ab
Parents: f6e65fd
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 28 06:55:35 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 28 06:55:35 2015 -0700
----------------------------------------------------------------------
frameworks/projects/Flat/as/defaults.css | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0763bbbe/frameworks/projects/Flat/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/defaults.css b/frameworks/projects/Flat/as/defaults.css
index 5a92621..ef89360 100644
--- a/frameworks/projects/Flat/as/defaults.css
+++ b/frameworks/projects/Flat/as/defaults.css
@@ -568,6 +568,11 @@ DropDownListList
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
IItemRenderer: ClassReference("org.apache.flex.flat.supportClasses.DropDownListStringItemRenderer");
+ border-style: solid;
+ border-radius: 4px;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
}
Image
[23/36] git commit: [flex-asjs] [refs/heads/develop] - flat-ui like
look for text area and scrollbar
Posted by ah...@apache.org.
flat-ui like look for text area and scrollbar
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0f63a710
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0f63a710
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0f63a710
Branch: refs/heads/develop
Commit: 0f63a710cb028f70a19812fa15d1cf6ce2a80aca
Parents: 94a189b
Author: Alex Harui <ah...@apache.org>
Authored: Sun Jul 26 08:39:31 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Jul 26 08:39:31 2015 -0700
----------------------------------------------------------------------
.../src/org/apache/flex/utils/CSSBorderUtils.as | 8 +-
.../as/src/org/apache/flex/utils/CSSUtils.as | 12 +
.../org/apache/flex/utils/SolidBorderUtil.as | 6 +-
frameworks/projects/HTML/as/defaults.css | 98 +++++++-
frameworks/projects/HTML/as/src/HTMLClasses.as | 5 +-
.../org/apache/flex/html/beads/CSSButtonView.as | 122 ++++------
.../flex/html/beads/CSSScrollBarButtonView.as | 182 ++++++++++++++
.../apache/flex/html/beads/CSSScrollBarView.as | 240 +++++++++++++++++++
.../flex/html/beads/layouts/VScrollBarLayout.as | 6 +-
.../DropDownListStringItemRenderer.as | 70 ++++++
10 files changed, 654 insertions(+), 95 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
index 5a80e31..ccc8466 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
@@ -127,10 +127,10 @@ package org.apache.flex.utils
var colorLeft:uint;
var colorRight:uint;
var colorBottom:uint;
- var widthTop:int = -1;
- var widthLeft:int = -1;
- var widthBottom:int = -1;
- var widthRight:int = -1;
+ var widthTop:int = 0;
+ var widthLeft:int = 0;
+ var widthBottom:int = 0;
+ var widthRight:int = 0;
value = ValuesManager.valuesImpl.getValue(host, "border-top", state);
if (value != null)
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
index 3dbee10..10dad30 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
@@ -157,6 +157,9 @@ package org.apache.flex.utils
if (value is Number)
return value as Number;
+ if (values is Number)
+ return values as Number;
+
if (value != null)
return toNumber(value as String, reference);
if (values == null)
@@ -194,6 +197,9 @@ package org.apache.flex.utils
if (value is Number)
return value as Number;
+ if (values is Number)
+ return values as Number;
+
if (value != null)
return toNumber(value as String, reference);
if (values == null)
@@ -228,6 +234,9 @@ package org.apache.flex.utils
if (value is Number)
return value as Number;
+ if (values is Number)
+ return values as Number;
+
if (value != null)
return toNumber(value as String, reference);
if (values == null)
@@ -262,6 +271,9 @@ package org.apache.flex.utils
if (value is Number)
return value as Number;
+ if (values is Number)
+ return values as Number;
+
if (value != null)
return toNumber(value as String, reference);
if (values == null)
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index d814a2a..2c11b13 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -177,11 +177,11 @@ public class SolidBorderUtil
alpha = (colorBottom >>> 24 & 0xFF) / 255;
g.beginFill(color, alpha);
g.moveTo(0, height + thicknessBottom + thicknessTop);
- g.lineTo(thicknessLeft, height + thicknessBottom);
+ g.lineTo(thicknessLeft, height + thicknessTop);
if (width > 0)
g.lineTo(width + thicknessLeft, height + thicknessTop);
- g.lineTo(width + thicknessRight + thicknessLeft + thicknessLeft, height + thicknessBottom);
- g.lineTo(-0, height + thicknessRight + thicknessBottom);
+ g.lineTo(width + thicknessRight + thicknessLeft, height + thicknessBottom + thicknessTop);
+ g.lineTo(0, height + thicknessBottom + thicknessTop);
g.endFill();
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index ab99e2b..0344efc 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -436,6 +436,14 @@ StringItemRenderer
height: 16;
}
+TextArea
+{
+ padding: 6px 10px;
+ font-size: 13px;
+ border-radius: 6px;
+ border: 2px solid #1abc9c;
+}
+
TextInput
{
height: 35px;
@@ -555,7 +563,7 @@ DropDownListList
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.DropDownListStringItemRenderer");
}
Image
@@ -626,11 +634,97 @@ RadioButton
IBeadView: ClassReference("org.apache.flex.html.beads.RadioCSSContentAndTextToggleButtonView");
}
+.vscrollbar-uparrow {
+ padding: 0px;
+ display: inline-block;
+ border-color: #16a085;
+ border-radius: initial;
+ background-color: transparent;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-bottom: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+.vscrollbar-downarrow-btn {
+ padding: 2px;
+ display: inline-block;
+ border-style: none;
+ border-radius: initial;
+ background-color: transparent;
+ width: 12;
+ height: 12;
+ margin-left: 5px;
+ vertical-align: middle;
+ }
+.vscrollbar-uparrow-btn {
+ padding: 2px;
+ display: inline-block;
+ border-style: none;
+ border-radius: initial;
+ background-color: transparent;
+ width: 12;
+ height: 12;
+ margin-left: 5px;
+ vertical-align: middle;
+ }
+.vscrollbar-downarrow {
+ padding: 0px;
+ display: inline-block;
+ border-color: #16a085;
+ border-radius: initial;
+ background-color: transparent;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-top: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+.vscrollbar-track {
+ padding: 0px;
+ position: relative;
+ width: 8px;
+ height: 8px;
+ /*margin-bottom: 20px;*/
+ cursor: pointer;
+ background-color: #ebedef;
+ border-radius: 4px;
+ /*border-radius: 32px;*/
+ box-shadow: none;
+ }
+.vscrollbar-thumb {
+ padding: 0px;
+ position: absolute;
+ z-index: 2;
+ width: 12px;
+ height: 12px;
+ cursor: pointer;
+ background-color: #16a085;
+ border-radius: 6px;
+ -webkit-transition: background .25s;
+ transition: background .25s;
+ }
+.vscrollbar-thumb:hover {
+ background-color: #48c9b0;
+ outline: none;
+ }
+.vscrollbar-thumb:active {
+ background-color: #16a085;
+ }
+
ScrollBar
{
IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.ScrollBarView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSScrollBarView");
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/HTMLClasses.as b/frameworks/projects/HTML/as/src/HTMLClasses.as
index e48bfe0..b1bf557 100644
--- a/frameworks/projects/HTML/as/src/HTMLClasses.as
+++ b/frameworks/projects/HTML/as/src/HTMLClasses.as
@@ -52,7 +52,9 @@ internal class HTMLClasses
import org.apache.flex.html.beads.PanelView; PanelView;
import org.apache.flex.html.beads.PanelWithControlBarView; PanelWithControlBarView;
import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
- import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
+ import org.apache.flex.html.beads.CSSScrollBarView; CSSScrollBarView;
+ import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
+ import org.apache.flex.html.beads.CSSScrollBarButtonView; CSSScrollBarButtonView;
import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
import org.apache.flex.html.beads.SingleLineBorderBead; SingleLineBorderBead;
import org.apache.flex.html.beads.SliderView; SliderView;
@@ -96,6 +98,7 @@ internal class HTMLClasses
import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
+ import org.apache.flex.html.supportClasses.DropDownListStringItemRenderer; DropDownListStringItemRenderer;
import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
import org.apache.flex.html.supportClasses.Viewport; Viewport;
import org.apache.flex.html.supportClasses.ScrollingViewport; ScrollingViewport;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
index 72038e1..fcd14cc 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -19,21 +19,23 @@
package org.apache.flex.html.beads
{
import flash.display.DisplayObject;
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.SolidBorderUtil;
- import org.apache.flex.utils.StringTrimmer;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.CSSBorderUtils;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.StringTrimmer;
/**
* The CSSButtonView class is the default view for
@@ -92,54 +94,26 @@ package org.apache.flex.html.beads
setupBackground(overSprite, "hover");
setupBackground(downSprite, "active");
setupBackground(upSprite);
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
}
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, "hover");
+ setupSkin(downSprite, "active");
+ setupSkin(upSprite);
+ updateHitArea();
+ }
+
private function setupSkin(sprite:Sprite, state:String = null):void
{
- var borderColor:uint;
- var borderThickness:uint;
- var borderStyle:String;
- var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
- if (borderStyles is Array)
- {
- borderColor = CSSUtils.toColor(borderStyles[2]);
- borderStyle = borderStyles[1];
- borderThickness = borderStyles[0];
- }
- else if (borderStyles is String)
- borderStyle = borderStyles as String;
- var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
- if (value != null)
- borderStyle = value as String;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
- if (value != null)
- borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
- if (value != null)
- borderThickness = value as uint;
- if (borderStyle == "none")
- {
- borderStyle = "solid";
- borderThickness = 0;
- }
-
- var borderRadius:String;
- var borderEllipseWidth:Number = NaN;
- var borderEllipseHeight:Number = NaN;
- value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
- if (value != null)
- {
- if (value is Number)
- borderEllipseWidth = value as Number;
- else
- {
- borderRadius = value as String;
- var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = CSSUtils.toNumber(arr[0]);
- if (arr.length > 1)
- borderEllipseHeight = CSSUtils.toNumber(arr[1]);
- }
- }
var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
@@ -150,27 +124,11 @@ package org.apache.flex.html.beads
var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(_strand, "background-color", state);
- var bgColor:uint;
- var bgAlpha:Number = 1;
- if (backgroundColor != null)
- {
- bgColor = CSSUtils.toColorWithAlpha(backgroundColor);
- if (bgColor & 0xFF000000)
- {
- bgAlpha = bgColor >>> 24 / 255;
- bgColor = bgColor & 0xFFFFFF;
- }
- }
- if (borderStyle == "solid")
- {
- sprite.graphics.clear();
- SolidBorderUtil.drawBorder(sprite.graphics,
- 0, 0, sprite.width + pl + pr,
- sprite.height + pt + pb,
- borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
- borderEllipseWidth, borderEllipseHeight);
- }
+ CSSBorderUtils.draw(sprite.graphics,
+ DisplayObject(_strand).width + pl + pr,
+ DisplayObject(_strand).height + pt + pb,
+ _strand as DisplayObject,
+ state, true);
}
private function setupBackground(sprite:Sprite, state:String = null):void
@@ -187,6 +145,10 @@ package org.apache.flex.html.beads
updateHitArea();
});
}
+ else {
+ setupSkin(sprite, state);
+ updateHitArea();
+ }
}
private var upSprite:Sprite;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as
new file mode 100644
index 0000000..aa3d25e
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as
@@ -0,0 +1,182 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSShape;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.CSSBorderUtils;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSButtonView class is the default view for
+ * the org.apache.flex.html.Button class.
+ * It allows the look of the button to be expressed
+ * in CSS via the background-image style. This view
+ * does not display text. Use CSSTextButtonView and
+ * TextButton instead.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSScrollBarButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSScrollBarButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upArrowShape = new CSSShape();
+ downArrowShape = new CSSShape();
+ overArrowShape = new CSSShape();
+ overArrowShape.state = "hover";
+ upSprite.addChild(upArrowShape);
+ downSprite.addChild(downArrowShape);
+ overSprite.addChild(overArrowShape);
+ }
+
+ private var textModel:ITextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+
+ setupBackground(overSprite, overArrowShape, "hover");
+ setupBackground(downSprite, downArrowShape, "active");
+ setupBackground(upSprite, upArrowShape);
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, overArrowShape, "hover");
+ setupSkin(downSprite, downArrowShape, "active");
+ setupSkin(upSprite, upArrowShape);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, shape:CSSShape, state:String = null):void
+ {
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ var w:Object = ValuesManager.valuesImpl.getValue(shape, "width", state);
+ var h:Object = ValuesManager.valuesImpl.getValue(shape, "height", state);
+ shape.draw(Number(w), Number(h));
+
+ CSSBorderUtils.draw(sprite.graphics,
+ shape.width + pl + pr,
+ shape.height + pt + pb,
+ _strand as DisplayObject,
+ state, true);
+ }
+
+ private function setupBackground(sprite:Sprite, shape:CSSShape, state:String = null):void
+ {
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ setupSkin(sprite, shape, state);
+ updateHitArea();
+ });
+ }
+ else {
+ setupSkin(sprite, shape, state);
+ updateHitArea();
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ public var upArrowShape:CSSShape;
+ public var downArrowShape:CSSShape;
+ public var overArrowShape:CSSShape;
+
+ private function updateHitArea():void
+ {
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
new file mode 100644
index 0000000..0d48de8
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
@@ -0,0 +1,240 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+
+ /**
+ * The ScrollBarView class is the default view for
+ * the org.apache.flex.html.supportClasses.ScrollBar class.
+ * It implements the classic desktop-like ScrollBar.
+ * A different view would implement more modern scrollbars that hide themselves
+ * until hovered over with the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSScrollBarView()
+ {
+ }
+
+ private var sbModel:IScrollBarModel;
+
+ private var _strand:IStrand;
+
+ /**
+ * The layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private var layout:IBeadLayout;
+
+ /**
+ * The host component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get host():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @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;
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel.addEventListener("maximumChange", changeHandler);
+ sbModel.addEventListener("minimumChange", changeHandler);
+ sbModel.addEventListener("snapIntervalChange", changeHandler);
+ sbModel.addEventListener("stepSizeChange", changeHandler);
+ sbModel.addEventListener("pageSizeChange", changeHandler);
+ sbModel.addEventListener("valueChange", changeHandler);
+
+ // TODO: (aharui) put in values impl
+ _increment = new Button();
+ Button(_increment).className = "vscrollbar-downarrow-btn";
+ var sbView:CSSScrollBarButtonView = new CSSScrollBarButtonView();
+ sbView.upArrowShape.className = "vscrollbar-downarrow";
+ sbView.downArrowShape.className = "vscrollbar-downarrow";
+ sbView.overArrowShape.className = "vscrollbar-downarrow";
+ Button(_increment).addBead(sbView);
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).className = "vscrollbar-uparrow-btn";
+ sbView = new CSSScrollBarButtonView();
+ sbView.upArrowShape.className = "vscrollbar-uparrow";
+ sbView.downArrowShape.className = "vscrollbar-uparrow";
+ sbView.overArrowShape.className = "vscrollbar-uparrow";
+ Button(_decrement).addBead(sbView);
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+ _track = new Button();
+ Button(_track).className = "vscrollbar-track";
+ _thumb = new Button();
+ Button(_thumb).className = "vscrollbar-thumb";
+
+ UIBase(value).addElement(_decrement);
+ UIBase(value).addElement(_increment);
+ UIBase(value).addElement(_track);
+ UIBase(value).addElement(_thumb);
+
+ IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
+
+ if( _strand.getBeadByType(IBeadLayout) == null ) {
+ layout = new (ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout")) as IBeadLayout;
+ _strand.addBead(layout);
+ }
+ layout.layout();
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ layout.layout();
+ }
+
+ private var _decrement:DisplayObject;
+ private var _increment:DisplayObject;
+ private var _track:DisplayObject;
+ private var _thumb:DisplayObject;
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#decrement
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get decrement():DisplayObject
+ {
+ return _decrement;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#increment
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get increment():DisplayObject
+ {
+ return _increment;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#track
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get track():DisplayObject
+ {
+ return _track;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#thumb
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get thumb():DisplayObject
+ {
+ return _thumb;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewHeight():Number
+ {
+ // don't want to put $height in an interface
+ return _strand["$height"];
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewWidth():Number
+ {
+ // don't want to put $width in an interface
+ return _strand["$width"];
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
index 081208c..603b9b7 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/layouts/VScrollBarLayout.as
@@ -91,15 +91,11 @@ package org.apache.flex.html.beads.layouts
decrement.x = 0;
decrement.y = 0;
- decrement.width = DisplayObject(_strand).width;
- decrement.height = decrement.width;
increment.x = 0;
- increment.width = DisplayObject(_strand).width;
- increment.height = increment.width;
increment.y = h - increment.height - 1;
- track.x = 0;
+ track.x = (thumb.width - track.width) / 2;
track.y = decrement.height;
track.height = increment.y - decrement.height;
thumb.height = sbModel.pageSize / (sbModel.maximum - sbModel.minimum) * track.height;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0f63a710/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
new file mode 100644
index 0000000..e1a95d5
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.supportClasses
+{
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.ITextItemRenderer;
+
+ /**
+ * The DropDownListStringItemRenderer is a StringItemRenderer with a particular
+ * className for use in DropDownList.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListStringItemRenderer extends StringItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListStringItemRenderer()
+ {
+ super();
+
+ className = 'dropdown-menu-item-renderer';
+ percentWidth = 90;
+ }
+
+ /**
+ * @private
+ */
+ override public function updateRenderer():void
+ {
+ className = selected ? 'dropdown-menu-item-renderer-selected' : 'dropdown-menu-item-renderer';
+ if (selected)
+ selectedColor = ValuesManager.valuesImpl.getValue(this, 'background-color');
+ if (hovered)
+ highlightColor = ValuesManager.valuesImpl.getValue(this, 'background-color', "hover");
+ downColor = selectedColor;
+ super.updateRenderer();
+ }
+ }
+}
[35/36] git commit: [flex-asjs] [refs/heads/develop] - HTML Inputs
default to 20 chars
Posted by ah...@apache.org.
HTML Inputs default to 20 chars
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/acfe9b72
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/acfe9b72
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/acfe9b72
Branch: refs/heads/develop
Commit: acfe9b72a37e102dd3fd9171da931566b7823177
Parents: 13cd202
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 28 11:30:36 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 28 11:30:36 2015 -0700
----------------------------------------------------------------------
frameworks/projects/HTML/as/defaults.css | 4 ---
.../apache/flex/html/beads/TextFieldViewBase.as | 14 ++++----
.../org/apache/flex/html/beads/TextInputView.as | 37 +++++++++++++++-----
3 files changed, 35 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/acfe9b72/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 062e2af..c0a8380 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -451,8 +451,6 @@ TextArea
border-color: #000000;
border-width: 1px;
background-color: #FFFFFF;
- width: 135;
- height: 20;
}
TextButton
@@ -479,8 +477,6 @@ TextInput
border-color: #000000;
border-width: 1px;
background-color: #FFFFFF;
- width: 135;
- height: 20;
}
TitleBar
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/acfe9b72/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
index 0bcae7f..f2214e2 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextFieldViewBase.as
@@ -102,7 +102,6 @@ package org.apache.flex.html.beads
html = _textModel.html;
var ilc:ILayoutChild = host as ILayoutChild;
-
autoHeight = ilc.isHeightSizedToContent();
autoWidth = ilc.isWidthSizedToContent();
if (!autoWidth && !isNaN(ilc.explicitWidth))
@@ -268,11 +267,11 @@ package org.apache.flex.html.beads
{
textField.autoSize = "none";
autoWidth = false;
- textField.width = DisplayObject(_strand).width;
+ textField.width = host.width;
if (autoHeight)
autoSizeIfNeeded()
else
- textField.height = DisplayObject(_strand).height;
+ textField.height = host.height;
}
}
@@ -282,30 +281,29 @@ package org.apache.flex.html.beads
{
textField.autoSize = "none";
autoHeight = false;
- textField.height = DisplayObject(_strand).height;
+ textField.height = host.height;
if (autoWidth)
autoSizeIfNeeded();
else
- textField.width = DisplayObject(_strand).width;
+ textField.width = host.width;
}
}
private function sizeChangeHandler(event:Event):void
{
var ilc:ILayoutChild = host as ILayoutChild;
-
autoHeight = ilc.isHeightSizedToContent();
if (!autoHeight)
{
textField.autoSize = "none";
- textField.height = DisplayObject(_strand).height;
+ textField.height = host.height;
}
autoWidth = ilc.isWidthSizedToContent();
if (!autoWidth)
{
textField.autoSize = "none";
- textField.width = DisplayObject(_strand).width;
+ textField.width = host.width;
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/acfe9b72/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
index 94bf426..63c1150 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
@@ -20,7 +20,8 @@ package org.apache.flex.html.beads
import flash.display.DisplayObject;
import flash.text.TextFieldType;
- import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ILayoutChild;
+ import org.apache.flex.core.IStrand;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
@@ -65,11 +66,31 @@ package org.apache.flex.html.beads
{
super.strand = value;
- // Default size
- var ww:Number = DisplayObject(host).width;
- if( isNaN(ww) || ww == 0 ) DisplayObject(host).width = 100;
- var hh:Number = DisplayObject(host).height;
- if( isNaN(hh) || hh == 0 ) DisplayObject(host).height = 18;
+ var w:Number;
+ var h:Number;
+ var ilc:ILayoutChild = host as ILayoutChild;
+
+ if (ilc.isWidthSizedToContent())
+ {
+ // use default width of 20
+ var s:String = textField.text;
+ textField.text = "0";
+ w = textField.textWidth * 20;
+ h = textField.textHeight + 4;
+ textField.text = s;
+ ilc.setWidth(w, true);
+ }
+ if (ilc.isHeightSizedToContent())
+ {
+ if (isNaN(h))
+ {
+ s = textField.text;
+ textField.text = "0";
+ h = textField.textHeight + 4;
+ textField.text = s;
+ }
+ ilc.setHeight(h, true);
+ }
IEventDispatcher(host).addEventListener("widthChanged", sizeChangedHandler);
IEventDispatcher(host).addEventListener("heightChanged", sizeChangedHandler);
@@ -78,10 +99,10 @@ package org.apache.flex.html.beads
private function sizeChangedHandler(event:Event):void
{
- var ww:Number = DisplayObject(host).width;
+ var ww:Number = host.width;
if( !isNaN(ww) && ww > 0 ) textField.width = ww;
- var hh:Number = DisplayObject(host).height;
+ var hh:Number = host.height;
if( !isNaN(hh) && hh > 0 )
{
textField.height = textField.textHeight + 5;
[24/36] git commit: [flex-asjs] [refs/heads/develop] - pick up styles
for TextArea
Posted by ah...@apache.org.
pick up styles for TextArea
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/56a9621e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/56a9621e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/56a9621e
Branch: refs/heads/develop
Commit: 56a9621edce71f58f12ea2d90e6739b1b548d225
Parents: 0f63a71
Author: Alex Harui <ah...@apache.org>
Authored: Sun Jul 26 22:48:46 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Jul 26 22:48:46 2015 -0700
----------------------------------------------------------------------
frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/56a9621e/frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js
index 128c9b8..3c7da17 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/TextArea.js
@@ -48,6 +48,8 @@ org.apache.flex.html.TextArea.prototype.createElement =
this.element = document.createElement('textarea');
this.positioner = this.element;
this.element.flexjs_wrapper = this;
+ this.element.className = 'TextArea';
+ this.typeNames = 'TextArea';
return this.element;
};
[13/36] git commit: [flex-asjs] [refs/heads/develop] - get
flatui-like look in both AS and JS Checkbox and RadioButton
Posted by ah...@apache.org.
get flatui-like look in both AS and JS Checkbox and RadioButton
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/574df850
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/574df850
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/574df850
Branch: refs/heads/develop
Commit: 574df850cbbd562fe4c3332184fbfe12952b44fb
Parents: 336c6d0
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 16 13:46:55 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 16 13:46:55 2015 -0700
----------------------------------------------------------------------
frameworks/projects/HTML/as/defaults.css | 139 +++++++++++++++----
.../beads/CSSContentAndTextToggleButtonView.as | 71 +++++-----
...CheckboxCSSContentAndTextToggleButtonView.as | 48 +++++++
.../RadioCSSContentAndTextToggleButtonView.as | 47 +++++++
frameworks/projects/HTML/basic-manifest.xml | 3 +-
.../js/src/org/apache/flex/html/CheckBox.js | 68 +++++++--
.../js/src/org/apache/flex/html/RadioButton.js | 53 ++++++-
7 files changed, 357 insertions(+), 72 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index e9ad38e..cd9389c 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -103,10 +103,73 @@ ButtonBarButtonItemRenderer
height: 30;
}
-CheckBox
+.checkbox-icon,
+.checkbox-icon-hover,
+.checkbox-icon-checked
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 20px;
+ height: 20px;
+ font-size: 20px;
+ line-height: 20px;
+ color: #bdc3c7;
+ text-align: center;
+ cursor: pointer;
+
+ /* .radio .icon-checked:before */
+ /* .radio .icon-unchecked:before */
+ font-family: 'Flat-UI-Icons';
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ font-size: 20px;
+ line-height: 20px;
+}
+
+.checkbox-icon:before
{
content: "\e60d";
+}
+
+.checkbox-icon-hover:before
+{
+ content: "\e60e";
+}
+
+.checkbox-icon-checked:before
+{
+ content: "\e60e";
+}
+.checkbox-icon-checked
+{
+ color: #1abc9c;
+}
+
+.checkbox-input
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ margin: 0;
+ outline: none !important;
+ opacity: 0;
+}
+
+CheckBox
+{
/* .checkbox */
position: relative;
padding-left: 32px;
@@ -117,16 +180,6 @@ CheckBox
transition: color .25s linear;
}
-CheckBox:hover
-{
- content: "\e60e";
-}
-
-CheckBox:checked
-{
- content: "\e60e";
-}
-
Container
{
IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
@@ -231,8 +284,22 @@ PanelWithControlBar
padding: 2px;
}
-.icon-checked
+.radio-icon,
+.radio-icon-hover,
+.radio-icon-checked
{
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 20px;
+ height: 20px;
+ font-size: 20px;
+ line-height: 20px;
+ color: #bdc3c7;
+ text-align: center;
+ cursor: pointer;
+
/* .radio .icon-checked:before */
/* .radio .icon-unchecked:before */
font-family: 'Flat-UI-Icons';
@@ -247,19 +314,43 @@ PanelWithControlBar
font-size: 20px;
line-height: 20px;
- color: #bdc3c7;
+}
+
+.radio-icon:before
+{
+ content: "\e60b";
+}
+.radio-icon-hover:before
+{
+ content: "\e60c";
}
-.icon-checked:checked
+.radio-icon-checked:before
+{
+ content: "\e60c";
+}
+
+.radio-icon-checked
{
color: #1abc9c;
}
-RadioButton
+.radio-input
{
- content: "\e60b";
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ margin: 0;
+ outline: none !important;
+ opacity: 0;
+}
+RadioButton
+{
/* .radio */
position: relative;
padding-left: 32px;
@@ -270,18 +361,6 @@ RadioButton
transition: color .25s linear;
}
-RadioButton:hover
-{
- content: "\e60c";
-
-}
-
-RadioButton:checked
-{
- content: "\e60c";
-
-}
-
SimpleList
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
@@ -374,7 +453,7 @@ Button
CheckBox
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSContentAndTextToggleButtonView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CheckboxCSSContentAndTextToggleButtonView");
}
CloseButton
@@ -488,7 +567,7 @@ PanelWithControlBar
RadioButton
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSContentAndTextToggleButtonView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.RadioCSSContentAndTextToggleButtonView");
}
ScrollBar
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
index 48eb9fe..40bb0c9 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
@@ -48,23 +48,33 @@ package org.apache.flex.html.beads
public class CSSContentAndTextToggleButtonView extends BeadViewBase implements IBeadView
{
/**
- * map of pseudo states.
+ * map of classname suffixes.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion FlexJS 0.0
*/
- private static var statesMap:Object = {
- "upSprite": null,
- "downSprite": "active",
- "overSprite": "hover",
- "upAndSelectedSprite": "checked",
- "downAndSelectedSprite": "checked",
- "overAndSelectedSprite": "checked"
+ private static var suffixMap:Object = {
+ "upSprite": "",
+ "downSprite": "-checked",
+ "overSprite": "-hover",
+ "upAndSelectedSprite": "-checked",
+ "downAndSelectedSprite": "-checked",
+ "overAndSelectedSprite": "-checked"
}
/**
+ * className to use for styling.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var className:String;
+
+ /**
* Constructor.
*
* @langversion 3.0
@@ -74,24 +84,6 @@ package org.apache.flex.html.beads
*/
public function CSSContentAndTextToggleButtonView()
{
- for (var p:String in statesMap)
- {
- var s:Sprite = new Sprite();
- sprites.push(s);
- this[p] = s;
-
- var tf:CSSTextField = new CSSTextField();
- tf.type = TextFieldType.DYNAMIC;
- tf.autoSize = TextFieldAutoSize.LEFT;
- tf.name = "textField";
- tf.parentHandlesPadding = true;
- var icon:StyleableCSSTextField = new StyleableCSSTextField();
- icon.name = "icon";
- icon.className = "icon-checked";
- icon.styleState = statesMap[p];
- s.addChild(icon);
- s.addChild(tf);
- }
}
private var upSprite:Sprite;
@@ -123,6 +115,24 @@ package org.apache.flex.html.beads
{
super.strand = value;
+ for (var p:String in suffixMap)
+ {
+ var s:Sprite = new Sprite();
+ sprites.push(s);
+ this[p] = s;
+
+ var tf:CSSTextField = new CSSTextField();
+ tf.type = TextFieldType.DYNAMIC;
+ tf.autoSize = TextFieldAutoSize.LEFT;
+ tf.name = "textField";
+ tf.parentHandlesPadding = true;
+ var icon:StyleableCSSTextField = new StyleableCSSTextField();
+ icon.name = "icon";
+ icon.className = className + suffixMap[p];
+ s.addChild(icon);
+ s.addChild(tf);
+ }
+
_toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
_toggleButtonModel.addEventListener("textChange", textChangeHandler);
_toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
@@ -267,22 +277,21 @@ package org.apache.flex.html.beads
protected function layoutControl() : void
{
// TODO: Layout using descendant selectors (.checkbox .icons)
- for (var p:String in statesMap)
+ for (var p:String in suffixMap)
{
var s:Sprite = this[p];
- var state:String = statesMap[p];
var icon:StyleableCSSTextField = s.getChildByName("icon") as StyleableCSSTextField;
icon.autoSize = TextFieldAutoSize.LEFT;
var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
icon.CSSParent = _strand;
- var content:String = ValuesManager.valuesImpl.getValue(_strand, "content", state);
+ var content:String = ValuesManager.valuesImpl.getValue(icon, "content", "before");
if (content != null)
icon.text = content;
var mh:Number = Math.max(icon.height,tf.height);
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left", state);
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left");
icon.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
icon.y = (mh - icon.height)/2;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..e38fd0d
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads
+{
+
+ /**
+ * The CheckboxCSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.html.Checkbox class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CheckboxCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CheckboxCSSContentAndTextToggleButtonView()
+ {
+ super();
+
+ className = "checkbox-icon";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..8d99f32
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads
+{
+ /**
+ * The RadioCSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.html.RadioButton class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RadioCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RadioCSSContentAndTextToggleButtonView()
+ {
+ super();
+
+ className = "radio-icon";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml b/frameworks/projects/HTML/basic-manifest.xml
index 74002c9..9066637 100644
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ b/frameworks/projects/HTML/basic-manifest.xml
@@ -74,7 +74,8 @@
<component id="HRule" class="org.apache.flex.html.HRule" />
<component id="Spacer" class="org.apache.flex.html.Spacer" />
<component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
- <component id="CSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.CSSContentAndTextToggleButtonView"/>
+ <component id="CheckboxCSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.CheckboxCSSContentAndTextToggleButtonView"/>
+ <component id="RadioCSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.RadioCSSContentAndTextToggleButtonView"/>
<component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" />
<component id="DataGrid" class="org.apache.flex.html.DataGrid"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
index f6232b4..89a129c 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
@@ -48,40 +48,90 @@ org.apache.flex.html.CheckBox.prototype.createElement =
this.element = document.createElement('label');
- cb = document.createElement('input');
- cb.type = 'checkbox';
- this.element.appendChild(cb);
- this.element.appendChild(document.createTextNode(''));
+ this.input = document.createElement('input');
+ this.input.type = 'checkbox';
+ this.input.className = 'checkbox-input';
+ this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
+ this.element.appendChild(this.input);
+
+ this.checkbox = document.createElement('span');
+ this.checkbox.className = 'checkbox-icon';
+ this.checkbox.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
+ this.checkbox.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
+ this.element.appendChild(this.checkbox);
+
+ this.textNode = document.createTextNode('');
+ this.element.appendChild(this.textNode);
+ this.element.className = 'CheckBox';
+ this.typeNames = 'CheckBox';
this.positioner = this.element;
- cb.flexjs_wrapper = this;
+ this.input.flexjs_wrapper = this;
+ this.checkbox.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
return this.element;
};
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.CheckBox.prototype.mouseOverHandler =
+ function(e) {
+ this.checkbox.className = 'checkbox-icon-hover';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.CheckBox.prototype.mouseOutHandler =
+ function(e) {
+ if (this.input.checked)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.CheckBox.prototype.selectionChangeHandler =
+ function(e) {
+ if (this.input.checked)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
+};
+
+
Object.defineProperties(org.apache.flex.html.CheckBox.prototype, {
/** @export */
text: {
/** @this {org.apache.flex.html.CheckBox} */
get: function() {
- return this.element.childNodes.item(1).nodeValue;
+ return this.textNode.nodeValue;
},
/** @this {org.apache.flex.html.CheckBox} */
set: function(value) {
- this.element.childNodes.item(1).nodeValue = value;
+ this.textNode.nodeValue = value;
}
},
/** @export */
selected: {
/** @this {org.apache.flex.html.CheckBox} */
get: function() {
- return this.element.childNodes.item(0).checked;
+ return this.input.checked;
},
/** @this {org.apache.flex.html.CheckBox} */
set: function(value) {
- this.element.childNodes.item(0).checked = value;
+ this.input.checked = value;
+ if (value)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
}
}
});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/574df850/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
index 5a108fb..7cbfe75 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
@@ -51,19 +51,33 @@ org.apache.flex.html.RadioButton.radioCounter = 0;
org.apache.flex.html.RadioButton.prototype.createElement =
function() {
+ // hide this eleement
this.input = document.createElement('input');
this.input.type = 'radio';
+ this.input.className = 'radio-input';
this.input.id = '_radio_' + org.apache.flex.html.RadioButton.radioCounter++;
+ this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
+
+ this.radio = document.createElement('span');
+ this.radio.className = 'radio-icon';
+ this.radio.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
+ this.radio.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
this.textNode = document.createTextNode('radio button');
this.labelFor = document.createElement('label');
this.labelFor.appendChild(this.input);
+ this.labelFor.appendChild(this.radio);
this.labelFor.appendChild(this.textNode);
+ this.labelFor.style.position = 'relative';
this.element = this.labelFor;
+ this.element.className = 'RadioButton';
+ this.typeNames = 'RadioButton';
+
this.positioner = this.element;
this.input.flexjs_wrapper = this;
+ this.radio.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
this.textNode.flexjs_wrapper = this;
@@ -72,6 +86,37 @@ org.apache.flex.html.RadioButton.prototype.createElement =
/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.RadioButton.prototype.mouseOverHandler =
+ function(e) {
+ this.radio.className = 'radio-icon-hover';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.RadioButton.prototype.mouseOutHandler =
+ function(e) {
+ if (this.input.checked)
+ this.radio.className = 'radio-icon-checked';
+ else
+ this.radio.className = 'radio-icon';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.html.RadioButton.prototype.selectionChangeHandler =
+ function(e) {
+ // this should reset the icons in the non-selected radio
+ this.selectedValue = this.value;
+};
+
+
+/**
* @export
*/
org.apache.flex.html.RadioButton.prototype.initModel =
@@ -128,6 +173,10 @@ Object.defineProperties(org.apache.flex.html.RadioButton.prototype, {
/** @this {org.apache.flex.html.RadioButton} */
set: function(value) {
this.input.checked = value;
+ if (this.input.checked)
+ this.radio.className = 'radio-icon-checked';
+ else
+ this.radio.className = 'radio-icon';
}
},
/** @export */
@@ -168,8 +217,10 @@ Object.defineProperties(org.apache.flex.html.RadioButton.prototype, {
for (i = 0; i < n; i++) {
if (buttons[i].value === value) {
buttons[i].checked = true;
- break;
+ buttons[i].flexjs_wrapper.selected = true;
}
+ else
+ buttons[i].flexjs_wrapper.selected = false;
}
}
}
[16/36] git commit: [flex-asjs] [refs/heads/develop] - fix
checkintests
Posted by ah...@apache.org.
fix checkintests
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f931f2a8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f931f2a8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f931f2a8
Branch: refs/heads/develop
Commit: f931f2a8b208a3f2fee5b7a763a58c4b16b56ba3
Parents: 44ebb49
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 16:13:16 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 16:13:16 2015 -0700
----------------------------------------------------------------------
mustella/tests/basicTests/BasicTests.css | 339 +++++++++++-----------
mustella/tests/basicTests/BasicTestsApp.mxml | 14 +-
2 files changed, 171 insertions(+), 182 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f931f2a8/mustella/tests/basicTests/BasicTests.css
----------------------------------------------------------------------
diff --git a/mustella/tests/basicTests/BasicTests.css b/mustella/tests/basicTests/BasicTests.css
index fe43f2b..2c75af3 100644
--- a/mustella/tests/basicTests/BasicTests.css
+++ b/mustella/tests/basicTests/BasicTests.css
@@ -1,170 +1,171 @@
-/*
- *
- * 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.
- *
- */
-
-/*
- @namespace "library://ns.adobe.com/flex/spark";
- */
-@namespace mx "library://ns.apache.org/flexjs/basic";
-@namespace my "shim.*";
-
-.global {
- font-family:"Tahoma";
- font-size:11px;
- color:#222222;
-}
-
-.appTitle {
- font-weight:bold;
- font-size:16px;
-}
-
-mx|ViewBase {
-/* background-image: "";
- theme-color:#CC6600; */
- selection-color:#D0DFE6;
- roll-over-color:#E6F0F3;
- background-color:#FFFFFF;
- font-family: Verdana;
-}
-
-
-
-mx|Panel {
-/* header-colors: #FAEED1, #E3C38D;
- footer-colors: #F4DBB0, #E3C38D; */
- corner-radius:10;
-/* drop-shadow: true;
- shadow-distance:6; */
- margin-top:0;
- margin-left:0;
- margin-right:0;
- margin-bottom:0;
-}
-
-
-
-mx|Button {
- color: #FFFFFF;
- disabled-color: #999999;
- text-roll-over-color: #FFFFFF;
- font-family:"Verdana";
- font-size: 9px;
- font-weight: "bold";
-/* fill-colors: #C86336, #763322; */
- corner-radius:8;
-/* border-color: #854230;
- border-thickness:3; */
- foo: 42; /* This should not cause a warning or error. */
-}
-
-
-mx|CheckBox {
- color: #000000;
- font-size: 10px;
- font-weight: "normal";
-}
-
-mx|RadioButton {
- color: #000000;
- font-size: 10px;
- font-weight: "normal";
-}
-
-
-
-mx|DataGrid {
- alternating-row-colors:#FFFCEC,#FFF6E2;
- border-style:"solid";
- border-color:#CCCCCC;
- header-color:#FAEED1;
- v-grid-line-color:#CCCCCC;
- color:#111111;
- font-size:9px;
- text-indent:4;
-}
-
-
-
-
-mx|ComboBox {
- color: #111111;
- text-roll-over-color: #111111;
- font-size:9px;
- font-weight: "bold";
-/* fill-colors: #FFFFFF, #C2CCCF; */
- background-color: #FFFCEC;
- corner-radius: 7;
-/* border-thickness: 1;
- border-color: #854230; */
- margin-left: 6;
- selection-color:#f5dcb2;
- roll-over-color:#faeed1;
-
-}
-
-
-my|HSlider {
-/* fill-colors: #FFFFFF, #C2CCCF;
- track-colors: #FAEED1, #E3C38D;
- border-color: #666666; */
- tick-color: #666666;
- label-offset: -3;
- tick-offset: -3;
- track-highlight: true;
-}
-
-/*
-mx|Menu {
- openDuration: 250;
-}
-*/
-
-/*
-Apache Flex: requires rideau.jar which is not open-source
-
-@font-face {
- src: url("BickhamScriptPro-Regular.otf");
- fontFamily: "TestFont";
- embedAsCFF: true;
-}
-
-*/
-
-/*
-TextInput {
-/* font-family:"TestFont"; */
-/* paddingTop: 5;
-
-}
-*/
-
-my|VBox {
- IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
-}
-
-/*
-@media (os-platform: "Android") and (application-dpi: 160)
-{
- mx|ComboBox
- {
- color: #111111;
- fontSize:9px;
- }
-}
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ @namespace "library://ns.adobe.com/flex/spark";
+ */
+@namespace mx "library://ns.apache.org/flexjs/basic";
+@namespace my "shim.*";
+
+.global {
+ font-family:"Tahoma";
+ font-size:11px;
+ color:#222222;
+}
+
+.appTitle {
+ font-weight:bold;
+ font-size:16px;
+}
+
+mx|ViewBase {
+/* background-image: "";
+ theme-color:#CC6600; */
+ selection-color:#D0DFE6;
+ roll-over-color:#E6F0F3;
+ background-color:#FFFFFF;
+ font-family: Verdana;
+}
+
+
+
+mx|Panel {
+/* header-colors: #FAEED1, #E3C38D;
+ footer-colors: #F4DBB0, #E3C38D; */
+ corner-radius:10;
+/* drop-shadow: true;
+ shadow-distance:6; */
+ margin-top:0;
+ margin-left:0;
+ margin-right:0;
+ margin-bottom:0;
+}
+
+
+
+mx|Button {
+ color: #FFFFFF;
+ disabled-color: #999999;
+ text-roll-over-color: #FFFFFF;
+ font-family:"Verdana";
+ font-size: 9px;
+ font-weight: "bold";
+/* fill-colors: #C86336, #763322; */
+ corner-radius:8;
+/* border-color: #854230;
+ border-thickness:3; */
+ foo: 42; /* This should not cause a warning or error. */
+}
+
+
+mx|CheckBox {
+ color: #000000;
+ padding-left: 0px;
+ font-size: 10px;
+ font-weight: "normal";
+}
+
+mx|RadioButton {
+ color: #000000;
+ font-size: 10px;
+ font-weight: "normal";
+}
+
+
+
+mx|DataGrid {
+ alternating-row-colors:#FFFCEC,#FFF6E2;
+ border-style:"solid";
+ border-color:#CCCCCC;
+ header-color:#FAEED1;
+ v-grid-line-color:#CCCCCC;
+ color:#111111;
+ font-size:9px;
+ text-indent:4;
+}
+
+
+
+
+mx|ComboBox {
+ color: #111111;
+ text-roll-over-color: #111111;
+ font-size:9px;
+ font-weight: "bold";
+/* fill-colors: #FFFFFF, #C2CCCF; */
+ background-color: #FFFCEC;
+ corner-radius: 7;
+/* border-thickness: 1;
+ border-color: #854230; */
+ margin-left: 6;
+ selection-color:#f5dcb2;
+ roll-over-color:#faeed1;
+
+}
+
+
+my|HSlider {
+/* fill-colors: #FFFFFF, #C2CCCF;
+ track-colors: #FAEED1, #E3C38D;
+ border-color: #666666; */
+ tick-color: #666666;
+ label-offset: -3;
+ tick-offset: -3;
+ track-highlight: true;
+}
+
+/*
+mx|Menu {
+ openDuration: 250;
+}
+*/
+
+/*
+Apache Flex: requires rideau.jar which is not open-source
+
+@font-face {
+ src: url("BickhamScriptPro-Regular.otf");
+ fontFamily: "TestFont";
+ embedAsCFF: true;
+}
+
+*/
+
+/*
+TextInput {
+/* font-family:"TestFont"; */
+/* paddingTop: 5;
+
+}
+*/
+
+my|VBox {
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+}
+
+/*
+@media (os-platform: "Android") and (application-dpi: 160)
+{
+ mx|ComboBox
+ {
+ color: #111111;
+ fontSize:9px;
+ }
+}
*/
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f931f2a8/mustella/tests/basicTests/BasicTestsApp.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/basicTests/BasicTestsApp.mxml b/mustella/tests/basicTests/BasicTestsApp.mxml
index 3df88e8..805b535 100644
--- a/mustella/tests/basicTests/BasicTestsApp.mxml
+++ b/mustella/tests/basicTests/BasicTestsApp.mxml
@@ -39,18 +39,6 @@ limitations under the License.
-->
<js:beads>
<js:MixinManager />
- <!--
- <js:HTTPService id="service">
- <js:LazyCollection id="collection">
- <js:inputParser>
- <js:JSONInputParser />
- </js:inputParser>
- <js:itemConverter>
- <local:StockDataJSONItemConverter />
- </js:itemConverter>
- </js:LazyCollection>
- </js:HTTPService>
- <js:ViewSourceContextMenuOption />
- -->
+ <js:CSSFontFaceBead />
</js:beads>
</js:Application>
[29/36] git commit: [flex-asjs] [refs/heads/develop] - fix handling
of border-radius
Posted by ah...@apache.org.
fix handling of border-radius
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cebebe4d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cebebe4d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cebebe4d
Branch: refs/heads/develop
Commit: cebebe4d57aca22d900bd42792b905d0d897220d
Parents: 892562e
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 15:50:07 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 15:50:07 2015 -0700
----------------------------------------------------------------------
.../Core/as/src/org/apache/flex/utils/CSSBorderUtils.as | 6 +++---
.../as/src/org/apache/flex/html/beads/CSSTextButtonView.as | 6 +++---
.../as/src/org/apache/flex/html/beads/SolidBackgroundBead.as | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cebebe4d/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
index ccc8466..c718c92 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as
@@ -109,14 +109,14 @@ package org.apache.flex.utils
if (value != null)
{
if (value is Number)
- borderEllipseWidth = value as Number;
+ borderEllipseWidth = 2 * (value as Number);
else
{
borderRadius = value as String;
var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
if (arr.length > 1)
- borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
}
}
if (borderStyle == "none" && isNaN(borderEllipseWidth))
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cebebe4d/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index 0ee0b8d..f400583 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -184,14 +184,14 @@ package org.apache.flex.html.beads
if (value != null)
{
if (value is Number)
- borderEllipseWidth = value as Number;
+ borderEllipseWidth = 2 * (value as Number);
else
{
borderRadius = value as String;
var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
- borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ borderEllipseWidth = 2 * CSSUtils.toNumber(arr[0]);
if (arr.length > 1)
- borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ borderEllipseHeight = 2 * CSSUtils.toNumber(arr[1]);
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cebebe4d/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
index cf8acaa..a42a23d 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
@@ -184,7 +184,7 @@ package org.apache.flex.html.beads
if (isNaN(borderRadius))
g.drawRect(0, 0, w, h);
else
- g.drawRoundRect(0, 0, w, h, borderRadius);
+ g.drawRoundRect(0, 0, w, h, borderRadius * 2);
g.endFill();
}
}
[22/36] git commit: [flex-asjs] [refs/heads/develop] - fix sizing of
dropdownlist popup
Posted by ah...@apache.org.
fix sizing of dropdownlist popup
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/94a189ba
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/94a189ba
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/94a189ba
Branch: refs/heads/develop
Commit: 94a189babc6f74663819457b9d148f4987e70d9c
Parents: f66378c
Author: Alex Harui <ah...@apache.org>
Authored: Sun Jul 26 08:37:42 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sun Jul 26 08:37:42 2015 -0700
----------------------------------------------------------------------
.../apache/flex/html/beads/controllers/DropDownListController.as | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/94a189ba/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
index cc295fc..36a9fce 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/controllers/DropDownListController.as
@@ -79,9 +79,9 @@ package org.apache.flex.html.beads.controllers
viewBead.popUpVisible = true;
var selectionModel:ISelectionModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
var popUpModel:ISelectionModel = viewBead.popUp.getBeadByType(ISelectionModel) as ISelectionModel;
+ DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
popUpModel.dataProvider = selectionModel.dataProvider;
popUpModel.selectedIndex = selectionModel.selectedIndex;
- DisplayObject(viewBead.popUp).width = DisplayObject(_strand).width;
var pt:Point = new Point(DisplayObject(_strand).x, DisplayObject(_strand).y + DisplayObject(_strand).height);
pt = DisplayObject(_strand).parent.localToGlobal(pt);
DisplayObject(viewBead.popUp).x = pt.x;
[18/36] git commit: [flex-asjs] [refs/heads/develop] - update LICENSE
and add LICENSE.bin
Posted by ah...@apache.org.
update LICENSE and add LICENSE.bin
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c204976d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c204976d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c204976d
Branch: refs/heads/develop
Commit: c204976d51c47f2412ed70efb135b1b2895e55ae
Parents: 4e6524c
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 16:15:42 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 16:15:42 2015 -0700
----------------------------------------------------------------------
LICENSE | 12 ++++++++++++
LICENSE.bin | 13 +++++++++++++
build.xml | 15 ++++++++++++---
3 files changed, 37 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c204976d/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 6b0b127..e45744e 100644
--- a/LICENSE
+++ b/LICENSE
@@ -201,3 +201,15 @@
See the License for the specific language governing permissions and
limitations under the License.
+--------------------------------------------------------------------------------
+
+APACHE FLEXJS SUBCOMPONENTS:
+
+The Apache FlexJS SDK includes a number of subcomponents with
+separate copyright notices and license terms. Your use of the source
+code for the these subcomponents is subject to the terms and
+conditions of the following licenses.
+
+Portions of frameworks/projects/HTML/src/defaults.css is based on
+designmodo’s (http://designmodo.com/flat-free/) Flat UI which is
+available under an MIT license.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c204976d/LICENSE.bin
----------------------------------------------------------------------
diff --git a/LICENSE.bin b/LICENSE.bin
new file mode 100644
index 0000000..95ea89f
--- /dev/null
+++ b/LICENSE.bin
@@ -0,0 +1,13 @@
+Below are the licenses for components included in the binary distribution.
+
+------------------------------------------------------------------------------------------
+
+frameworks/fonts/flat-ui-icons-regular.eot
+frameworks/fonts/flat-ui-icons-regular.ttf
+frameworks/fonts/flat-ui-icons-regular.svg
+frameworks/fonts/flat-ui-icons-regular.woff
+
+This product bundles designmodo’s (http://designmodo.com/flat-free/)
+Flat UI glyph fonts available under an MIT license. For details, see
+
+frameworks/fonts/README.md
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c204976d/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index c324177..88098d7 100644
--- a/build.xml
+++ b/build.xml
@@ -511,6 +511,7 @@
<include name="READme"/>
<include name="RELEASE_NOTES"/>
<include name="LICENSE"/>
+ <include name="LICENSE.bin"/>
<include name="NOTICE"/>
</fileset>
</copy>
@@ -617,6 +618,7 @@
<exclude name="**/*.pbj"/>
<exclude name="**/*.swf"/>
<exclude name="**/*.mxp"/>
+ <exclude name="fonts/**"/>
<exclude name="test*/**"/>
<exclude name="js/VanillaSDK/**"/>
<exclude name="projects/air/**"/>
@@ -683,9 +685,9 @@
<!-- these files are in addition to the remaining source files -->
<!-- concat the license file with the binary license file for the 3rd party deps -->
- <!--concat destfile="${basedir}/temp/LICENSE">
- <filelist dir="${FLEX_SDK_HOME}" files="LICENSE,LICENSE.bin"/>
- </concat-->
+ <concat destfile="${basedir}/temp/LICENSE">
+ <filelist dir="${basedir}" files="LICENSE,LICENSE.bin"/>
+ </concat>
<!-- frameworks/libs -->
<copy todir="${basedir}/temp/frameworks/libs">
@@ -1217,6 +1219,12 @@
<include name="frameworks/locale/en_US/framework_rb.swc"/>
</library-path>
</mxmlc>
+ <mkdir dir="${basedir}/mustella/tests/basicTests/fonts" />
+ <copy todir="${basedir}/mustella/tests/basicTests/fonts" >
+ <fileset dir="${FLEX_HOME}/frameworks/fonts">
+ <include name="**/*.swf" />
+ </fileset>
+ </copy>
<!-- compile supporting swfs for basic tests
<mxmlc fork="true"
file="${basedir}/frameworks/tests/basicTests/basicLoader.as">
@@ -1297,6 +1305,7 @@
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportFile="${rat.report}">
<fileset dir="${rat.dir}">
+ <exclude name="LICENSE.bin"/>
<!-- Start of binary files -->
<!-- exclude media (png, gif, jpg, mp3, flv) -->
<exclude name="**/*.png"/>
[04/36] git commit: [flex-asjs] [refs/heads/develop] - add
preinitialize event as a way to defer initialization so things like fonts can
get loaded first
Posted by ah...@apache.org.
add preinitialize event as a way to defer initialization so things like fonts can get loaded first
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/30007f75
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/30007f75
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/30007f75
Branch: refs/heads/develop
Commit: 30007f75cd8711a7965d9e238653009c656d5fb0
Parents: 5e4cd97
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:52:50 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:52:50 2015 -0700
----------------------------------------------------------------------
.../as/src/org/apache/flex/core/Application.as | 44 +++++++++++++++++++-
1 file changed, 42 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/30007f75/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
index 54edeb1..3e4821e 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/Application.as
@@ -24,8 +24,6 @@ package org.apache.flex.core
import flash.display.StageQuality;
import flash.display.StageScaleMode;
import flash.events.Event;
- import flash.events.IOErrorEvent;
- import flash.events.MouseEvent;
import flash.system.ApplicationDomain;
import flash.utils.getQualifiedClassName;
@@ -53,6 +51,20 @@ package org.apache.flex.core
[Event(name="initialize", type="org.apache.flex.events.Event")]
/**
+ * Dispatched at startup before the instances get created.
+ * Beads can call preventDefault and defer initialization.
+ * This event will be dispatched on every frame until no
+ * listeners call preventDefault(), then the initialize()
+ * method will be called.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="preinitialize", type="org.apache.flex.events.Event")]
+
+ /**
* Dispatched at startup after the initial view has been
* put on the display list.
*
@@ -135,6 +147,34 @@ package org.apache.flex.core
dispatchEvent(new org.apache.flex.events.Event("beadsAdded"));
+ if (dispatchEvent(new org.apache.flex.events.Event("preinitialize", false, true)))
+ initialize();
+ else
+ addEventListener(flash.events.Event.ENTER_FRAME, enterFrameHandler);
+
+ }
+
+ private function enterFrameHandler(event:flash.events.Event):void
+ {
+ if (dispatchEvent(new org.apache.flex.events.Event("preinitialize", false, true)))
+ {
+ removeEventListener(flash.events.Event.ENTER_FRAME, enterFrameHandler);
+ initialize();
+ }
+ }
+
+ /**
+ * This method gets called when all preinitialize handlers
+ * no longer call preventDefault();
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function initialize():void
+ {
+
MXMLDataInterpreter.generateMXMLInstances(this, null, MXMLDescriptor);
dispatchEvent(new org.apache.flex.events.Event("initialize"));
[02/36] git commit: [flex-asjs] [refs/heads/develop] - get Borders on
TextInput to work in FlatUI-like CSS
Posted by ah...@apache.org.
get Borders on TextInput to work in FlatUI-like CSS
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cfded8d2
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cfded8d2
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cfded8d2
Branch: refs/heads/develop
Commit: cfded8d2bb67b6c2e81c0b5abb2b3096f166643a
Parents: 3ceb21b
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 10 08:38:43 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 10 08:38:43 2015 -0700
----------------------------------------------------------------------
.../as/src/org/apache/flex/core/CSSTextField.as | 30 +++++---
.../org/apache/flex/core/SimpleCSSValuesImpl.as | 1 +
.../as/src/org/apache/flex/utils/CSSUtils.as | 8 +++
.../org/apache/flex/utils/SolidBorderUtil.as | 44 +++++++++---
frameworks/projects/HTML/as/defaults.css | 16 +++++
.../org/apache/flex/html/beads/CSSButtonView.as | 5 +-
.../apache/flex/html/beads/CSSTextButtonView.as | 12 +++-
.../flex/html/beads/SingleLineBorderBead.as | 74 +++++++++++++++-----
frameworks/projects/HTML/basic-manifest.xml | 2 +
9 files changed, 148 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
index e32b199..a91174d 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
@@ -77,6 +77,18 @@ package org.apache.flex.core
/**
* @private
+ * The parentHandlesPadding property is set if the CSSTextField
+ * shouldn't worry about padding
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var parentHandlesPadding:Boolean;
+
+ /**
+ * @private
*/
override public function set text(value:String):void
{
@@ -89,15 +101,15 @@ package org.apache.flex.core
tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily") as String;
tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize");
tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight") == "bold";
- tf.color = ValuesManager.valuesImpl.getValue(sp, "color");
- var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding");
- if (padding == null) padding = 0;
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left");
- if (paddingLeft == null) paddingLeft = padding;
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right");
- if (paddingRight == null) paddingRight = padding;
- tf.leftMargin = paddingLeft;
- tf.rightMargin = paddingRight;
+ tf.color = CSSUtils.toColor(ValuesManager.valuesImpl.getValue(sp, "color"));
+ if (!parentHandlesPadding)
+ {
+ var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding");
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left");
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right");
+ tf.leftMargin = CSSUtils.getLeftValue(paddingLeft, padding, width);
+ tf.rightMargin = CSSUtils.getRightValue(paddingRight, padding, width);
+ }
var align:Object = ValuesManager.valuesImpl.getValue(sp, "text-align");
if (align == "center")
{
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/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
index bbbd6c0..57d6726 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -399,6 +399,7 @@ package org.apache.flex.core
if (value !== undefined)
return value;
}
+ return undefined;
}
return "inherit";
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
index b023c4f..2f6d6d5 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
@@ -156,6 +156,8 @@ package org.apache.flex.utils
if (value != null)
return toNumber(value as String, reference);
+ if (values == null)
+ return 0;
if (values is Array)
{
var arr:Array = values as Array;
@@ -191,6 +193,8 @@ package org.apache.flex.utils
if (value != null)
return toNumber(value as String, reference);
+ if (values == null)
+ return 0;
if (values is Array)
{
var arr:Array = values as Array;
@@ -223,6 +227,8 @@ package org.apache.flex.utils
if (value != null)
return toNumber(value as String, reference);
+ if (values == null)
+ return 0;
if (values is Array)
{
var arr:Array = values as Array;
@@ -255,6 +261,8 @@ package org.apache.flex.utils
if (value != null)
return toNumber(value as String, reference);
+ if (values == null)
+ return 0;
if (values is Array)
{
var arr:Array = values as Array;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index aca4275..5848826 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -59,18 +59,40 @@ public class SolidBorderUtil
thickness:int = 1, alpha:Number = 1.0,
ellipseWidth:Number = NaN, ellipseHeight:Number = NaN):void
{
- g.clear();
+ g.lineStyle(); // don't draw the line, it tends to get aligned on half-pixels
- g.lineStyle(thickness, color, thickness == 0 ? 0 : 1);
- if (backgroundColor != null)
- g.beginFill(uint(backgroundColor), alpha);
-
- if (!isNaN(ellipseWidth))
- g.drawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);
- else
- g.drawRect(x, y, width, height);
- if (backgroundColor != null)
- g.endFill();
+ if (thickness > 0)
+ {
+ g.beginFill(color, alpha);
+ if (!isNaN(ellipseWidth))
+ {
+ g.drawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);
+ g.drawRoundRect(x + thickness, y + thickness,
+ width - thickness * 2, height - thickness * 2,
+ ellipseWidth, ellipseHeight);
+ }
+ else
+ {
+ g.drawRect(x, y, width, height);
+ g.drawRect(x + thickness, y + thickness,
+ width - thickness * 2, height - thickness * 2);
+ }
+ g.endFill();
+ }
+
+ if (backgroundColor != null)
+ {
+ g.beginFill(uint(backgroundColor), alpha);
+
+ if (!isNaN(ellipseWidth))
+ g.drawRoundRect(x + thickness, y + thickness,
+ width - thickness * 2, height - thickness * 2,
+ ellipseWidth, ellipseHeight);
+ else
+ g.drawRect(x + thickness, y + thickness,
+ width - thickness * 2, height - thickness * 2);
+ g.endFill();
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 81658b2..76830dd 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -217,6 +217,16 @@ StringItemRenderer
height: 16;
}
+TextInput
+{
+ height: 35px;
+ padding: 6px 10px;
+ font-size: 13px;
+ line-height: 1.462;
+ border-radius: 6px;
+ border: 2px solid #1abc9c;
+}
+
TitleBar
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
@@ -266,6 +276,12 @@ Alert
border-width: 1px;
}
+Border
+{
+ border-radius: inherit;
+ border: inherit;
+}
+
Button
{
IBeadView: ClassReference("org.apache.flex.html.beads.CSSButtonView");
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
index a40c7a9..4377e8e 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -102,7 +102,7 @@ package org.apache.flex.html.beads
var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
if (borderStyles is Array)
{
- borderColor = borderStyles[2];
+ borderColor = CSSUtils.toColor(borderStyles[2]);
borderStyle = borderStyles[1];
borderThickness = borderStyles[0];
}
@@ -113,7 +113,7 @@ package org.apache.flex.html.beads
borderStyle = value as String;
value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
if (value != null)
- borderColor = value as uint;
+ borderColor = CSSUtils.toColor(value);
value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
if (value != null)
borderThickness = value as uint;
@@ -164,6 +164,7 @@ package org.apache.flex.html.beads
}
if (borderStyle == "solid")
{
+ sprite.graphics.clear();
SolidBorderUtil.drawBorder(sprite.graphics,
0, 0, sprite.width + pl + pr,
sprite.height + pt + pb,
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index fd48998..98dc7f5 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -114,6 +114,9 @@ package org.apache.flex.html.beads
upTextField.parentDrawsBackground = true;
downTextField.parentDrawsBackground = true;
overTextField.parentDrawsBackground = true;
+ upTextField.parentHandlesPadding = true;
+ downTextField.parentHandlesPadding = true;
+ overTextField.parentHandlesPadding = true;
SimpleButton(value).upState = upSprite;
SimpleButton(value).downState = downSprite;
SimpleButton(value).overState = overSprite;
@@ -144,14 +147,16 @@ package org.apache.flex.html.beads
textField.defaultTextFormat.leftMargin = 0;
textField.defaultTextFormat.rightMargin = 0;
-
+ // set it again so it gets noticed
+ textField.defaultTextFormat = textField.defaultTextFormat;
+
var borderColor:uint;
var borderThickness:uint;
var borderStyle:String;
var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
if (borderStyles is Array)
{
- borderColor = borderStyles[2];
+ borderColor = CSSUtils.toColor(borderStyles[2]);
borderStyle = borderStyles[1];
borderThickness = borderStyles[0];
}
@@ -162,7 +167,7 @@ package org.apache.flex.html.beads
borderStyle = value as String;
value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
if (value != null)
- borderColor = value as uint;
+ borderColor = CSSUtils.toColor(value);
value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
if (value != null)
borderThickness = value as uint;
@@ -222,6 +227,7 @@ package org.apache.flex.html.beads
if ((useHeight-pt-pb-2*borderThickness) < textField.textHeight)
useHeight = textField.textHeight+pt+pb+2*borderThickness;
+ sprite.graphics.clear();
SolidBorderUtil.drawBorder(sprite.graphics,
0, 0, useWidth, useHeight,
borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
index bd933df..470fa9d 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
@@ -22,10 +22,14 @@ package org.apache.flex.html.beads
import org.apache.flex.core.IBead;
import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IStatesObject;
import org.apache.flex.core.UIBase;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.SolidBorderUtil;
+ import org.apache.flex.utils.StringTrimmer;
/**
* The SingleLineBorderBead class draws a single line solid border.
@@ -72,33 +76,65 @@ package org.apache.flex.html.beads
private function changeHandler(event:Event):void
{
- var styleObject:* = ValuesManager.valuesImpl.getValue(_strand,"border-color");
- if (styleObject is String)
- {
- if (styleObject.charAt(0) == "#")
- styleObject = styleObject.replace("#", "0x");
- }
- var borderColor:Number = Number(styleObject);
- if( isNaN(borderColor) ) borderColor = 0x000000;
- styleObject = ValuesManager.valuesImpl.getValue(_strand,"border-width");
- if (styleObject is String)
- styleObject = styleObject.replace("px", "");
- var borderThickness:Number = Number(styleObject);
- if( isNaN(borderThickness) ) borderThickness = 1;
-
var host:UIBase = UIBase(_strand);
var g:Graphics = host.graphics;
var w:Number = host.width;
var h:Number = host.height;
+ var state:String;
+ if (host is IStatesObject)
+ state = IStatesObject(host).currentState;
var gd:IGraphicsDrawing = _strand.getBeadByType(IGraphicsDrawing) as IGraphicsDrawing;
if( this == gd ) g.clear();
- g.lineStyle();
- g.beginFill(borderColor);
- g.drawRect(0, 0, w, h);
- g.drawRect(borderThickness, borderThickness, w-2*borderThickness, h-2*borderThickness);
- g.endFill();
+ var borderColor:uint;
+ var borderThickness:uint;
+ var borderStyle:String;
+ var borderStyles:Object = ValuesManager.valuesImpl.getValue(_strand, "border", state);
+ if (borderStyles is Array)
+ {
+ borderColor = CSSUtils.toColor(borderStyles[2]);
+ borderStyle = borderStyles[1];
+ borderThickness = borderStyles[0];
+ }
+ else if (borderStyles is String)
+ borderStyle = borderStyles as String;
+ var value:Object = ValuesManager.valuesImpl.getValue(_strand, "border-style", state);
+ if (value != null)
+ borderStyle = value as String;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
+ if (value != null)
+ borderColor = CSSUtils.toColor(value);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
+ if (value != null)
+ borderThickness = value as uint;
+ if (borderStyle == "none")
+ {
+ borderStyle = "solid";
+ borderThickness = 0;
+ }
+
+ var borderRadius:String;
+ var borderEllipseWidth:Number = NaN;
+ var borderEllipseHeight:Number = NaN;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-radius", state);
+ if (value != null)
+ {
+ if (value is Number)
+ borderEllipseWidth = value as Number;
+ else
+ {
+ borderRadius = value as String;
+ var arr:Array = StringTrimmer.splitAndTrim(borderRadius, "/");
+ borderEllipseWidth = CSSUtils.toNumber(arr[0]);
+ if (arr.length > 1)
+ borderEllipseHeight = CSSUtils.toNumber(arr[1]);
+ }
+ }
+ SolidBorderUtil.drawBorder(g,
+ 0, 0, w, h,
+ borderColor, null, borderThickness, 1,
+ borderEllipseWidth, borderEllipseHeight);
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cfded8d2/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml b/frameworks/projects/HTML/basic-manifest.xml
index fcd23d5..1591aed 100644
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ b/frameworks/projects/HTML/basic-manifest.xml
@@ -93,4 +93,6 @@
<component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout"/>
<component id="MXMLBeadViewBase" class="org.apache.flex.html.MXMLBeadViewBase"/>
+ <component id="Border" class="org.apache.flex.html.supportClasses.Border"/>
+
</componentPackage>
[33/36] git commit: [flex-asjs] [refs/heads/develop] - don't force
alignment on children
Posted by ah...@apache.org.
don't force alignment on children
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/0ae79f4e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/0ae79f4e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/0ae79f4e
Branch: refs/heads/develop
Commit: 0ae79f4e34af3e03befef58341838d950b2ac965
Parents: 0763bbb
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 28 06:55:53 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 28 06:55:53 2015 -0700
----------------------------------------------------------------------
.../js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js | 1 -
1 file changed, 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/0ae79f4e/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
index 451d569..f6c447c 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/beads/layouts/HorizontalLayout.js
@@ -71,7 +71,6 @@ org.apache.flex.html.beads.layouts.HorizontalLayout.
child.lastDisplay_ = 'inline-block';
else
child.style.display = 'inline-block';
- child.style.verticalAlign = 'middle';
child.flexjs_wrapper.dispatchEvent('sizeChanged');
}
};
[28/36] git commit: [flex-asjs] [refs/heads/develop] - fix ability to
swap component sets
Posted by ah...@apache.org.
fix ability to swap component sets
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/892562ec
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/892562ec
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/892562ec
Branch: refs/heads/develop
Commit: 892562ec70c4e9466e3d1de7d1ae85e98a81b303
Parents: 2c5501c
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 15:36:41 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 15:36:41 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/build.xml | 1 +
examples/DataBindingTest/src/MyInitialView.mxml | 2 +-
examples/build_example.xml | 14 +
frameworks/projects/Flat/as/defaults.css | 11 +-
.../apache/flex/flat/beads/DropDownListView.as | 1 +
frameworks/projects/Flat/flat-manifest.xml | 2 +
frameworks/projects/HTML/as/defaults.css | 372 +------------------
.../apache/flex/html/beads/DropDownListView.as | 102 ++---
.../html/supportClasses/DropDownListList.as | 1 -
.../js/src/org/apache/flex/html/CheckBox.js | 67 +---
.../js/src/org/apache/flex/html/DropDownList.js | 155 ++------
.../js/src/org/apache/flex/html/RadioButton.js | 50 +--
12 files changed, 142 insertions(+), 636 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/examples/DataBindingTest/build.xml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/build.xml b/examples/DataBindingTest/build.xml
index 9c551dd..7169be7 100644
--- a/examples/DataBindingTest/build.xml
+++ b/examples/DataBindingTest/build.xml
@@ -22,6 +22,7 @@
<project name="databindingtest" default="main" basedir=".">
<property name="FLEXJS_HOME" location="../.."/>
<property name="example" value="DataBindingTest" />
+ <property name="theme_arg" value="-theme=${FLEXJS_HOME}/frameworks/libs/Flat.swc" />
<property file="${FLEXJS_HOME}/env.properties"/>
<property environment="env"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/examples/DataBindingTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/MyInitialView.mxml b/examples/DataBindingTest/src/MyInitialView.mxml
index a7d92f1..b153ba5 100644
--- a/examples/DataBindingTest/src/MyInitialView.mxml
+++ b/examples/DataBindingTest/src/MyInitialView.mxml
@@ -125,7 +125,7 @@ limitations under the License.
<js:beads>
<js:VerticalLayout />
</js:beads>
- <js:DropDownList id="list" width="100" height="43"
+ <js:DropDownList id="list" width="100"
change="_symbol = list.selectedItem as String; dispatchEvent(new CustomEvent('listChanged'))"
dataProvider="{MyModel(applicationModel).strings}" />
<js:RadioButton id="radio1" text="Price" value="Ask" groupName="group1" change="radioChanged(event)"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index a8a5973..81a263e 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -31,12 +31,16 @@
<!-- Load the <compc> task. We can't do this at the <project> level -->
<!-- because targets that run before flexTasks.jar gets built would fail. -->
<taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ <!-- this is a dummy var placeholder in case some example needs to define a theme
+ then they would set theme_arg=-theme=<path to theme> -->
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<mxmlc fork="true"
file="${basedir}/src/${example}.mxml"
output="${basedir}/bin-debug/${example}.swf">
<jvmarg line="${mxmlc.jvm.args}"/>
<arg value="+flexlib=${basedir}/frameworks" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-compiler.mxml.children-as-data" />
<arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent" />
<arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent" />
@@ -75,6 +79,7 @@
<!-- Load the <compc> task. We can't do this at the <project> level -->
<!-- because targets that run before flexTasks.jar gets built would fail. -->
<taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<mxmlc fork="true"
file="${basedir}/src/${example}.mxml"
output="${basedir}/bin-debug/${example}.swf">
@@ -82,6 +87,7 @@
<arg value="+flexlib=${basedir}/frameworks" />
<arg value="+configname=air" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-target-player=${playerglobal.version}" />
<arg value="-swf-version=${swf.version}" />
<arg value="-compiler.mxml.children-as-data" />
@@ -111,12 +117,14 @@
<!-- Load the <compc> task. We can't do this at the <project> level -->
<!-- because targets that run before flexTasks.jar gets built would fail. -->
<taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<mxmlc fork="true"
file="${basedir}/src/${example}.as"
output="${basedir}/bin-debug/${example}.swf">
<jvmarg line="${mxmlc.jvm.args}"/>
<arg value="+flexlib=${basedir}/frameworks" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-define=CONFIG::as_only,true" />
<arg value="-define=CONFIG::js_only,false" />
<arg value="-compiler.mxml.children-as-data" />
@@ -144,6 +152,7 @@
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
<echo message="GOOG_HOME: ${GOOG_HOME}"/>
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<java jar="${FALCONJX_HOME}/lib/mxmlc.jar" resultProperty="errorCode"
fork="true">
@@ -151,6 +160,7 @@
<jvmarg line="-Dflexlib=${FLEXJS_HOME}/frameworks}"/>
<arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-compiler.mxml.children-as-data" />
<arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent" />
<arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent" />
@@ -181,6 +191,7 @@
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
<echo message="GOOG_HOME: ${GOOG_HOME}"/>
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<java jar="${FALCONJX_HOME}/lib/mxmlc.jar" resultProperty="errorCode"
fork="true">
@@ -189,6 +200,7 @@
<arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
<arg value="+configname=air" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-compiler.mxml.children-as-data" />
<arg value="-compiler.binding-value-change-event=org.apache.flex.events.ValueChangeEvent" />
<arg value="-compiler.binding-value-change-event-kind=org.apache.flex.events.ValueChangeEvent" />
@@ -219,6 +231,7 @@
<echo message="FLEX_HOME: ${FLEX_HOME}"/>
<echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
<echo message="GOOG_HOME: ${GOOG_HOME}"/>
+ <property name="theme_arg" value="-define=CONFIG::theme,false" />
<java jar="${FALCONJX_HOME}/lib/mxmlc.jar" resultProperty="errorCode"
fork="true">
@@ -226,6 +239,7 @@
<jvmarg line="-Dflexlib=${FLEXJS_HOME}/frameworks}"/>
<arg value="+flexlib=${FLEXJS_HOME}/frameworks" />
<arg value="-debug" />
+ <arg value="${theme_arg}" />
<arg value="-define=CONFIG::as_only,false" />
<arg value="-define=CONFIG::js_only,true" />
<arg value="-compiler.mxml.children-as-data" />
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/Flat/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/defaults.css b/frameworks/projects/Flat/as/defaults.css
index 790eb0c..5a92621 100644
--- a/frameworks/projects/Flat/as/defaults.css
+++ b/frameworks/projects/Flat/as/defaults.css
@@ -59,13 +59,17 @@ Button
Button:hover
{
+ border: none;
color: #fff;
background-color: #48c9b0;
border-color: #48c9b0;
+ padding: 10px 15px;
}
Button:active
{
+ border: none;
+ padding: 10px 15px;
outline: none;
box-shadow: none;
}
@@ -552,9 +556,10 @@ ControlBar
DropDownList
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.DropDownListView");
+ IBeadView: ClassReference("org.apache.flex.flat.beads.DropDownListView");
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DropDownListController");
- IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
+ IPopUp: ClassReference("org.apache.flex.flat.supportClasses.DropDownListList");
+ height: 43px;
}
DropDownListList
@@ -562,7 +567,7 @@ DropDownListList
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.DropDownListStringItemRenderer");
+ IItemRenderer: ClassReference("org.apache.flex.flat.supportClasses.DropDownListStringItemRenderer");
}
Image
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
index 0aaf964..0d4d032 100644
--- a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
@@ -39,6 +39,7 @@ package org.apache.flex.flat.beads
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.html.beads.IDropDownListView;
/**
* The DropDownListView class is the default view for
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/Flat/flat-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/flat-manifest.xml b/frameworks/projects/Flat/flat-manifest.xml
index 1677425..dcd2aca 100644
--- a/frameworks/projects/Flat/flat-manifest.xml
+++ b/frameworks/projects/Flat/flat-manifest.xml
@@ -65,6 +65,8 @@
<component id="NumericStepper" class="org.apache.flex.html.NumericStepper" lookupOnly="true" />
<component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer" lookupOnly="true" />
<component id="StringItemRenderer" class="org.apache.flex.html.supportClasses.StringItemRenderer" lookupOnly="true" />
+ <component id="DropDownListView" class="org.apache.flex.flat.beads.DropDownListView" />
+ <component id="DropDownListStringItemRenderer" class="org.apache.flex.flat.supportClasses.DropDownListStringItemRenderer" />
<component id="DataItemRenderer" class="org.apache.flex.html.supportClasses.DataItemRenderer" lookupOnly="true" />
<component id="ButtonBarButtonItemRenderer" class="org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer" lookupOnly="true" />
<component id="ScrollBar" class="org.apache.flex.html.supportClasses.ScrollBar" lookupOnly="true" />
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 91ed55a..86b2ccb 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -20,20 +20,11 @@
@namespace "library://ns.apache.org/flexjs/basic";
@namespace svg "library://ns.apache.org/flexjs/svg";
-@font-face {
- font-family: 'Flat-UI-Icons';
-
- src: url('fonts/flat-ui-icons-regular.eot');
- src: url('fonts/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('fonts/flat-ui-icons-regular.woff') format('woff'), url('fonts/flat-ui-icons-regular.ttf') format('truetype'), url('fonts/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
-}
-
/* Global style declaration */
*
{
font-family: "Arial";
font-size: 12px;
- color: #34495e;
- background-color: #fff;
}
.flexjs *, . flexjs *:before, . flexjs *:after {
@@ -44,31 +35,23 @@
Button
{
- color: #fff;
- background-color: #1abc9c;
- padding: 10px 15px;
- font-size: 15px;
- font-weight: normal;
- line-height: 1.4;
- border: none;
- border-radius: 4px;
- -webkit-transition: border .25s linear, color .25s linear, background-color .25s linear;
- transition: border .25s linear, color .25s linear, background-color .25s linear;
-
- -webkit-font-smoothing: subpixel-antialiased;
+ background-color: #d8d8d8;
+ border: 1px solid #000000;
+ padding: 4px;
}
Button:hover
{
- color: #fff;
- background-color: #48c9b0;
- border-color: #48c9b0;
+ background-color: #9fa0a1;
+ border: 1px solid #000000;
+ padding: 4px;
}
Button:active
{
- outline: none;
- box-shadow: none;
+ background-color: #929496;
+ border: 1px solid #000000;
+ padding: 4px;
}
ButtonBar
@@ -91,83 +74,6 @@ ButtonBarButtonItemRenderer
height: 30;
}
-.checkbox-icon,
-.checkbox-icon-hover,
-.checkbox-icon-checked
-{
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 20px;
- height: 20px;
- font-size: 20px;
- line-height: 20px;
- color: #bdc3c7;
- text-align: center;
- cursor: pointer;
-
- /* .radio .icon-checked:before */
- /* .radio .icon-unchecked:before */
- font-family: 'Flat-UI-Icons';
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
-
- speak: none;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-
- font-size: 20px;
- line-height: 20px;
-}
-
-.checkbox-icon:before
-{
- content: "\e60d";
-}
-
-.checkbox-icon-hover:before
-{
- content: "\e60e";
-}
-
-.checkbox-icon-checked:before
-{
- content: "\e60e";
-}
-
-.checkbox-icon-checked
-{
- color: #1abc9c;
-}
-
-.checkbox-input
-{
- position: absolute;
- top: 0;
- left: 0;
- width: 20px;
- height: 20px;
- padding: 0;
- margin: 0;
- outline: none !important;
- opacity: 0;
-}
-
-CheckBox
-{
- /* .checkbox */
- position: relative;
- padding-left: 32px;
- margin-bottom: 12px;
- font-size: 14px;
- line-height: 1.5;
- -webkit-transition: color .25s linear;
- transition: color .25s linear;
-}
-
Container
{
IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
@@ -216,74 +122,6 @@ DateField {
IFormatBead: ClassReference("org.apache.flex.html.accessories.DateFormatMMDDYYYYBead");
}
-.dropdown-menu {
- position: absolute;
- z-index: 1000;
- min-width: 220px;
- padding: 0;
- margin-top: 9px;
- font-size: 14px;
- background-color: #f3f4f5;
- border: none;
- border-radius: 4px;
- box-shadow: none;
- list-style: none;
- }
-.dropdown-menu-divider {
- height: 2px;
- margin: 3px 0;
- overflow: hidden;
- background-color: rgba(202, 206, 209, .5);
- }
-.dropdown-menu-item-renderer {
- padding: 8px 16px;
- line-height: 1.429;
- font-size: inherit;
- color: #606d7a;
- background-color: transparent;
-}
-.dropdown-menu-item-renderer-selected {
- padding: 8px 16px;
- line-height: 1.875;
- font-size: inherit;
- color: #fff;
- background-color: #1abc9c;
-}
-.dropdown-menu-item-renderer:hover {
- font-size: inherit;
- color: #55606c;
- background-color: rgba(202, 206, 209, .5);
-}
-
-.dropdown-toggle-open-btn {
- border-radius: 4px;
- color: #fff;
- background-color: #1abc9c;
- border-color: #1abc9c;
- }
-
-.dropdown-toggle-open-btn:hover {
- border-radius: 4px;
- color: #fff;
- background-color: #48c9b0;
- border-color: #48c9b0;
- }
-
-.dropdown-caret {
- display: inline-block;
- color: inherit;
- background-color: inherit;
- width: 0;
- height: 0;
- margin-left: 5px;
- vertical-align: middle;
- border-top: 8px solid;
- border-right: 6px solid transparent;
- border-left: 6px solid transparent;
- -webkit-transition: border-color .25s, color .25s;
- transition: border-color .25s, color .25s;
- }
-
HContainer
{
IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
@@ -340,83 +178,6 @@ PanelWithControlBar
padding: 2px;
}
-.radio-icon,
-.radio-icon-hover,
-.radio-icon-checked
-{
- position: absolute;
- top: 0;
- left: 0;
- display: block;
- width: 20px;
- height: 20px;
- font-size: 20px;
- line-height: 20px;
- color: #bdc3c7;
- text-align: center;
- cursor: pointer;
-
- /* .radio .icon-checked:before */
- /* .radio .icon-unchecked:before */
- font-family: 'Flat-UI-Icons';
- font-style: normal;
- font-weight: normal;
- font-variant: normal;
- text-transform: none;
-
- speak: none;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-
- font-size: 20px;
- line-height: 20px;
-}
-
-.radio-icon:before
-{
- content: "\e60b";
-}
-
-.radio-icon-hover:before
-{
- content: "\e60c";
-}
-
-.radio-icon-checked:before
-{
- content: "\e60c";
-}
-
-.radio-icon-checked
-{
- color: #1abc9c;
-}
-
-.radio-input
-{
- position: absolute;
- top: 0;
- left: 0;
- width: 20px;
- height: 20px;
- padding: 0;
- margin: 0;
- outline: none !important;
- opacity: 0;
-}
-
-RadioButton
-{
- /* .radio */
- position: relative;
- padding-left: 32px;
- margin-bottom: 12px;
- font-size: 14px;
- line-height: 1.5;
- -webkit-transition: color .25s linear;
- transition: color .25s linear;
-}
-
SimpleList
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
@@ -436,24 +197,6 @@ StringItemRenderer
height: 16;
}
-TextArea
-{
- padding: 6px 10px;
- font-size: 13px;
- border-radius: 6px;
- border: 2px solid #1abc9c;
-}
-
-TextInput
-{
- height: 35px;
- padding: 6px 10px;
- font-size: 13px;
- line-height: 1.462;
- border-radius: 6px;
- border: 2px solid #1abc9c;
-}
-
TitleBar
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
@@ -505,7 +248,10 @@ Alert
Border
{
+ border-color: inherit;
+ border-style: inherit;
border-radius: inherit;
+ border-width: inherit;
border: inherit;
}
@@ -634,92 +380,6 @@ RadioButton
IBeadView: ClassReference("org.apache.flex.html.beads.RadioButtonView");
}
-.vscrollbar-uparrow {
- padding: 0px;
- display: inline-block;
- border-color: #16a085;
- border-radius: initial;
- background-color: transparent;
- width: 0;
- height: 0;
- margin-left: 5px;
- vertical-align: middle;
- border-bottom: 8px solid;
- border-right: 6px solid transparent;
- border-left: 6px solid transparent;
- -webkit-transition: border-color .25s, color .25s;
- transition: border-color .25s, color .25s;
- }
-.vscrollbar-downarrow-btn {
- padding: 2px;
- display: inline-block;
- border-style: none;
- border-radius: initial;
- background-color: transparent;
- width: 12;
- height: 12;
- margin-left: 5px;
- vertical-align: middle;
- }
-.vscrollbar-uparrow-btn {
- padding: 2px;
- display: inline-block;
- border-style: none;
- border-radius: initial;
- background-color: transparent;
- width: 12;
- height: 12;
- margin-left: 5px;
- vertical-align: middle;
- }
-.vscrollbar-downarrow {
- padding: 0px;
- display: inline-block;
- border-color: #16a085;
- border-radius: initial;
- background-color: transparent;
- width: 0;
- height: 0;
- margin-left: 5px;
- vertical-align: middle;
- border-top: 8px solid;
- border-right: 6px solid transparent;
- border-left: 6px solid transparent;
- -webkit-transition: border-color .25s, color .25s;
- transition: border-color .25s, color .25s;
- }
-.vscrollbar-track {
- padding: 0px;
- position: relative;
- width: 8px;
- height: 8px;
- /*margin-bottom: 20px;*/
- cursor: pointer;
- background-color: #ebedef;
- border-radius: 4px;
- /*border-radius: 32px;*/
- box-shadow: none;
- }
-.vscrollbar-thumb {
- padding: 0px;
- position: absolute;
- z-index: 2;
- width: 12px;
- height: 12px;
- cursor: pointer;
- background-color: #16a085;
- border-radius: 6px;
- -webkit-transition: background .25s;
- transition: background .25s;
- }
-.vscrollbar-thumb:hover {
- background-color: #48c9b0;
- outline: none;
- }
-.vscrollbar-thumb:active {
- background-color: #16a085;
- }
-
ScrollBar
{
IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
@@ -765,6 +425,10 @@ TextArea
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
width: 135;
height: 20;
}
@@ -789,6 +453,10 @@ TextInput
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
width: 135;
height: 20;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
index 30df676..ec19fae 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
@@ -28,14 +28,11 @@ package org.apache.flex.html.beads
import org.apache.flex.core.BeadViewBase;
import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.CSSShape;
- import org.apache.flex.core.CSSSprite;
import org.apache.flex.core.IBeadView;
import org.apache.flex.core.IPopUpHost;
import org.apache.flex.core.ISelectionModel;
import org.apache.flex.core.IStrand;
import org.apache.flex.core.IPopUpHost;
- import org.apache.flex.core.IUIBase;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
@@ -64,42 +61,47 @@ package org.apache.flex.html.beads
*/
public function DropDownListView()
{
- upSprite = new CSSSprite();
- upSprite.className = 'dropdown-toggle-open-btn';
- downSprite = new CSSSprite();
- downSprite.className = 'dropdown-toggle-open-btn';
- overSprite = new CSSSprite();
- overSprite.className = 'dropdown-toggle-open-btn';
- overSprite.state = 'hover';
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
upTextField = new CSSTextField();
downTextField = new CSSTextField();
overTextField = new CSSTextField();
upSprite.addChild(upTextField);
overSprite.addChild(overTextField);
downSprite.addChild(downTextField);
+ upTextField.border = true;
+ downTextField.border = true;
+ overTextField.border = true;
+ upTextField.background = true;
+ downTextField.background = true;
+ overTextField.background = true;
+ upTextField.borderColor = 0;
+ downTextField.borderColor = 0;
+ overTextField.borderColor = 0;
+ upTextField.backgroundColor = 0xEEEEEE;
+ downTextField.backgroundColor = 0x808080;
+ overTextField.backgroundColor = 0xFFFFFF;
upTextField.selectable = false;
- upTextField.parentDrawsBackground = true;
upTextField.type = TextFieldType.DYNAMIC;
downTextField.selectable = false;
- downTextField.parentDrawsBackground = true;
downTextField.type = TextFieldType.DYNAMIC;
overTextField.selectable = false;
- overTextField.parentDrawsBackground = true;
- overTextField.type = TextFieldType.DYNAMIC;
+ overTextField.type = TextFieldType.DYNAMIC;
// auto-size collapses if no text
//upTextField.autoSize = "left";
//downTextField.autoSize = "left";
//overTextField.autoSize = "left";
- upArrows = new CSSShape();
- upArrows.className = 'dropdown-caret';
- overArrows = new CSSShape();
- overArrows.className = 'dropdown-caret';
- downArrows = new CSSShape();
- downArrows.className = 'dropdown-caret';
+ upArrows = new Shape();
+ overArrows = new Shape();
+ downArrows = new Shape();
upSprite.addChild(upArrows);
overSprite.addChild(overArrows);
downSprite.addChild(downArrows);
+ drawArrows(upArrows, 0xEEEEEE);
+ drawArrows(overArrows, 0xFFFFFF);
+ drawArrows(downArrows, 0x808080);
}
@@ -153,29 +155,17 @@ package org.apache.flex.html.beads
{
var ww:Number = DisplayObject(_strand).width;
var hh:Number = DisplayObject(_strand).height;
- upArrows.draw(0, 0);
- overArrows.draw(0, 0);
- downArrows.draw(0, 0);
- upSprite.draw(ww, hh);
- overSprite.draw(ww, hh);
- downSprite.draw(ww, hh);
upArrows.x = ww - upArrows.width;
overArrows.x = ww - overArrows.width;
downArrows.x = ww - downArrows.width;
- upArrows.y = (hh - upArrows.height) / 2;
- overArrows.y = (hh - overArrows.height) / 2;
- downArrows.y = (hh - downArrows.height) / 2;
upTextField.width = upArrows.x;
downTextField.width = downArrows.x;
overTextField.width = overArrows.x;
- upTextField.height = upTextField.textHeight + 5;
- downTextField.height = downTextField.textHeight + 5;
- overTextField.height = overTextField.textHeight + 5;
- upTextField.y = (hh - upTextField.height) / 2;
- downTextField.y = (hh - downTextField.height) / 2;
- overTextField.y = (hh - overTextField.height) / 2;
+ upTextField.height = hh;
+ downTextField.height = hh;
+ overTextField.height = hh;
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
shape.graphics.drawRect(0, 0, ww, hh);
@@ -185,14 +175,36 @@ package org.apache.flex.html.beads
private var upTextField:CSSTextField;
private var downTextField:CSSTextField;
private var overTextField:CSSTextField;
- private var upSprite:CSSSprite;
- private var downSprite:CSSSprite;
- private var overSprite:CSSSprite;
- private var upArrows:CSSShape;
- private var downArrows:CSSShape;
- private var overArrows:CSSShape;
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upArrows:Shape;
+ private var downArrows:Shape;
+ private var overArrows:Shape;
- /**
+ private function drawArrows(shape:Shape, color:uint):void
+ {
+ var g:Graphics = shape.graphics;
+ g.beginFill(color);
+ g.drawRect(0, 0, 16, 17);
+ g.endFill();
+ g.beginFill(0);
+ g.moveTo(8, 2);
+ g.lineTo(12, 6);
+ g.lineTo(4, 6);
+ g.lineTo(8, 2);
+ g.endFill();
+ g.beginFill(0);
+ g.moveTo(8, 14);
+ g.lineTo(12, 10);
+ g.lineTo(4, 10);
+ g.lineTo(8, 14);
+ g.endFill();
+ g.lineStyle(1, 0);
+ g.drawRect(0, 0, 16, 17);
+ }
+
+ /**
* The text that is displayed in the view.
*
* @langversion 3.0
@@ -215,12 +227,6 @@ package org.apache.flex.html.beads
upTextField.text = value;
downTextField.text = value;
overTextField.text = value;
- upTextField.height = upTextField.textHeight + 5;
- downTextField.height = downTextField.textHeight + 5;
- overTextField.height = overTextField.textHeight + 5;
- upTextField.y = (hh - upTextField.height) / 2;
- downTextField.y = (hh - downTextField.height) / 2;
- overTextField.y = (hh - overTextField.height) / 2;
}
private var _popUp:IStrand;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
index 199744b..b2a8a14 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
@@ -58,7 +58,6 @@ package org.apache.flex.html.supportClasses
public function DropDownListList()
{
super();
- className = "dropdown-menu";
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
index 89a129c..b87acb4 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js
@@ -48,90 +48,43 @@ org.apache.flex.html.CheckBox.prototype.createElement =
this.element = document.createElement('label');
- this.input = document.createElement('input');
- this.input.type = 'checkbox';
- this.input.className = 'checkbox-input';
- this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
- this.element.appendChild(this.input);
-
- this.checkbox = document.createElement('span');
- this.checkbox.className = 'checkbox-icon';
- this.checkbox.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
- this.checkbox.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
- this.element.appendChild(this.checkbox);
-
- this.textNode = document.createTextNode('');
- this.element.appendChild(this.textNode);
+ cb = document.createElement('input');
+ cb.type = 'checkbox';
+ this.element.appendChild(cb);
+ this.element.appendChild(document.createTextNode(''));
+
this.element.className = 'CheckBox';
this.typeNames = 'CheckBox';
this.positioner = this.element;
- this.input.flexjs_wrapper = this;
- this.checkbox.flexjs_wrapper = this;
+ cb.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
return this.element;
};
-/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.CheckBox.prototype.mouseOverHandler =
- function(e) {
- this.checkbox.className = 'checkbox-icon-hover';
-};
-
-
-/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.CheckBox.prototype.mouseOutHandler =
- function(e) {
- if (this.input.checked)
- this.checkbox.className = 'checkbox-icon-checked';
- else
- this.checkbox.className = 'checkbox-icon';
-};
-
-
-/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.CheckBox.prototype.selectionChangeHandler =
- function(e) {
- if (this.input.checked)
- this.checkbox.className = 'checkbox-icon-checked';
- else
- this.checkbox.className = 'checkbox-icon';
-};
-
-
Object.defineProperties(org.apache.flex.html.CheckBox.prototype, {
/** @export */
text: {
/** @this {org.apache.flex.html.CheckBox} */
get: function() {
- return this.textNode.nodeValue;
+ return this.element.childNodes.item(1).nodeValue;
},
/** @this {org.apache.flex.html.CheckBox} */
set: function(value) {
- this.textNode.nodeValue = value;
+ this.element.childNodes.item(1).nodeValue = value;
}
},
/** @export */
selected: {
/** @this {org.apache.flex.html.CheckBox} */
get: function() {
- return this.input.checked;
+ return this.element.childNodes.item(0).checked;
},
/** @this {org.apache.flex.html.CheckBox} */
set: function(value) {
- this.input.checked = value;
- if (value)
- this.checkbox.className = 'checkbox-icon-checked';
- else
- this.checkbox.className = 'checkbox-icon';
+ this.element.childNodes.item(0).checked = value;
}
}
});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
index ed89c9a..8de4c1f 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
@@ -46,144 +46,39 @@ org.apache.flex.html.DropDownList.prototype.FLEXJS_CLASS_INFO =
*/
org.apache.flex.html.DropDownList.prototype.createElement =
function() {
- var button, input;
-
- this.element = document.createElement('div');
-
- this.button = button = document.createElement('button');
- button.className = 'dropdown-toggle-open-btn';
- goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this));
- this.element.appendChild(button);
-
- var caret = document.createElement('span');
- caret.className = 'dropdown-caret';
-
- this.element.style.position = 'relative';
+ this.element = document.createElement('select');
+ this.element.size = 1;
+ goog.events.listen(this.element, 'change',
+ goog.bind(this.changeHandler, this));
this.positioner = this.element;
- // add a click handler so that a click outside of the combo box can
- // dismiss the pop-up should it be visible.
- goog.events.listen(document, 'click',
- goog.bind(this.dismissPopup, this));
-
- button.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
- caret.flexjs_wrapper = this;
return this.element;
};
-/**
- * @export
- * @param {Object} event The event.
- */
-org.apache.flex.html.DropDownList.prototype.selectChanged =
- function(event) {
- var select;
-
- select = event.target;
-
- this.selectedIndex = parseInt(select.id, 10);
-
- this.menu.parentNode.removeChild(this.menu);
- this.menu = null;
-
- this.dispatchEvent('change');
-};
-
-
-/**
- * @export
- * @param {Object=} opt_event The event.
- */
-org.apache.flex.html.DropDownList.prototype.dismissPopup =
- function(opt_event) {
- // remove the popup if it already exists
- if (this.menu) {
- this.menu.parentNode.removeChild(this.menu);
- this.menu = null;
- }
-};
-
-
-/**
- * @export
- * @param {Object} event The event.
- */
-org.apache.flex.html.DropDownList.prototype.buttonClicked =
- function(event) {
- /**
- * @type {Array.<string>}
- */
- var dp;
- var i, button, left, n, opt, opts, pn, popup, select, si, top, width;
-
- event.stopPropagation();
-
- if (this.popup) {
- this.dismissPopup();
-
- return;
- }
-
- button = this.element.childNodes.item(0);
-
- pn = this.element;
- top = pn.offsetTop + button.offsetHeight;
- left = pn.offsetLeft;
- width = pn.offsetWidth;
-
- /*
- popup = document.createElement('div');
- popup.className = 'dropdown-menu';
- popup.id = 'test';
- popup.style.position = 'absolute';
- popup.style.top = top.toString() + 'px';
- popup.style.left = left.toString() + 'px';
- popup.style.width = width.toString() + 'px';
- popup.style.margin = '0px auto';
- popup.style.padding = '0px';
- popup.style.zIndex = '10000';
- */
-
- this.menu = select = document.createElement('ul');
- select.style.width = width.toString() + 'px';
- goog.events.listen(select, 'click', goog.bind(this.selectChanged, this));
- select.className = 'dropdown-menu';
-
- dp = /** @type {Array.<string>} */ (this.dataProvider);
- n = dp.length;
- for (i = 0; i < n; i++) {
- opt = document.createElement('li');
- opt.style.backgroundColor = 'transparent';
- var ir = document.createElement('a');
- ir.innerHTML = dp[i];
- ir.id = i.toString();
- if (i == this.selectedIndex)
- ir.className = 'dropdown-menu-item-renderer-selected';
- else
- ir.className = 'dropdown-menu-item-renderer';
- opt.appendChild(ir);
- select.appendChild(opt);
- }
-
- this.element.appendChild(select);
-};
-
-
Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
+ /** @export */
dataProvider: {
/** @this {org.apache.flex.html.DropDownList} */
- get: function() {
- return this.model.dataProvider;
- },
- /** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
var dp, i, n, opt;
this.model.dataProvider = value;
+ dp = this.element.options;
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ dp.remove(0);
+ }
+
+ n = value.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('option');
+ opt.text = value[i];
+ dp.add(opt);
+ }
}
},
/** @export */
@@ -198,7 +93,7 @@ Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
/** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
this.model.selectedIndex = value;
- this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
+ this.element.selectedIndex = value;
}
},
/** @export */
@@ -213,7 +108,17 @@ Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
/** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
this.model.selectedItem = value;
- this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
- }
+ this.element.selectedIndex = this.selectedIndex;
+ }
}
});
+
+
+/**
+ * @protected
+ */
+org.apache.flex.html.DropDownList.prototype.changeHandler =
+ function() {
+ this.model.selectedIndex = this.element.selectedIndex;
+ this.dispatchEvent('change');
+};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/892562ec/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
index 7cbfe75..4c8d18d 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/RadioButton.js
@@ -51,25 +51,15 @@ org.apache.flex.html.RadioButton.radioCounter = 0;
org.apache.flex.html.RadioButton.prototype.createElement =
function() {
- // hide this eleement
this.input = document.createElement('input');
this.input.type = 'radio';
- this.input.className = 'radio-input';
this.input.id = '_radio_' + org.apache.flex.html.RadioButton.radioCounter++;
- this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
-
- this.radio = document.createElement('span');
- this.radio.className = 'radio-icon';
- this.radio.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
- this.radio.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
this.textNode = document.createTextNode('radio button');
this.labelFor = document.createElement('label');
this.labelFor.appendChild(this.input);
- this.labelFor.appendChild(this.radio);
this.labelFor.appendChild(this.textNode);
- this.labelFor.style.position = 'relative';
this.element = this.labelFor;
this.element.className = 'RadioButton';
@@ -77,7 +67,6 @@ org.apache.flex.html.RadioButton.prototype.createElement =
this.positioner = this.element;
this.input.flexjs_wrapper = this;
- this.radio.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
this.textNode.flexjs_wrapper = this;
@@ -86,37 +75,6 @@ org.apache.flex.html.RadioButton.prototype.createElement =
/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.RadioButton.prototype.mouseOverHandler =
- function(e) {
- this.radio.className = 'radio-icon-hover';
-};
-
-
-/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.RadioButton.prototype.mouseOutHandler =
- function(e) {
- if (this.input.checked)
- this.radio.className = 'radio-icon-checked';
- else
- this.radio.className = 'radio-icon';
-};
-
-
-/**
- * @param {Event} e The event object.
- */
-org.apache.flex.html.RadioButton.prototype.selectionChangeHandler =
- function(e) {
- // this should reset the icons in the non-selected radio
- this.selectedValue = this.value;
-};
-
-
-/**
* @export
*/
org.apache.flex.html.RadioButton.prototype.initModel =
@@ -173,10 +131,6 @@ Object.defineProperties(org.apache.flex.html.RadioButton.prototype, {
/** @this {org.apache.flex.html.RadioButton} */
set: function(value) {
this.input.checked = value;
- if (this.input.checked)
- this.radio.className = 'radio-icon-checked';
- else
- this.radio.className = 'radio-icon';
}
},
/** @export */
@@ -217,10 +171,8 @@ Object.defineProperties(org.apache.flex.html.RadioButton.prototype, {
for (i = 0; i < n; i++) {
if (buttons[i].value === value) {
buttons[i].checked = true;
- buttons[i].flexjs_wrapper.selected = true;
+ break;
}
- else
- buttons[i].flexjs_wrapper.selected = false;
}
}
}
[30/36] git commit: [flex-asjs] [refs/heads/develop] - tweaks to
basic ui
Posted by ah...@apache.org.
tweaks to basic ui
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/9bf55616
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/9bf55616
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/9bf55616
Branch: refs/heads/develop
Commit: 9bf55616361da63ef7aeb5cbd23d1c3956a78ac5
Parents: cebebe4
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 23:25:57 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 23:25:57 2015 -0700
----------------------------------------------------------------------
.../flat/supportClasses/DropDownListList.as | 12 ----
frameworks/projects/HTML/as/defaults.css | 34 ++++++++--
.../apache/flex/html/beads/CSSTextButtonView.as | 4 +-
.../org/apache/flex/html/beads/CheckBoxView.as | 12 ++--
.../flex/html/beads/DownArrowButtonView.as | 24 +++----
.../apache/flex/html/beads/DropDownListView.as | 69 ++++++++++----------
.../apache/flex/html/beads/RadioButtonView.as | 8 +--
.../org/apache/flex/html/beads/TextAreaView.as | 17 +++--
.../org/apache/flex/html/beads/TextInputView.as | 7 +-
.../apache/flex/html/beads/UpArrowButtonView.as | 22 +++----
.../flex/html/beads/VScrollBarThumbView.as | 25 +++----
.../flex/html/beads/VScrollBarTrackView.as | 12 ++--
.../html/supportClasses/DropDownListList.as | 12 ----
13 files changed, 129 insertions(+), 129 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
index 097f279..f423d24 100644
--- a/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
@@ -60,17 +60,5 @@ package org.apache.flex.flat.supportClasses
super();
className = "dropdown-menu";
}
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- var bb:SolidBackgroundBead = new SolidBackgroundBead();
- bb.backgroundColor = 0xffffff;
- addBead(bb);
- }
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 86b2ccb..062e2af 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -35,22 +35,23 @@
Button
{
- background-color: #d8d8d8;
- border: 1px solid #000000;
+ background-color: #f8f8f8;
+ border: 1px solid #808080;
+ border-radius: 2px;
padding: 4px;
}
Button:hover
{
- background-color: #9fa0a1;
- border: 1px solid #000000;
+ background-color: #e8e8e8;
+ border: 1px solid #808080;
padding: 4px;
}
Button:active
{
- background-color: #929496;
- border: 1px solid #000000;
+ background-color: #d8d8d8;
+ border: 1px solid #808080;
padding: 4px;
}
@@ -197,6 +198,21 @@ StringItemRenderer
height: 16;
}
+TextInput
+{
+ border: 1px solid #808080;
+ border-radius: 2px;
+ padding: 4px;
+}
+
+TextArea
+{
+ border: 1px solid #808080;
+ border-radius: 2px;
+ padding: 4px;
+ resize: none;
+}
+
TitleBar
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
@@ -310,6 +326,12 @@ DropDownListList
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
+ border-style: solid;
+ border-radius: 4px;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
}
Image
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index f400583..b6f65a8 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -232,8 +232,8 @@ package org.apache.flex.html.beads
0, 0, useWidth, useHeight,
borderColor, backgroundColor == null ? null : bgColor, borderThickness, bgAlpha,
borderEllipseWidth, borderEllipseHeight);
- textField.y = (useHeight - textField.textHeight) / 2;
- textField.x = (useWidth - textField.textWidth) / 2;
+ textField.y = ((useHeight - textField.textHeight) / 2) - 2;
+ textField.x = ((useWidth - textField.textWidth) / 2) - 2;
}
var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
if (backgroundImage)
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
index c666d87..a04f2bf 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckBoxView.as
@@ -280,16 +280,16 @@ package org.apache.flex.html.beads
protected function drawCheckBox(icon:Shape) : void
{
icon.graphics.clear();
- icon.graphics.beginFill(0xCCCCCC);
- icon.graphics.lineStyle(1,0x333333);
+ icon.graphics.beginFill(0xf8f8f8);
+ icon.graphics.lineStyle(1,0x808080);
icon.graphics.drawRect(0,0,10,10);
icon.graphics.endFill();
if( _toggleButtonModel.selected ) {
- icon.graphics.moveTo(0,0);
- icon.graphics.lineTo(10,10);
- icon.graphics.moveTo(10,0);
- icon.graphics.lineTo(0,10);
+ icon.graphics.lineStyle(2,0);
+ icon.graphics.moveTo(3,4);
+ icon.graphics.lineTo(5,7);
+ icon.graphics.lineTo(9,0);
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
index 119b0c7..55e4c67 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DownArrowButtonView.as
@@ -52,23 +52,23 @@ package org.apache.flex.html.beads
downView = new Shape();
overView = new Shape();
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
}
private function drawView(g:Graphics, bgColor:uint):void
{
- g.lineStyle(1);
+ g.lineStyle(1, 0x808080);
g.beginFill(bgColor);
- g.drawRect(0, 0, 16, 16);
+ g.drawRoundRect(0, 0, 12, 12, 4);
g.endFill();
g.lineStyle(0);
g.beginFill(0);
- g.moveTo(4, 4);
- g.lineTo(12, 4);
- g.lineTo(8, 12);
- g.lineTo(4, 4);
+ g.moveTo(3, 3);
+ g.lineTo(9, 3);
+ g.lineTo(6, 9);
+ g.lineTo(3, 3);
g.endFill();
}
@@ -87,7 +87,7 @@ package org.apache.flex.html.beads
super.strand = value;
shape = new Shape();
shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 16, 16);
+ shape.graphics.drawRect(0, 0, 12, 12);
shape.graphics.endFill();
SimpleButton(value).upState = upView;
SimpleButton(value).downState = downView;
@@ -104,8 +104,8 @@ package org.apache.flex.html.beads
private function sizeChangeHandler(event:Event):void
{
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 12;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 12;
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
index ec19fae..391350b 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/DropDownListView.as
@@ -26,16 +26,16 @@ package org.apache.flex.html.beads
import flash.display.Sprite;
import flash.text.TextFieldType;
- import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.BeadViewBase;
import org.apache.flex.core.CSSTextField;
import org.apache.flex.core.IBeadView;
import org.apache.flex.core.IPopUpHost;
import org.apache.flex.core.ISelectionModel;
import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IPopUpHost;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.SolidBorderUtil;
/**
* The DropDownListView class is the default view for
@@ -70,18 +70,9 @@ package org.apache.flex.html.beads
upSprite.addChild(upTextField);
overSprite.addChild(overTextField);
downSprite.addChild(downTextField);
- upTextField.border = true;
- downTextField.border = true;
- overTextField.border = true;
- upTextField.background = true;
- downTextField.background = true;
- overTextField.background = true;
- upTextField.borderColor = 0;
- downTextField.borderColor = 0;
- overTextField.borderColor = 0;
- upTextField.backgroundColor = 0xEEEEEE;
- downTextField.backgroundColor = 0x808080;
- overTextField.backgroundColor = 0xFFFFFF;
+ upTextField.parentDrawsBackground = true;
+ downTextField.parentDrawsBackground = true;
+ overTextField.parentDrawsBackground = true;
upTextField.selectable = false;
upTextField.type = TextFieldType.DYNAMIC;
downTextField.selectable = false;
@@ -99,9 +90,9 @@ package org.apache.flex.html.beads
upSprite.addChild(upArrows);
overSprite.addChild(overArrows);
downSprite.addChild(downArrows);
- drawArrows(upArrows, 0xEEEEEE);
- drawArrows(overArrows, 0xFFFFFF);
- drawArrows(downArrows, 0x808080);
+ drawArrows(upArrows);
+ drawArrows(overArrows);
+ drawArrows(downArrows);
}
@@ -156,16 +147,24 @@ package org.apache.flex.html.beads
var ww:Number = DisplayObject(_strand).width;
var hh:Number = DisplayObject(_strand).height;
- upArrows.x = ww - upArrows.width;
- overArrows.x = ww - overArrows.width;
- downArrows.x = ww - downArrows.width;
-
+ upArrows.x = ww - upArrows.width - 6;
+ overArrows.x = ww - overArrows.width - 6;
+ downArrows.x = ww - downArrows.width - 6;
+ upArrows.y = (hh - upArrows.height) / 2;
+ overArrows.y = (hh - overArrows.height) / 2;
+ downArrows.y = (hh - downArrows.height) / 2;
+
upTextField.width = upArrows.x;
downTextField.width = downArrows.x;
overTextField.width = overArrows.x;
upTextField.height = hh;
downTextField.height = hh;
overTextField.height = hh;
+
+ drawBorder(upSprite, 0xf8f8f8, ww, hh);
+ drawBorder(overSprite, 0xe8e8e8, ww, hh);
+ drawBorder(downSprite, 0xd8d8d8, ww, hh);
+
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
shape.graphics.drawRect(0, 0, ww, hh);
@@ -182,26 +181,28 @@ package org.apache.flex.html.beads
private var downArrows:Shape;
private var overArrows:Shape;
- private function drawArrows(shape:Shape, color:uint):void
+ private function drawBorder(sprite:Sprite, color:uint, ww:Number, hh:Number):void
+ {
+ SolidBorderUtil.drawBorder(sprite.graphics, 0, 0,
+ ww, hh,
+ 0x808080, color, 1, 1, 4);
+ }
+
+ private function drawArrows(shape:Shape):void
{
var g:Graphics = shape.graphics;
- g.beginFill(color);
- g.drawRect(0, 0, 16, 17);
+ g.beginFill(0);
+ g.moveTo(8, 0);
+ g.lineTo(12, 4);
+ g.lineTo(4, 4);
+ g.lineTo(8, 0);
g.endFill();
g.beginFill(0);
- g.moveTo(8, 2);
+ g.moveTo(8, 10);
g.lineTo(12, 6);
g.lineTo(4, 6);
- g.lineTo(8, 2);
- g.endFill();
- g.beginFill(0);
- g.moveTo(8, 14);
- g.lineTo(12, 10);
- g.lineTo(4, 10);
- g.lineTo(8, 14);
+ g.lineTo(8, 10);
g.endFill();
- g.lineStyle(1, 0);
- g.drawRect(0, 0, 16, 17);
}
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
index 81475f7..245c3d3 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioButtonView.as
@@ -266,14 +266,14 @@ package org.apache.flex.html.beads
protected function drawRadioButton(icon:Shape) : void
{
icon.graphics.clear();
- icon.graphics.beginFill(0xCCCCCC);
- icon.graphics.lineStyle(1,0x333333);
+ icon.graphics.beginFill(0xf8f8f8);
+ icon.graphics.lineStyle(1,0x808080);
icon.graphics.drawEllipse(0,0,10,10);
icon.graphics.endFill();
if( selected ) {
- icon.graphics.beginFill(0x555555);
- icon.graphics.drawEllipse(2,2,6,6);
+ icon.graphics.beginFill(0);
+ icon.graphics.drawEllipse(3,3,4,4);
icon.graphics.endFill();
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
index 165eb52..9649240 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextAreaView.as
@@ -143,7 +143,7 @@ package org.apache.flex.html.beads
vsbm.stepSize = 1;
vsbm.value = 0;
vsb.model = vsbm;
- vsb.width = 16;
+ vsb.width = 12;
IParent(host).addElement(vsb);
vsb.addEventListener("scroll", scrollHandler);
@@ -165,20 +165,23 @@ package org.apache.flex.html.beads
private function sizeChangedHandler(event:Event):void
{
- var ww:Number = DisplayObject(host).width - DisplayObject(vScrollBar).width;
- if( !isNaN(ww) && ww > 0 ) {
+ var ww:Number = DisplayObject(host).width;
+ if( !isNaN(ww) && ww > 0 )
+ _border.width = ww;
+
+ ww -= DisplayObject(vScrollBar).width;
+ if( !isNaN(ww) && ww > 0 )
textField.width = ww;
- _border.width = ww;
- }
var hh:Number = DisplayObject(host).height;
- if( !isNaN(hh) && hh > 0 ) {
+ if( !isNaN(hh) && hh > 0 )
+ {
textField.height = hh;
_border.height = hh;
}
var sb:DisplayObject = DisplayObject(vScrollBar);
- sb.y = 0;
+ sb.y = 1;
sb.x = textField.width - 1;
sb.height = textField.height;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
index dcbce38..94bf426 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/TextInputView.as
@@ -82,7 +82,12 @@ package org.apache.flex.html.beads
if( !isNaN(ww) && ww > 0 ) textField.width = ww;
var hh:Number = DisplayObject(host).height;
- if( !isNaN(hh) && hh > 0 ) textField.height = hh;
+ if( !isNaN(hh) && hh > 0 )
+ {
+ textField.height = textField.textHeight + 5;
+ }
+
+ textField.y = ((hh - textField.height) / 2);
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
index 74c4ffd..4f12625 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/UpArrowButtonView.as
@@ -53,23 +53,23 @@ package org.apache.flex.html.beads
downView = new Shape();
overView = new Shape();
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
+ drawView(upView.graphics, 0xf8f8f8);
+ drawView(downView.graphics, 0xd8d8d8);
+ drawView(overView.graphics, 0xe8e8e8);
}
private function drawView(g:Graphics, bgColor:uint):void
{
g.lineStyle(1);
g.beginFill(bgColor);
- g.drawRect(0, 0, 16, 16);
+ g.drawRoundRect(0, 0, 12, 12, 4);
g.endFill();
g.lineStyle(0);
g.beginFill(0);
- g.moveTo(4, 12);
- g.lineTo(12, 12);
- g.lineTo(8, 4);
- g.lineTo(4, 12);
+ g.moveTo(3, 9);
+ g.lineTo(9, 9);
+ g.lineTo(6, 3);
+ g.lineTo(3, 9);
g.endFill();
}
@@ -88,7 +88,7 @@ package org.apache.flex.html.beads
super.strand = value;
shape = new Shape();
shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 16, 16);
+ shape.graphics.drawRect(0, 0, 12, 12);
shape.graphics.endFill();
SimpleButton(value).upState = upView;
SimpleButton(value).downState = downView;
@@ -105,8 +105,8 @@ package org.apache.flex.html.beads
private function sizeChangeHandler(event:Event):void
{
- SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 16;
- SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 16;
+ SimpleButton(_strand).scaleX = SimpleButton(_strand).width / 12;
+ SimpleButton(_strand).scaleY = SimpleButton(_strand).height / 12;
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
index 79794d8..6578a82 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarThumbView.as
@@ -58,15 +58,8 @@ package org.apache.flex.html.beads
g.clear();
g.lineStyle(1);
g.beginFill(bgColor);
- g.drawRect(0, 0, 16, hh);
+ g.drawRoundRect(0, 0, 12, hh, 6);
g.endFill();
- hh = Math.round(hh / 2);
- g.moveTo(4, hh);
- g.lineTo(12, hh);
- g.moveTo(4, hh - 4);
- g.lineTo(12, hh - 4);
- g.moveTo(4, hh + 4);
- g.lineTo(12, hh + 4);
}
private var shape:Shape;
@@ -87,13 +80,13 @@ package org.apache.flex.html.beads
downView = new Shape();
overView = new Shape();
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
+ drawView(upView.graphics, 0xc8c8c8);
+ drawView(downView.graphics, 0xa8a8a8);
+ drawView(overView.graphics, 0xb8b8b8);
shape = new Shape();
shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 16, 16);
+ shape.graphics.drawRect(0, 0, 12, 12);
shape.graphics.endFill();
SimpleButton(value).upState = upView;
SimpleButton(value).downState = downView;
@@ -108,13 +101,13 @@ package org.apache.flex.html.beads
DisplayObject(_strand).scaleX = 1.0;
var hh:Number = DisplayObject(_strand).height;
- drawView(upView.graphics, 0xCCCCCC);
- drawView(downView.graphics, 0x808080);
- drawView(overView.graphics, 0xEEEEEE);
+ drawView(upView.graphics, 0xC8c8c8);
+ drawView(downView.graphics, 0xa8a8a8);
+ drawView(overView.graphics, 0xb8b8b8);
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 16, hh);
+ shape.graphics.drawRect(0, 0, 12, hh);
shape.graphics.endFill();
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
index 884c57b..e040b7e 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/VScrollBarTrackView.as
@@ -58,9 +58,9 @@ package org.apache.flex.html.beads
private function drawView(g:Graphics, bgColor:uint, h:Number):void
{
g.clear();
- g.lineStyle(1);
+ g.lineStyle(1, 0x808080);
g.beginFill(bgColor);
- g.drawRect(0, 0, 16, h);
+ g.drawRect(0, 0, 12, h);
g.endFill();
g.lineStyle(0);
}
@@ -72,12 +72,12 @@ package org.apache.flex.html.beads
var h:Number = SimpleButton(_strand).height;
- drawView(upView.graphics, 0xCCCCCC, h);
- drawView(downView.graphics, 0x808080, h);
- drawView(overView.graphics, 0xEEEEEE, h);
+ drawView(upView.graphics, 0xf8f8f8, h);
+ drawView(downView.graphics, 0xd8d8d8, h);
+ drawView(overView.graphics, 0xe8e8e8, h);
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 16, h);
+ shape.graphics.drawRect(0, 0, 12, h);
shape.graphics.endFill();
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/9bf55616/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
index b2a8a14..6bc1d43 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListList.as
@@ -59,17 +59,5 @@ package org.apache.flex.html.supportClasses
{
super();
}
-
- /**
- * @private
- */
- override public function addedToParent():void
- {
- super.addedToParent();
-
- var bb:SolidBackgroundBead = new SolidBackgroundBead();
- bb.backgroundColor = 0xffffff;
- addBead(bb);
- }
}
}
[14/36] git commit: [flex-asjs] [refs/heads/develop] - ignore font
files since they are downloaded or generated
Posted by ah...@apache.org.
ignore font files since they are downloaded or generated
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a2c39e7a
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a2c39e7a
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a2c39e7a
Branch: refs/heads/develop
Commit: a2c39e7a30361d29096592042ae523b7fb2a519b
Parents: 574df85
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 13:00:12 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 13:00:12 2015 -0700
----------------------------------------------------------------------
.gitignore | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a2c39e7a/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 4f4e613..d2aacfb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,7 @@ dist
test-output
build.log
release
+fonts
out
gen
bin-debug
[03/36] git commit: [flex-asjs] [refs/heads/develop] - Add
StyleableCSSTextField for more control over styles in pieces of a skin
Posted by ah...@apache.org.
Add StyleableCSSTextField for more control over styles in pieces of a skin
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5e4cd97b
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5e4cd97b
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5e4cd97b
Branch: refs/heads/develop
Commit: 5e4cd97b56b28c8012dbb4abbde2dc603b61e8f6
Parents: cfded8d
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:51:30 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:51:30 2015 -0700
----------------------------------------------------------------------
frameworks/projects/Core/as/src/CoreClasses.as | 1 +
.../apache/flex/core/StyleableCSSTextField.as | 200 +++++++++++++++++++
2 files changed, 201 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5e4cd97b/frameworks/projects/Core/as/src/CoreClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/CoreClasses.as b/frameworks/projects/Core/as/src/CoreClasses.as
index 337e5f3..0c04ca4 100644
--- a/frameworks/projects/Core/as/src/CoreClasses.as
+++ b/frameworks/projects/Core/as/src/CoreClasses.as
@@ -30,6 +30,7 @@ internal class CoreClasses
import org.apache.flex.core.BeadViewBase; BeadViewBase;
import org.apache.flex.core.BrowserWindow; BrowserWindow;
import org.apache.flex.core.CSSTextField; CSSTextField;
+ import org.apache.flex.core.StyleableCSSTextField; StyleableCSSTextField;
import org.apache.flex.core.ItemRendererClassFactory; ItemRendererClassFactory;
import org.apache.flex.core.FilledRectangle; FilledRectangle;
import org.apache.flex.core.IAlertModel; IAlertModel;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5e4cd97b/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
new file mode 100644
index 0000000..cbd7a08
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/StyleableCSSTextField.as
@@ -0,0 +1,200 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+ */
+ 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;
+ }
+ }
+}
\ No newline at end of file
[05/36] git commit: [flex-asjs] [refs/heads/develop] - allow
pseudo-state specific styles
Posted by ah...@apache.org.
allow pseudo-state specific styles
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c9c90ffb
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c9c90ffb
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c9c90ffb
Branch: refs/heads/develop
Commit: c9c90ffb67dd729ffa5797bab6d3373b5a07c77c
Parents: 30007f7
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:53:47 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:53:47 2015 -0700
----------------------------------------------------------------------
.../as/src/org/apache/flex/core/CSSTextField.as | 40 +++++++++++++-------
1 file changed, 26 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c9c90ffb/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
index a91174d..41ff87c 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSTextField.as
@@ -18,11 +18,11 @@
////////////////////////////////////////////////////////////////////////////////
package org.apache.flex.core
{
- import flash.text.TextField;
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFormat;
-
- import org.apache.flex.core.ValuesManager;
+ import flash.text.TextField;
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFormat;
+
+ import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.utils.CSSUtils;
@@ -65,6 +65,17 @@ package org.apache.flex.core
/**
* @private
+ * The CSS pseudo-state for lookups.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public var styleState:String;
+
+ /**
+ * @private
* The parentDrawsBackground property is set if the CSSTextField
* shouldn't draw a background
*
@@ -98,19 +109,19 @@ package org.apache.flex.core
sp.addEventListener("classNameChanged", updateStyles);
var tf: TextFormat = new TextFormat();
- tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily") as String;
- tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize");
- tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight") == "bold";
- tf.color = CSSUtils.toColor(ValuesManager.valuesImpl.getValue(sp, "color"));
+ tf.font = ValuesManager.valuesImpl.getValue(sp, "fontFamily", styleState) as String;
+ tf.size = ValuesManager.valuesImpl.getValue(sp, "fontSize", styleState);
+ tf.bold = ValuesManager.valuesImpl.getValue(sp, "fontWeight", styleState) == "bold";
+ tf.color = CSSUtils.toColor(ValuesManager.valuesImpl.getValue(sp, "color", styleState));
if (!parentHandlesPadding)
{
- var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding");
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left");
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right");
+ var padding:Object = ValuesManager.valuesImpl.getValue(sp, "padding", styleState);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(sp,"padding-left", styleState);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(sp,"padding-right", styleState);
tf.leftMargin = CSSUtils.getLeftValue(paddingLeft, padding, width);
tf.rightMargin = CSSUtils.getRightValue(paddingRight, padding, width);
}
- var align:Object = ValuesManager.valuesImpl.getValue(sp, "text-align");
+ var align:Object = ValuesManager.valuesImpl.getValue(sp, "text-align", styleState);
if (align == "center")
{
autoSize = TextFieldAutoSize.NONE;
@@ -123,7 +134,7 @@ package org.apache.flex.core
}
if (!parentDrawsBackground)
{
- var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color");
+ var backgroundColor:Object = ValuesManager.valuesImpl.getValue(sp, "background-color", styleState);
if (backgroundColor != null)
{
this.background = true;
@@ -139,5 +150,6 @@ package org.apache.flex.core
// force styles to be re-calculated
this.text = text;
}
+
}
}
\ No newline at end of file
[08/36] git commit: [flex-asjs] [refs/heads/develop] - use
CSSFontFaceBead
Posted by ah...@apache.org.
use CSSFontFaceBead
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/6017e95f
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/6017e95f
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/6017e95f
Branch: refs/heads/develop
Commit: 6017e95f525a308055c7832ec4239eefe75f1866
Parents: c28c2fe
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:57:14 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:57:14 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/src/DataBindingTest.mxml | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6017e95f/examples/DataBindingTest/src/DataBindingTest.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/DataBindingTest.mxml b/examples/DataBindingTest/src/DataBindingTest.mxml
index cf5e9e6..751e427 100644
--- a/examples/DataBindingTest/src/DataBindingTest.mxml
+++ b/examples/DataBindingTest/src/DataBindingTest.mxml
@@ -47,6 +47,7 @@ limitations under the License.
</js:itemConverter>
</js:LazyCollection>
</js:HTTPService>
+ <js:CSSFontFaceBead />
<js:ViewSourceContextMenuOption />
</js:beads>
</js:Application>
[31/36] git commit: [flex-asjs] [refs/heads/develop] - example
showing FlatUI-like theme
Posted by ah...@apache.org.
example showing FlatUI-like theme
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f6e65fdc
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f6e65fdc
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f6e65fdc
Branch: refs/heads/develop
Commit: f6e65fdc659c4e8cc97bac32d5e5e390c4fe7286
Parents: 9bf5561
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 23:27:03 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 23:27:03 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/build.xml | 1 -
examples/DataBindingTest/src/MyInitialView.mxml | 2 +-
examples/DataBindingTest_Flat/build.xml | 48 +++++++
.../src/DataBindingTest.mxml | 53 +++++++
.../DataBindingTest_Flat/src/MyInitialView.mxml | 144 +++++++++++++++++++
examples/DataBindingTest_Flat/src/README.txt | 52 +++++++
.../src/StockDataJSONItemConverter.as | 40 ++++++
.../src/controllers/MyController.as | 81 +++++++++++
.../DataBindingTest_Flat/src/models/MyModel.as | 124 ++++++++++++++++
9 files changed, 543 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest/build.xml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/build.xml b/examples/DataBindingTest/build.xml
index 7169be7..9c551dd 100644
--- a/examples/DataBindingTest/build.xml
+++ b/examples/DataBindingTest/build.xml
@@ -22,7 +22,6 @@
<project name="databindingtest" default="main" basedir=".">
<property name="FLEXJS_HOME" location="../.."/>
<property name="example" value="DataBindingTest" />
- <property name="theme_arg" value="-theme=${FLEXJS_HOME}/frameworks/libs/Flat.swc" />
<property file="${FLEXJS_HOME}/env.properties"/>
<property environment="env"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/MyInitialView.mxml b/examples/DataBindingTest/src/MyInitialView.mxml
index b153ba5..667254d 100644
--- a/examples/DataBindingTest/src/MyInitialView.mxml
+++ b/examples/DataBindingTest/src/MyInitialView.mxml
@@ -18,7 +18,7 @@ limitations under the License.
-->
<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:js="library://ns.apache.org/flexjs/flat"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
initComplete="initControls()">
<fx:Script>
<![CDATA[
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/build.xml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/build.xml b/examples/DataBindingTest_Flat/build.xml
new file mode 100644
index 0000000..ab55f2f
--- /dev/null
+++ b/examples/DataBindingTest_Flat/build.xml
@@ -0,0 +1,48 @@
+<?xml version="1.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.
+
+-->
+
+
+<project name="databindingtest_flat" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../.."/>
+ <property name="example" value="DataBindingTest" />
+ <property name="theme_arg" value="-theme=${FLEXJS_HOME}/frameworks/libs/Flat.swc" />
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="GOOG_HOME" value="${env.GOOG_HOME}"/>
+
+ <include file="${basedir}/../build_example.xml" />
+
+ <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}">
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ </target>
+
+
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/DataBindingTest.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/DataBindingTest.mxml b/examples/DataBindingTest_Flat/src/DataBindingTest.mxml
new file mode 100644
index 0000000..751e427
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/DataBindingTest.mxml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:local="*"
+ xmlns:js="library://ns.apache.org/flexjs/basic"
+ xmlns:models="models.*"
+ xmlns:controllers="controllers.*"
+ initialize="MyModel(model).stockSymbol='ADBE'"
+ >
+ <js:valuesImpl>
+ <js:SimpleCSSValuesImpl />
+ </js:valuesImpl>
+ <js:initialView>
+ <local:MyInitialView />
+ </js:initialView>
+ <js:model>
+ <models:MyModel />
+ </js:model>
+ <js:controller>
+ <controllers:MyController />
+ </js:controller>
+ <js:beads>
+ <js:HTTPService id="service">
+ <js:LazyCollection id="collection">
+ <js:inputParser>
+ <js:JSONInputParser />
+ </js:inputParser>
+ <js:itemConverter>
+ <local:StockDataJSONItemConverter />
+ </js:itemConverter>
+ </js:LazyCollection>
+ </js:HTTPService>
+ <js:CSSFontFaceBead />
+ <js:ViewSourceContextMenuOption />
+ </js:beads>
+</js:Application>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/MyInitialView.mxml b/examples/DataBindingTest_Flat/src/MyInitialView.mxml
new file mode 100644
index 0000000..b153ba5
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/MyInitialView.mxml
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:js="library://ns.apache.org/flexjs/flat"
+ initComplete="initControls()">
+ <fx:Script>
+ <![CDATA[
+ import models.MyModel;
+
+ import org.apache.flex.events.CustomEvent;
+
+ private var _symbol:String;
+
+ public function get symbol():String
+ {
+ return _symbol;
+ }
+
+ public function get requestedField():String
+ {
+ return radio1.selectedValue as String;
+ }
+
+ [Bindable]
+ public var fieldText:String;
+
+ private function radioChanged(e:org.apache.flex.events.Event):void
+ {
+ dispatchEvent(new CustomEvent("radioClicked"));
+ fieldText = RadioButton(e.target).text;
+ }
+
+ private function initControls():void
+ {
+ list.selectedItem = MyModel(applicationModel).stockSymbol;
+ radio1.selectedValue = MyModel(applicationModel).requestedField;
+ if (radio1.selected)
+ fieldText = radio1.text;
+ else if (radio2.selected)
+ fieldText = radio2.text;
+ else if (radio3.selected)
+ fieldText = radio3.text;
+ else if (radio4.selected)
+ fieldText = radio4.text;
+
+ }
+
+ private function setState():void
+ {
+ currentState = showAllData.selected ? "showAll" : "hideAll";
+ }
+ ]]>
+ </fx:Script>
+ <fx:Style>
+ @namespace basic "library://ns.apache.org/flexjs/basic";
+
+ .output {
+ font-size: 20px;
+ }
+
+ .topContainer {
+ padding: 10px;
+
+ }
+ .leftSide {
+ vertical-align: top;
+ margin-right: 10px;
+ }
+
+ .rightSide {
+ vertical-align: top;
+ margin-left: 10px;
+ padding-left: 10px;
+ }
+
+ .quoteButton {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ }
+ </fx:Style>
+ <js:states>
+ <js:State name="hideAll" />
+ <js:State name="showAll" />
+ </js:states>
+ <js:beads>
+ <js:ViewBaseDataBinding />
+ </js:beads>
+ <js:Container x="0" y="0" className="topContainer" >
+ <js:beads>
+ <js:VerticalLayout />
+ </js:beads>
+ <js:Label width="300" text="Enter Stock Symbol or choose from list:" />
+ <js:Container>
+ <js:beads>
+ <js:HorizontalLayout />
+ </js:beads>
+ <js:Container className="leftSide">
+ <js:beads>
+ <js:VerticalLayout />
+ </js:beads>
+ <js:TextInput id="symbolTI" text="{MyModel(applicationModel).stockSymbol}" />
+ <js:TextButton text="Get Quote" className="quoteButton"
+ click="_symbol = symbolTI.text; dispatchEvent(new CustomEvent('buttonClicked'))" />
+ <js:Label id="field" text="{fieldText}"/>
+ <js:Label className="output" height="24" text="{MyModel(applicationModel).responseText}" />
+ </js:Container>
+ <js:Container className="rightSide">
+ <js:beads>
+ <js:VerticalLayout />
+ </js:beads>
+ <js:DropDownList id="list" width="100"
+ change="_symbol = list.selectedItem as String; dispatchEvent(new CustomEvent('listChanged'))"
+ dataProvider="{MyModel(applicationModel).strings}" />
+ <js:RadioButton id="radio1" text="Price" value="Ask" groupName="group1" change="radioChanged(event)"/>
+ <js:RadioButton id="radio2" text="Change" value="Change" groupName="group1" change="radioChanged(event)"/>
+ <js:RadioButton id="radio3" text="Day's High" value="DaysHigh" groupName="group1" change="radioChanged(event)"/>
+ <js:RadioButton id="radio4" text="Day's Low" value="DaysLow" groupName="group1" change="radioChanged(event)"/>
+ <js:CheckBox id="showAllData" text="Show All Data" change="setState()" />
+ </js:Container>
+ </js:Container>
+ <js:Label id="bindtest" text="{fieldText + ' expression binding'}" />
+ <js:Label width="300" text.showAll="110" includeIn="showAll" />
+ <js:TextArea id="ta" width="300" height="100" height.showAll="110"
+ includeIn="showAll"
+ text="{MyModel(applicationModel).allData}" />
+ </js:Container>
+</js:ViewBase>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/README.txt
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/README.txt b/examples/DataBindingTest_Flat/src/README.txt
new file mode 100644
index 0000000..afe521b
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/README.txt
@@ -0,0 +1,52 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+DESCRIPTION
+
+The DataBindingTest example shows a Flex application that can communicate with
+a third-party data source (in this case, yahoo.finance) and display the values
+returned using data binding.
+
+This Flex application may be run as a Flash SWF or cross-compiled (using Falcon JX)
+into JavaScript and HTML and run without Flash.
+
+The DataBindingTest example also shows how the model-view-controller (MVC) pattern
+can be used to separate the parts of the application. This is facilitated by
+the use of FlexJS beads added to the main application that provide the
+data connection (via HTTPService) and interacting with the rest of the application
+via events.
+
+COMPONENTS and BEADS
+
+- Button
+- CheckBox
+- ComboBox
+- Container
+- Label
+- RadioButton
+- TextArea
+- TextInput
+
+- Data binding: the text properties of TextArea and Label are linked with results
+from the remote server calls.
+
+NOTES
+
+The cross-compilation to JavaScript often results in non-fatal warnings. Some of these warnings
+should be addressed in future releases of the Falcon JX compiler.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/StockDataJSONItemConverter.as
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/StockDataJSONItemConverter.as b/examples/DataBindingTest_Flat/src/StockDataJSONItemConverter.as
new file mode 100644
index 0000000..a39606b
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/StockDataJSONItemConverter.as
@@ -0,0 +1,40 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.collections.converters.JSONItemConverter;
+
+ public class StockDataJSONItemConverter extends JSONItemConverter
+ {
+ public function StockDataJSONItemConverter()
+ {
+ super();
+ }
+
+ override public function convertItem(data:String):Object
+ {
+ var obj:Object = super.convertItem(data);
+ if (obj["query"]["count"] == 0)
+ return "No Data";
+
+ obj = obj["query"]["results"]["quote"];
+ return obj;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/controllers/MyController.as
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/controllers/MyController.as b/examples/DataBindingTest_Flat/src/controllers/MyController.as
new file mode 100644
index 0000000..83c2cd5
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/controllers/MyController.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 controllers
+{
+ import org.apache.flex.events.Event;
+
+ import org.apache.flex.core.Application;
+ import org.apache.flex.core.IDocument;
+
+ import models.MyModel;
+
+ public class MyController implements IDocument
+ {
+ public function MyController(app:Application = null)
+ {
+ if (app)
+ {
+ this.app = app as DataBindingTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+ }
+
+ private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
+ private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
+ private var app:DataBindingTest;
+
+ private function viewChangeHandler(event:Event):void
+ {
+ app.initialView.addEventListener("buttonClicked", buttonClickHandler);
+ app.initialView.addEventListener("radioClicked", radioClickHandler);
+ app.initialView.addEventListener("listChanged", listChangedHandler);
+ }
+
+ private function buttonClickHandler(event:Event):void
+ {
+ var sym:String = MyInitialView(app.initialView).symbol;
+ app.service.url = queryBegin + sym + queryEnd;
+ app.service.send();
+ app.service.addEventListener("complete", completeHandler);
+ }
+
+ private function radioClickHandler(event:Event):void
+ {
+ var field:String = MyInitialView(app.initialView).requestedField;
+ MyModel(app.model).requestedField = field;
+ }
+
+ private function completeHandler(event:Event):void
+ {
+ MyModel(app.model).responseData = app.collection.getItemAt(0);
+ }
+
+ private function listChangedHandler(event:Event):void
+ {
+ MyModel(app.model).stockSymbol = MyInitialView(app.initialView).symbol;
+ }
+
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.app = document as DataBindingTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f6e65fdc/examples/DataBindingTest_Flat/src/models/MyModel.as
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest_Flat/src/models/MyModel.as b/examples/DataBindingTest_Flat/src/models/MyModel.as
new file mode 100644
index 0000000..7fc01ec
--- /dev/null
+++ b/examples/DataBindingTest_Flat/src/models/MyModel.as
@@ -0,0 +1,124 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 models
+{
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.EventDispatcher;
+
+ public class MyModel extends EventDispatcher
+ {
+ public function MyModel()
+ {
+ }
+
+ private var _requestedField:String = "Ask";
+
+ [Bindable("requestedFieldChanged")]
+ public function get requestedField():String
+ {
+ return _requestedField;
+ }
+
+ public function set requestedField(value:String):void
+ {
+ if (value != _requestedField)
+ {
+ _requestedField = value;
+ dispatchEvent(new Event("requestedFieldChanged"));
+ if (_responseData)
+ dispatchEvent(new Event("responseTextChanged"));
+ }
+ }
+
+ [Bindable("responseTextChanged")]
+ public function get responseText():String
+ {
+ if (_responseData == null)
+ return "";
+ if (_responseData == "No Data")
+ return _responseData as String;
+ var s:String = _responseData[_requestedField];
+ if (s == null)
+ {
+ if (_requestedField == "Ask")
+ s = _responseData["Bid"];
+ }
+ return s;
+ }
+
+ private var _responseData:Object;
+
+ [Bindable("responseDataChanged")]
+ public function get responseData():Object
+ {
+ return _responseData;
+ }
+
+ public function set responseData(value:Object):void
+ {
+ if (value != _responseData)
+ {
+ _responseData = value;
+ _allData = "";
+ dispatchEvent(new Event("responseDataChanged"));
+ dispatchEvent(new Event("responseTextChanged"));
+ }
+ }
+
+ private var _allData:String = "";
+
+ [Bindable("responseDataChanged")]
+ public function get allData():String
+ {
+ if (_allData == "" && _responseData != null)
+ {
+ for (var p:String in _responseData)
+ {
+ _allData += p + ": " + _responseData[p] + "\n";
+ }
+ }
+ return _allData;
+ }
+
+
+ private var _stockSymbol:String;
+
+ [Bindable("stockSymbolChanged")]
+ public function get stockSymbol():String
+ {
+ return _stockSymbol;
+ }
+
+ public function set stockSymbol(value:String):void
+ {
+ if (value != _stockSymbol)
+ {
+ _stockSymbol = value;
+ dispatchEvent(new Event("stockSymbolChanged"));
+ }
+ }
+
+ private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+ public function get strings():Array
+ {
+ return _strings;
+ }
+
+ }
+}
\ No newline at end of file
[07/36] git commit: [flex-asjs] [refs/heads/develop] - CSS Font
loading
Posted by ah...@apache.org.
CSS Font loading
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c28c2fe8
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c28c2fe8
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c28c2fe8
Branch: refs/heads/develop
Commit: c28c2fe8474c49d1a986cedd57a61ad1daa8891f
Parents: a348641
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:56:32 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:56:32 2015 -0700
----------------------------------------------------------------------
.../src/org/apache/flex/core/CSSFontFaceBead.as | 140 +++++++++++++++++++
frameworks/projects/Core/basic-manifest.xml | 1 +
.../src/org/apache/flex/core/CSSFontFaceBead.js | 54 +++++++
3 files changed, 195 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c28c2fe8/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
new file mode 100644
index 0000000..f17f33b
--- /dev/null
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
@@ -0,0 +1,140 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.Loader;
+ import flash.system.LoaderContext;
+ import flash.events.Event;
+ import flash.events.IOErrorEvent;
+ import flash.events.SecurityErrorEvent;
+ import flash.net.URLRequest;
+ 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.ValueEvent;
+
+ /**
+ * The CSSFontFaceBead class is the class that loads swfs
+ * of converted fonts so they can be used in Flash.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSFontFaceBead implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSFontFaceBead()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ /**
+ * @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(ValuesManager.valuesImpl).addEventListener("init", initHandler);
+ IEventDispatcher(_strand).addEventListener("preinitialize", preinitHandler);
+ var mainClassName:String = getQualifiedClassName(value);
+ var styleClassName:String = "_" + mainClassName + "_Styles";
+ var c:Class = ApplicationDomain.currentDomain.getDefinition(styleClassName) as Class;
+ requestFonts(c["fontFaces"]);
+ }
+
+ private var loaders:Array;
+
+ private function initHandler(event:ValueEvent):void
+ {
+ var fontFaces:Array = event.value as Array;
+ if (fontFaces)
+ requestFonts(fontFaces);
+ }
+
+ private function requestFonts(fontFaces:Array):void
+ {
+ if (!loaders)
+ loaders = [];
+
+ for each (var url:String in fontFaces)
+ {
+ // swap swf in suffix
+ var c:int = url.lastIndexOf(".");
+ url = url.substr(0, c) + ".swf";
+ var foo:Loader = new Loader();
+ var bar:URLRequest = new URLRequest(url);
+ var ctx:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
+ foo.load(bar, ctx);
+ foo.name = url;
+ foo.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, completeHandler);
+ foo.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
+ foo.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandler);
+ loaders.push(foo.contentLoaderInfo);
+ }
+ }
+
+ private function completeHandler(event:flash.events.Event):void
+ {
+ removeTarget(event.target);
+ }
+
+ private function errorHandler(event:flash.events.Event):void
+ {
+ trace("error loading font from: ", event.target.name);
+ removeTarget(event.target);
+ }
+
+ private function removeTarget(target:Object):void
+ {
+ var n:int = loaders.length;
+ for (var i:int = 0; i < n; i++)
+ {
+ if (loaders[i] === target)
+ {
+ loaders.splice(i, 1);
+ if (loaders.length == 0)
+ IEventDispatcher(_strand).removeEventListener("preinitialize", preinitHandler);
+ break;
+ }
+ }
+ }
+
+ private function preinitHandler(event:org.apache.flex.events.Event):void
+ {
+ event.preventDefault();
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c28c2fe8/frameworks/projects/Core/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/basic-manifest.xml b/frameworks/projects/Core/basic-manifest.xml
index ac43d5e..995157d 100644
--- a/frameworks/projects/Core/basic-manifest.xml
+++ b/frameworks/projects/Core/basic-manifest.xml
@@ -27,6 +27,7 @@
<component id="ViewBase" class="org.apache.flex.core.ViewBase"/>
<component id="MXMLDragInitiator" class="org.apache.flex.core.MXMLDragInitiator" />
<component id="CallLaterBead" class="org.apache.flex.core.CallLaterBead" />
+ <component id="CSSFontFaceBead" class="org.apache.flex.core.CSSFontFaceBead" />
<component id="BindableCSSStyles" class="org.apache.flex.core.BindableCSSStyles"/>
<component id="SimpleCSSStyles" class="org.apache.flex.core.SimpleCSSStyles"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c28c2fe8/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js b/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
new file mode 100644
index 0000000..8d72363
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
@@ -0,0 +1,54 @@
+/**
+ * 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.
+ */
+
+goog.provide('org_apache_flex_core_CSSFontFaceBead');
+
+
+
+/**
+ * @constructor
+ * This is just a stub.
+ */
+org_apache_flex_core_CSSFontFaceBead = function() {
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.strand_ = null;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_CSSFontFaceBead.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'CSSFontFaceBead.js',
+ qName: 'org_apache_flex_core_CSSFontFaceBead'}] };
+
+
+Object.defineProperties(org_apache_flex_core_CSSFontFaceBead.prototype, {
+ /** @export */
+ strand: {
+ /** @this {org_apache_flex_binding_GenericBinding} */
+ set: function(value) {
+ if (this.strand_ !== value) {
+ this.strand_ = value;
+ }
+ }
+ }
+});
[06/36] git commit: [flex-asjs] [refs/heads/develop] - dispatch an
event so fontloaders know when to act
Posted by ah...@apache.org.
dispatch an event so fontloaders know when to act
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/a3486416
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/a3486416
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/a3486416
Branch: refs/heads/develop
Commit: a3486416efebc0deee59c2ad4205f85d69b9e36e
Parents: c9c90ff
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:55:24 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:55:24 2015 -0700
----------------------------------------------------------------------
.../Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/a3486416/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
index 57d6726..176b112 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/SimpleCSSValuesImpl.as
@@ -25,6 +25,7 @@ package org.apache.flex.core
import org.apache.flex.events.EventDispatcher;
import org.apache.flex.events.ValueChangeEvent;
+ import org.apache.flex.events.ValueEvent;
import org.apache.flex.utils.CSSUtils;
/**
@@ -83,6 +84,9 @@ package org.apache.flex.core
}
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)
{
@@ -91,6 +95,8 @@ package org.apache.flex.core
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++;
}
}
[12/36] git commit: [flex-asjs] [refs/heads/develop] - convert _ to .
Posted by ah...@apache.org.
convert _ to .
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/336c6d0e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/336c6d0e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/336c6d0e
Branch: refs/heads/develop
Commit: 336c6d0e7307ea2c8c0381c90df636edbbc37f5a
Parents: 619796d
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 16 13:46:29 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 16 13:46:29 2015 -0700
----------------------------------------------------------------------
.../js/src/org/apache/flex/core/CSSFontFaceBead.js | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/336c6d0e/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js b/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
index 8d72363..c81dfbf 100644
--- a/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/CSSFontFaceBead.js
@@ -12,7 +12,7 @@
* limitations under the License.
*/
-goog.provide('org_apache_flex_core_CSSFontFaceBead');
+goog.provide('org.apache.flex.core.CSSFontFaceBead');
@@ -20,7 +20,7 @@ goog.provide('org_apache_flex_core_CSSFontFaceBead');
* @constructor
* This is just a stub.
*/
-org_apache_flex_core_CSSFontFaceBead = function() {
+org.apache.flex.core.CSSFontFaceBead = function() {
/**
* @private
@@ -36,15 +36,15 @@ org_apache_flex_core_CSSFontFaceBead = function() {
*
* @type {Object.<string, Array.<Object>>}
*/
-org_apache_flex_core_CSSFontFaceBead.prototype.FLEXJS_CLASS_INFO =
- { names: [{ name: 'CSSFontFaceBead.js',
- qName: 'org_apache_flex_core_CSSFontFaceBead'}] };
+org.apache.flex.core.CSSFontFaceBead.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'CSSFontFaceBead',
+ qName: 'org.apache.flex.core.CSSFontFaceBead'}] };
-Object.defineProperties(org_apache_flex_core_CSSFontFaceBead.prototype, {
+Object.defineProperties(org.apache.flex.core.CSSFontFaceBead.prototype, {
/** @export */
strand: {
- /** @this {org_apache_flex_binding_GenericBinding} */
+ /** @this {org.apache.flex.core.CSSFontFaceBead} */
set: function(value) {
if (this.strand_ !== value) {
this.strand_ = value;
[10/36] git commit: [flex-asjs] [refs/heads/develop] - Merge branch
'develop' into flatui
Posted by ah...@apache.org.
Merge branch 'develop' into flatui
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/334c1e92
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/334c1e92
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/334c1e92
Branch: refs/heads/develop
Commit: 334c1e92413b998ffa8a0b23a2df703484881dc9
Parents: bc31635 18b4a7a
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 16 09:41:46 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 16 09:41:46 2015 -0700
----------------------------------------------------------------------
examples/DataGridExample/src/MyInitialView.mxml | 18 +-
.../src/assets/smallbluerect.jpg | Bin 0 -> 13500 bytes
.../src/assets/smallgreenrect.jpg | Bin 0 -> 13542 bytes
.../src/assets/smallorangerect.gif | Bin 0 -> 821 bytes
.../src/assets/smallorangerect.jpg | Bin 0 -> 13571 bytes
.../src/assets/smallpurplerect.jpg | Bin 0 -> 13517 bytes
.../DataGridExample/src/assets/smallredrect.jpg | Bin 0 -> 13477 bytes
.../src/assets/smallyellowrect.jpg | Bin 0 -> 13598 bytes
.../DataGridExample/src/models/ProductsModel.as | 10 +-
.../src/mybeads/RowHeightBead.as | 153 -------
examples/DataGridExample/src/smallbluerect.jpg | Bin 13500 -> 0 bytes
examples/DataGridExample/src/smallgreenrect.jpg | Bin 13542 -> 0 bytes
.../DataGridExample/src/smallorangerect.gif | Bin 821 -> 0 bytes
.../DataGridExample/src/smallorangerect.jpg | Bin 13571 -> 0 bytes
.../DataGridExample/src/smallpurplerect.jpg | Bin 13517 -> 0 bytes
examples/DataGridExample/src/smallredrect.jpg | Bin 13477 -> 0 bytes
.../DataGridExample/src/smallyellowrect.jpg | Bin 13598 -> 0 bytes
.../projects/Binding/compile-asjs-config.xml | 10 +-
.../src/org/apache/flex/binding/BindingBase.js | 32 +-
.../src/org/apache/flex/binding/ChainBinding.js | 44 +-
.../org/apache/flex/binding/ConstantBinding.js | 24 +-
.../org/apache/flex/binding/GenericBinding.js | 38 +-
.../org/apache/flex/binding/PropertyWatcher.js | 36 +-
.../org/apache/flex/binding/SimpleBinding.js | 36 +-
.../apache/flex/binding/ViewBaseDataBinding.js | 46 +-
.../src/org/apache/flex/binding/WatcherBase.js | 46 +-
.../charts/supportClasses/ChartAxisGroup.as | 3 +-
.../org/apache/flex/charts/beads/ChartView.as | 37 +-
.../projects/Charts/compile-asjs-config.xml | 14 +-
.../org/apache/flex/charts/core/ChartBase.js | 40 +-
.../org/apache/flex/charts/core/IAxisBead.js | 18 +-
.../org/apache/flex/charts/core/IAxisGroup.js | 12 +-
.../flex/charts/core/ICartesianChartLayout.js | 10 +-
.../src/org/apache/flex/charts/core/IChart.js | 12 +-
.../org/apache/flex/charts/core/IChartAxis.js | 10 +-
.../apache/flex/charts/core/IChartDataGroup.js | 20 +-
.../flex/charts/core/IChartItemRenderer.js | 18 +-
.../org/apache/flex/charts/core/IChartSeries.js | 14 +-
.../flex/charts/core/IHorizontalAxisBead.js | 18 +-
.../flex/charts/core/IVerticalAxisBead.js | 18 +-
.../charts/supportClasses/ChartAxisGroup.js | 56 +--
.../charts/supportClasses/ChartDataGroup.js | 28 +-
.../Collections/compile-asjs-config.xml | 10 +-
.../apache/flex/collections/LazyCollection.js | 44 +-
.../collections/converters/JSONItemConverter.js | 10 +-
.../flex/collections/parsers/JSONInputParser.js | 10 +-
.../as/src/org/apache/flex/core/BeadViewBase.as | 5 +-
.../as/src/org/apache/flex/core/IViewport.as | 7 -
.../src/org/apache/flex/core/IViewportModel.as | 6 -
.../as/src/org/apache/flex/core/UIMetrics.as | 41 ++
.../as/src/org/apache/flex/utils/BeadMetrics.as | 67 +++
.../projects/Core/compile-asjs-config.xml | 14 +-
.../Core/js/src/flash/display/Sprite.js | 10 +-
.../js/src/org/apache/flex/core/Application.js | 70 +--
.../js/src/org/apache/flex/core/BeadViewBase.js | 33 +-
.../src/org/apache/flex/core/BrowserWindow.js | 12 +-
.../src/org/apache/flex/core/CallLaterBead.js | 16 +-
.../js/src/org/apache/flex/core/ClassFactory.js | 16 +-
.../src/org/apache/flex/core/ContainerBase.js | 64 +--
.../src/org/apache/flex/core/DataBindingBase.js | 8 +-
.../src/org/apache/flex/core/FilledRectangle.js | 30 +-
.../org/apache/flex/core/HTMLElementWrapper.js | 64 +--
.../Core/js/src/org/apache/flex/core/IBead.js | 12 +-
.../src/org/apache/flex/core/IBeadController.js | 14 +-
.../js/src/org/apache/flex/core/IBeadLayout.js | 14 +-
.../js/src/org/apache/flex/core/IBeadModel.js | 20 +-
.../js/src/org/apache/flex/core/IBeadView.js | 8 +-
.../Core/js/src/org/apache/flex/core/IChild.js | 12 +-
.../Core/js/src/org/apache/flex/core/IChrome.js | 6 +-
.../js/src/org/apache/flex/core/IContainer.js | 20 +-
.../js/src/org/apache/flex/core/IContentView.js | 16 +-
.../src/org/apache/flex/core/IDataGridModel.js | 41 --
.../core/IDataProviderItemRendererMapper.js | 18 +-
.../js/src/org/apache/flex/core/IDocument.js | 10 +-
.../js/src/org/apache/flex/core/IEffectTimer.js | 16 +-
.../js/src/org/apache/flex/core/IFactory.js | 10 +-
.../js/src/org/apache/flex/core/IFormatBead.js | 19 +-
.../src/org/apache/flex/core/IItemRenderer.js | 8 +-
.../flex/core/IItemRendererClassFactory.js | 8 +-
.../apache/flex/core/IItemRendererFactory.js | 10 +-
.../org/apache/flex/core/IItemRendererParent.js | 10 +-
.../js/src/org/apache/flex/core/ILayoutChild.js | 12 +-
.../src/org/apache/flex/core/ILayoutParent.js | 10 +-
.../apache/flex/core/IListPresentationModel.js | 20 +-
.../src/org/apache/flex/core/IMXMLDocument.js | 8 +-
.../org/apache/flex/core/IMeasurementBead.js | 8 +-
.../Core/js/src/org/apache/flex/core/IParent.js | 18 +-
.../src/org/apache/flex/core/IParentIUIBase.js | 18 +-
.../js/src/org/apache/flex/core/IPopUpHost.js | 16 +-
.../apache/flex/core/ISelectableItemRenderer.js | 20 +-
.../src/org/apache/flex/core/ISelectionModel.js | 21 +-
.../js/src/org/apache/flex/core/IStatesImpl.js | 20 +-
.../Core/js/src/org/apache/flex/core/IStrand.js | 22 +-
.../org/apache/flex/core/IStyleableObject.js | 16 +-
.../js/src/org/apache/flex/core/ITextModel.js | 20 +-
.../Core/js/src/org/apache/flex/core/IUIBase.js | 8 +-
.../js/src/org/apache/flex/core/IValuesImpl.js | 14 +-
.../js/src/org/apache/flex/core/IViewport.js | 53 +++
.../src/org/apache/flex/core/IViewportModel.js | 108 +++++
.../flex/core/ItemRendererClassFactory.js | 32 +-
.../js/src/org/apache/flex/core/ListBase.js | 38 +-
.../org/apache/flex/core/SimpleCSSValuesImpl.js | 44 +-
.../org/apache/flex/core/SimpleStatesImpl.js | 88 ++--
.../org/apache/flex/core/SimpleValuesImpl.js | 8 +-
.../Core/js/src/org/apache/flex/core/UIBase.js | 218 ++++-----
.../js/src/org/apache/flex/core/UIMetrics.js | 40 +-
.../src/org/apache/flex/core/ValuesManager.js | 24 +-
.../js/src/org/apache/flex/core/ViewBase.js | 88 ++--
.../src/org/apache/flex/events/BrowserEvent.js | 42 +-
.../src/org/apache/flex/events/CustomEvent.js | 16 +-
.../src/org/apache/flex/events/ElementEvents.js | 10 +-
.../Core/js/src/org/apache/flex/events/Event.js | 18 +-
.../org/apache/flex/events/EventDispatcher.js | 24 +-
.../org/apache/flex/events/IEventDispatcher.js | 8 +-
.../js/src/org/apache/flex/events/MouseEvent.js | 60 +--
.../org/apache/flex/events/ValueChangeEvent.js | 32 +-
.../js/src/org/apache/flex/events/ValueEvent.js | 18 +-
.../org/apache/flex/events/utils/MouseUtils.js | 12 +-
.../Core/js/src/org/apache/flex/geom/Point.js | 12 +-
.../js/src/org/apache/flex/geom/Rectangle.js | 16 +-
.../js/src/org/apache/flex/states/AddItems.js | 70 +--
.../org/apache/flex/states/SetEventHandler.js | 46 +-
.../src/org/apache/flex/states/SetProperty.js | 52 +--
.../Core/js/src/org/apache/flex/states/State.js | 24 +-
.../js/src/org/apache/flex/svg/TextButton.js | 28 +-
.../js/src/org/apache/flex/utils/BeadMetrics.js | 25 +-
.../js/src/org/apache/flex/utils/BinaryData.js | 38 +-
.../js/src/org/apache/flex/utils/EffectTimer.js | 36 +-
.../js/src/org/apache/flex/utils/Language.js | 32 +-
.../apache/flex/utils/MXMLDataInterpreter.js | 42 +-
.../src/org/apache/flex/utils/MixinManager.js | 16 +-
.../js/src/org/apache/flex/utils/PointUtils.js | 26 +-
.../Core/js/src/org/apache/flex/utils/Timer.js | 42 +-
.../js/src/org/apache/flex/utils/UIUtils.js | 20 +-
.../flex/utils/ViewSourceContextMenuOption.js | 16 +-
.../src/org/apache/flex/createjs/Application.js | 38 +-
.../js/src/org/apache/flex/createjs/CheckBox.js | 34 +-
.../js/src/org/apache/flex/createjs/Label.js | 24 +-
.../src/org/apache/flex/createjs/TextButton.js | 26 +-
.../src/org/apache/flex/createjs/core/UIBase.js | 40 +-
.../org/apache/flex/createjs/core/ViewBase.js | 32 +-
.../projects/DragDrop/compile-asjs-config.xml | 8 +-
.../js/src/org/apache/flex/events/DragEvent.js | 42 +-
.../projects/Effects/compile-asjs-config.xml | 10 +-
.../org/apache/flex/effects/PlatformWiper.js | 16 +-
.../projects/Formatters/compile-asjs-config.xml | 12 +-
.../js/src/org/apache/flex/core/FormatBase.js | 48 +-
.../src/org/apache/flex/maps/google/Geometry.js | 14 +-
.../src/org/apache/flex/maps/google/LatLng.js | 12 +-
.../js/src/org/apache/flex/maps/google/Map.js | 86 ++--
.../src/org/apache/flex/maps/google/Marker.js | 18 +-
.../js/src/org/apache/flex/maps/google/Place.js | 26 +-
.../apache/flex/maps/google/beads/MapView.js | 14 +-
.../apache/flex/maps/google/models/MapModel.js | 28 +-
.../src/org/apache/flex/core/graphics/Circle.js | 28 +-
.../org/apache/flex/core/graphics/Ellipse.js | 22 +-
.../apache/flex/core/graphics/GradientBase.js | 44 +-
.../apache/flex/core/graphics/GradientEntry.js | 38 +-
.../apache/flex/core/graphics/GraphicShape.js | 46 +-
.../flex/core/graphics/GraphicsContainer.js | 60 +--
.../src/org/apache/flex/core/graphics/IFill.js | 12 +-
.../org/apache/flex/core/graphics/IStroke.js | 12 +-
.../src/org/apache/flex/core/graphics/Line.js | 22 +-
.../apache/flex/core/graphics/LinearGradient.js | 34 +-
.../src/org/apache/flex/core/graphics/Path.js | 28 +-
.../src/org/apache/flex/core/graphics/Rect.js | 22 +-
.../org/apache/flex/core/graphics/SolidColor.js | 28 +-
.../flex/core/graphics/SolidColorStroke.js | 30 +-
.../src/org/apache/flex/core/graphics/Text.js | 22 +-
frameworks/projects/HTML/as/defaults.css | 2 +
.../HTML/as/src/org/apache/flex/html/List.as | 3 +-
.../src/org/apache/flex/html/beads/AlertView.as | 20 +-
.../org/apache/flex/html/beads/ButtonBarView.as | 15 +
.../org/apache/flex/html/beads/ContainerView.as | 448 ++++++-------------
.../src/org/apache/flex/html/beads/ListView.as | 38 +-
.../src/org/apache/flex/html/beads/PanelView.as | 91 +---
.../flex/html/beads/PanelWithControlBarView.as | 99 ++--
.../flex/html/beads/layouts/ButtonBarLayout.as | 29 +-
.../flex/html/beads/layouts/HorizontalLayout.as | 34 +-
.../flex/html/beads/layouts/TileLayout.as | 57 ++-
.../flex/html/beads/layouts/VerticalLayout.as | 2 +-
.../flex/html/beads/models/ViewportModel.as | 13 -
.../html/supportClasses/ScrollingViewport.as | 39 +-
.../apache/flex/html/supportClasses/Viewport.as | 19 +-
.../org/apache/flex/html/beads/DataGridView.as | 1 +
.../flex/html/beads/layouts/DataGridLayout.as | 1 +
.../projects/HTML/compile-asjs-config.xml | 14 +-
.../HTML/js/src/org/apache/flex/html/Alert.js | 80 ++--
.../HTML/js/src/org/apache/flex/html/Button.js | 24 +-
.../js/src/org/apache/flex/html/ButtonBar.js | 42 +-
.../js/src/org/apache/flex/html/CheckBox.js | 30 +-
.../js/src/org/apache/flex/html/CloseButton.js | 22 +-
.../js/src/org/apache/flex/html/ComboBox.js | 32 +-
.../js/src/org/apache/flex/html/Container.js | 36 +-
.../js/src/org/apache/flex/html/ControlBar.js | 20 +-
.../js/src/org/apache/flex/html/DropDownList.js | 38 +-
.../js/src/org/apache/flex/html/HContainer.js | 24 +-
.../HTML/js/src/org/apache/flex/html/HRule.js | 18 +-
.../HTML/js/src/org/apache/flex/html/Image.js | 34 +-
.../org/apache/flex/html/ImageAndTextButton.js | 36 +-
.../HTML/js/src/org/apache/flex/html/Label.js | 28 +-
.../HTML/js/src/org/apache/flex/html/List.js | 84 ++--
.../src/org/apache/flex/html/MultilineLabel.js | 28 +-
.../src/org/apache/flex/html/NumericStepper.js | 58 +--
.../HTML/js/src/org/apache/flex/html/Panel.js | 56 +--
.../js/src/org/apache/flex/html/RadioButton.js | 54 +--
.../js/src/org/apache/flex/html/SimpleAlert.js | 20 +-
.../js/src/org/apache/flex/html/SimpleList.js | 38 +-
.../HTML/js/src/org/apache/flex/html/Slider.js | 62 +--
.../HTML/js/src/org/apache/flex/html/Spacer.js | 18 +-
.../HTML/js/src/org/apache/flex/html/Spinner.js | 54 +--
.../js/src/org/apache/flex/html/TextArea.js | 26 +-
.../js/src/org/apache/flex/html/TextButton.js | 24 +-
.../js/src/org/apache/flex/html/TextInput.js | 38 +-
.../js/src/org/apache/flex/html/TitleBar.js | 36 +-
.../org/apache/flex/html/ToggleTextButton.js | 30 +-
.../HTML/js/src/org/apache/flex/html/ToolTip.js | 18 +-
.../js/src/org/apache/flex/html/VContainer.js | 24 +-
.../accessories/NumericOnlyTextInputBead.js | 14 +-
.../flex/html/accessories/PasswordInputBead.js | 12 +-
.../flex/html/accessories/TextPromptBead.js | 16 +-
.../org/apache/flex/html/beads/ButtonBarView.js | 28 +-
.../org/apache/flex/html/beads/ContainerView.js | 50 +--
.../DataItemRendererFactoryForArrayData.js | 54 +--
.../src/org/apache/flex/html/beads/IListView.js | 12 +-
.../apache/flex/html/beads/ImageButtonView.js | 12 +-
.../src/org/apache/flex/html/beads/ImageView.js | 18 +-
.../src/org/apache/flex/html/beads/ListView.js | 64 +--
.../src/org/apache/flex/html/beads/PanelView.js | 36 +-
.../flex/html/beads/ScrollingContainerView.js | 32 +-
.../apache/flex/html/beads/SliderThumbView.js | 12 +-
.../apache/flex/html/beads/SliderTrackView.js | 12 +-
.../flex/html/beads/TextInputWithBorderView.js | 12 +-
.../TextItemRendererFactoryForArrayData.js | 46 +-
.../controllers/ItemRendererMouseController.js | 26 +-
.../ListSingleSelectionMouseController.js | 30 +-
.../beads/controllers/SliderMouseController.js | 36 +-
.../beads/controllers/SpinnerMouseController.js | 18 +-
.../flex/html/beads/layouts/BasicLayout.js | 36 +-
.../html/beads/layouts/BasicScrollingLayout.js | 30 +-
.../flex/html/beads/layouts/ButtonBarLayout.js | 30 +-
.../flex/html/beads/layouts/HorizontalLayout.js | 20 +-
.../flex/html/beads/layouts/TileLayout.js | 32 +-
.../flex/html/beads/layouts/VerticalLayout.js | 20 +-
.../beads/layouts/VerticalScrollingLayout.js | 20 +-
.../html/beads/models/ArraySelectionModel.js | 44 +-
.../flex/html/beads/models/DataGridModel.js | 72 ---
.../apache/flex/html/beads/models/ImageModel.js | 30 +-
.../html/beads/models/ListPresentationModel.js | 34 +-
.../apache/flex/html/beads/models/PanelModel.js | 38 +-
.../apache/flex/html/beads/models/RangeModel.js | 48 +-
.../apache/flex/html/beads/models/TextModel.js | 32 +-
.../flex/html/beads/models/TitleBarModel.js | 40 +-
.../ButtonBarButtonItemRenderer.js | 38 +-
.../flex/html/supportClasses/DataGridColumn.js | 24 +-
.../flex/html/supportClasses/DataGroup.js | 44 +-
.../html/supportClasses/DataItemRenderer.js | 46 +-
.../html/supportClasses/ScrollingViewport.js | 24 +-
.../html/supportClasses/StringItemRenderer.js | 60 +--
.../html/supportClasses/UIItemRendererBase.js | 76 ++--
.../apache/flex/html/supportClasses/Viewport.js | 24 +-
.../js/src/org/apache/flex/html5/CheckBox.js | 26 +-
.../js/src/org/apache/flex/html5/ComboBox.js | 30 +-
.../src/org/apache/flex/html5/DropDownList.js | 14 +-
.../HTML5/js/src/org/apache/flex/html5/Label.js | 24 +-
.../HTML5/js/src/org/apache/flex/html5/List.js | 18 +-
.../js/src/org/apache/flex/html5/RadioButton.js | 30 +-
.../js/src/org/apache/flex/html5/TextArea.js | 22 +-
.../js/src/org/apache/flex/html5/TextButton.js | 22 +-
.../js/src/org/apache/flex/html5/TextInput.js | 22 +-
.../src/org/apache/flex/jquery/Application.js | 14 +-
.../js/src/org/apache/flex/jquery/CheckBox.js | 30 +-
.../src/org/apache/flex/jquery/RadioButton.js | 62 +--
.../js/src/org/apache/flex/jquery/TextButton.js | 26 +-
.../org/apache/flex/jquery/ToggleTextButton.js | 46 +-
.../JQuery/js/tests/MySimpleValuesImpl.js | 6 +-
.../projects/Mobile/compile-asjs-config.xml | 12 +-
.../js/src/org/apache/cordova/Application.js | 22 +-
.../Mobile/js/src/org/apache/cordova/Weinre.js | 16 +-
.../js/src/org/apache/cordova/camera/Camera.js | 44 +-
.../src/org/apache/flex/mobile/ManagerBase.js | 54 +--
.../src/org/apache/flex/net/BinaryUploader.js | 88 ++--
.../js/src/org/apache/flex/net/HTTPHeader.js | 14 +-
.../js/src/org/apache/flex/net/HTTPService.js | 100 ++---
284 files changed, 4228 insertions(+), 4352 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/334c1e92/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
[26/36] git commit: [flex-asjs] [refs/heads/develop] - start moving
the FlatUI code to its own swc and revert the HTML library back to its basic
state
Posted by ah...@apache.org.
start moving the FlatUI code to its own swc and revert the HTML library back to its basic state
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5c6408ce
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5c6408ce
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5c6408ce
Branch: refs/heads/develop
Commit: 5c6408ce2d9b71b0f5122dff0848b6169e9a3fbc
Parents: 56a9621
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 10:58:43 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 10:58:43 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/src/MyInitialView.mxml | 3 +-
frameworks/air-config-template.xml | 6 +
frameworks/air-config.xml | 6 +
frameworks/build.xml | 8 +
frameworks/flex-config-template.xml | 6 +
frameworks/flex-config.xml | 6 +
frameworks/projects/Flat/as/defaults.css | 814 +++++++++++++++++++
frameworks/projects/Flat/as/src/FlatClasses.as | 37 +
.../as/src/org/apache/flex/flat/CheckBox.as | 47 ++
.../as/src/org/apache/flex/flat/DropDownList.as | 46 ++
.../as/src/org/apache/flex/flat/RadioButton.as | 47 ++
.../beads/CSSContentAndTextToggleButtonView.as | 304 +++++++
.../flex/flat/beads/CSSScrollBarButtonView.as | 178 ++++
.../apache/flex/flat/beads/CSSScrollBarView.as | 241 ++++++
...CheckboxCSSContentAndTextToggleButtonView.as | 48 ++
.../apache/flex/flat/beads/DropDownListView.as | 287 +++++++
.../RadioCSSContentAndTextToggleButtonView.as | 47 ++
.../flat/supportClasses/DropDownListList.as | 76 ++
.../DropDownListStringItemRenderer.as | 71 ++
frameworks/projects/Flat/build.xml | 161 ++++
frameworks/projects/Flat/compile-config.xml | 91 +++
frameworks/projects/Flat/flat-manifest.xml | 105 +++
.../js/src/org/apache/flex/flat/CheckBox.js | 137 ++++
.../js/src/org/apache/flex/flat/DropDownList.js | 219 +++++
.../js/src/org/apache/flex/flat/RadioButton.js | 227 ++++++
frameworks/projects/HTML/as/defaults.css | 8 +-
frameworks/projects/HTML/as/src/HTMLClasses.as | 3 -
.../beads/CSSContentAndTextToggleButtonView.as | 304 -------
.../flex/html/beads/CSSScrollBarButtonView.as | 182 -----
.../apache/flex/html/beads/CSSScrollBarView.as | 240 ------
...CheckboxCSSContentAndTextToggleButtonView.as | 48 --
.../RadioCSSContentAndTextToggleButtonView.as | 47 --
.../DropDownListStringItemRenderer.as | 70 --
frameworks/projects/HTML/basic-manifest.xml | 2 -
34 files changed, 3220 insertions(+), 902 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/examples/DataBindingTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/MyInitialView.mxml b/examples/DataBindingTest/src/MyInitialView.mxml
index 59bfd77..a7d92f1 100644
--- a/examples/DataBindingTest/src/MyInitialView.mxml
+++ b/examples/DataBindingTest/src/MyInitialView.mxml
@@ -18,8 +18,7 @@ limitations under the License.
-->
<js:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:js="library://ns.apache.org/flexjs/basic"
- xmlns:core="library://ns.apache.org/flexjs/core"
+ xmlns:js="library://ns.apache.org/flexjs/flat"
initComplete="initControls()">
<fx:Script>
<![CDATA[
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/air-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/air-config-template.xml b/frameworks/air-config-template.xml
index e6c68d2..6edcb05 100644
--- a/frameworks/air-config-template.xml
+++ b/frameworks/air-config-template.xml
@@ -115,6 +115,12 @@
<manifest>projects/HTML5/html5-manifest.xml</manifest>
</namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+
+ <manifest>projects/Flat/flat-manifest.xml</manifest>
+
+ </namespace>
</namespaces>
<!-- Enable post-link SWF optimization. -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/air-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/air-config.xml b/frameworks/air-config.xml
index 8f82882..5d9c109 100644
--- a/frameworks/air-config.xml
+++ b/frameworks/air-config.xml
@@ -115,6 +115,12 @@
<manifest>projects/HTML5/html5-manifest.xml</manifest>
</namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+
+ <manifest>projects/Flat/flat-manifest.xml</manifest>
+
+ </namespace>
</namespaces>
<!-- Enable post-link SWF optimization. -->
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index 0dafc4e..8a6f621 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -80,6 +80,7 @@
<antcall target="Graphics"/>
<antcall target="Binding"/>
<antcall target="HTML"/>
+ <antcall target="Flat"/>
<antcall target="Charts"/>
<antcall target="Collections"/>
<antcall target="CreateJS"/>
@@ -119,6 +120,7 @@
<ant dir="${basedir}/projects/CreateJS" target="lint-js"/>
<ant dir="${basedir}/projects/DragDrop" target="lint-js"/>
<ant dir="${basedir}/projects/Effects" target="lint-js"/>
+ <ant dir="${basedir}/projects/Flat" target="lint-js"/>
<ant dir="${basedir}/projects/Formatters" target="lint-js"/>
<ant dir="${basedir}/projects/GoogleMaps" target="lint-js"/>
<ant dir="${basedir}/projects/Graphics" target="lint-js"/>
@@ -135,6 +137,7 @@
<ant dir="${basedir}/projects/Graphics" target="compile"/>
<ant dir="${basedir}/projects/Binding" target="compile"/>
<ant dir="${basedir}/projects/HTML" target="compile"/>
+ <ant dir="${basedir}/projects/Flat" target="compile"/>
<ant dir="${basedir}/projects/Charts" target="compile"/>
<ant dir="${basedir}/projects/Collections" target="compile"/>
<ant dir="${basedir}/projects/CreateJS" target="compile"/>
@@ -181,6 +184,7 @@
<ant dir="${basedir}/projects/CreateJS" target="clean"/>
<ant dir="${basedir}/projects/DragDrop" target="clean"/>
<ant dir="${basedir}/projects/Effects" target="clean"/>
+ <ant dir="${basedir}/projects/Flat" target="clean"/>
<ant dir="${basedir}/projects/Formatters" target="clean"/>
<ant dir="${basedir}/projects/GoogleMaps" target="clean"/>
<ant dir="${basedir}/projects/Graphics" target="clean"/>
@@ -237,6 +241,10 @@
<ant dir="${basedir}/projects/Effects"/>
</target>
+ <target name="Flat" description="Clean build of Flat.swc">
+ <ant dir="${basedir}/projects/Flat"/>
+ </target>
+
<target name="Formatters" description="Clean build of Formatters.swc">
<ant dir="${basedir}/projects/Formatters"/>
</target>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/flex-config-template.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config-template.xml b/frameworks/flex-config-template.xml
index 4aaaed5..7569957 100644
--- a/frameworks/flex-config-template.xml
+++ b/frameworks/flex-config-template.xml
@@ -122,6 +122,12 @@
<uri>library://ns.apache.org/flexjs/svg</uri>
<manifest>projects/HTML/svg-manifest.xml</manifest>
</namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+
+ <manifest>projects/Flat/flat-manifest.xml</manifest>
+
+ </namespace>
</namespaces>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/flex-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/flex-config.xml b/frameworks/flex-config.xml
index 27828d2..94c7e66 100644
--- a/frameworks/flex-config.xml
+++ b/frameworks/flex-config.xml
@@ -122,6 +122,12 @@
<uri>library://ns.apache.org/flexjs/svg</uri>
<manifest>projects/HTML/svg-manifest.xml</manifest>
</namespace>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+
+ <manifest>projects/Flat/flat-manifest.xml</manifest>
+
+ </namespace>
</namespaces>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/defaults.css b/frameworks/projects/Flat/as/defaults.css
new file mode 100644
index 0000000..790eb0c
--- /dev/null
+++ b/frameworks/projects/Flat/as/defaults.css
@@ -0,0 +1,814 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+@namespace "library://ns.apache.org/flexjs/flat";
+
+@font-face {
+ font-family: 'Flat-UI-Icons';
+
+ src: url('fonts/flat-ui-icons-regular.eot');
+ src: url('fonts/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('fonts/flat-ui-icons-regular.woff') format('woff'), url('fonts/flat-ui-icons-regular.ttf') format('truetype'), url('fonts/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
+}
+
+/* Global style declaration */
+*
+{
+ font-family: "Arial";
+ font-size: 12px;
+ color: #34495e;
+ background-color: #fff;
+}
+
+.flexjs *, . flexjs *:before, . flexjs *:after {
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+Button
+{
+ color: #fff;
+ background-color: #1abc9c;
+ padding: 10px 15px;
+ font-size: 15px;
+ font-weight: normal;
+ line-height: 1.4;
+ border: none;
+ border-radius: 4px;
+ -webkit-transition: border .25s linear, color .25s linear, background-color .25s linear;
+ transition: border .25s linear, color .25s linear, background-color .25s linear;
+
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+
+Button:hover
+{
+ color: #fff;
+ background-color: #48c9b0;
+ border-color: #48c9b0;
+}
+
+Button:active
+{
+ outline: none;
+ box-shadow: none;
+}
+
+ButtonBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ButtonBarView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.ButtonBarLayout");
+ IDataGroup: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer");
+
+ border-style: none;
+}
+
+ButtonBarButtonItemRenderer
+{
+ width: 80;
+ height: 30;
+}
+
+.checkbox-icon,
+.checkbox-icon-hover,
+.checkbox-icon-checked
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 20px;
+ height: 20px;
+ font-size: 20px;
+ line-height: 20px;
+ color: #bdc3c7;
+ text-align: center;
+ cursor: pointer;
+
+ /* .radio .icon-checked:before */
+ /* .radio .icon-unchecked:before */
+ font-family: 'Flat-UI-Icons';
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ font-size: 20px;
+ line-height: 20px;
+}
+
+.checkbox-icon:before
+{
+ content: "\e60d";
+}
+
+.checkbox-icon-hover:before
+{
+ content: "\e60e";
+}
+
+.checkbox-icon-checked:before
+{
+ content: "\e60e";
+}
+
+.checkbox-icon-checked
+{
+ color: #1abc9c;
+}
+
+.checkbox-input
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ margin: 0;
+ outline: none !important;
+ opacity: 0;
+}
+
+CheckBox
+{
+ /* .checkbox */
+ position: relative;
+ padding-left: 32px;
+ margin-bottom: 12px;
+ font-size: 14px;
+ line-height: 1.5;
+ -webkit-transition: color .25s linear;
+ transition: color .25s linear;
+}
+
+Container
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
+}
+
+ControlBar
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+
+ background-color: #CECECE;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+/* ASJS */
+DataGrid
+{
+ IDataGridPresentationModel: ClassReference("org.apache.flex.html.beads.models.DataGridPresentationModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.DataGridView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DataGridModel");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.DataGridLayout");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #222222;
+ border-width: 1px;
+}
+
+DateChooser {
+ IBeadView: ClassReference("org.apache.flex.html.beads.DateChooserView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateChooserMouseController");
+ width: 280px;
+ height: 240px;
+}
+
+DateField {
+ IBeadView: ClassReference("org.apache.flex.html.beads.DateFieldView");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.DateChooserModel");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DateFieldMouseController");
+ IFormatBead: ClassReference("org.apache.flex.html.accessories.DateFormatMMDDYYYYBead");
+}
+
+.dropdown-menu {
+ position: absolute;
+ z-index: 1000;
+ min-width: 220px;
+ padding: 0;
+ margin-top: 9px;
+ font-size: 14px;
+ background-color: #f3f4f5;
+ border: none;
+ border-radius: 4px;
+ box-shadow: none;
+ list-style: none;
+ }
+.dropdown-menu-divider {
+ height: 2px;
+ margin: 3px 0;
+ overflow: hidden;
+ background-color: rgba(202, 206, 209, .5);
+ }
+.dropdown-menu-item-renderer {
+ padding: 8px 16px;
+ line-height: 1.429;
+ font-size: inherit;
+ color: #606d7a;
+ background-color: transparent;
+}
+.dropdown-menu-item-renderer-selected {
+ padding: 8px 16px;
+ line-height: 1.875;
+ font-size: inherit;
+ color: #fff;
+ background-color: #1abc9c;
+}
+.dropdown-menu-item-renderer:hover {
+ font-size: inherit;
+ color: #55606c;
+ background-color: rgba(202, 206, 209, .5);
+}
+
+.dropdown-toggle-open-btn {
+ border-radius: 4px;
+ color: #fff;
+ background-color: #1abc9c;
+ border-color: #1abc9c;
+ }
+
+.dropdown-toggle-open-btn:hover {
+ border-radius: 4px;
+ color: #fff;
+ background-color: #48c9b0;
+ border-color: #48c9b0;
+ }
+
+.dropdown-caret {
+ display: inline-block;
+ color: inherit;
+ background-color: inherit;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-top: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+
+HContainer
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.HorizontalLayout");
+}
+
+ImageButton
+{
+ border-style: none;
+}
+
+VContainer
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+}
+
+List
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+ IDataGroup: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
+ border-style: solid;
+ border-color: #222222;
+}
+
+Panel
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.PanelView");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ padding: 2px;
+}
+
+PanelWithControlBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.PanelModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.PanelWithControlBarView");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ padding: 2px;
+}
+
+.radio-icon,
+.radio-icon-hover,
+.radio-icon-checked
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 20px;
+ height: 20px;
+ font-size: 20px;
+ line-height: 20px;
+ color: #bdc3c7;
+ text-align: center;
+ cursor: pointer;
+
+ /* .radio .icon-checked:before */
+ /* .radio .icon-unchecked:before */
+ font-family: 'Flat-UI-Icons';
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ font-size: 20px;
+ line-height: 20px;
+}
+
+.radio-icon:before
+{
+ content: "\e60b";
+}
+
+.radio-icon-hover:before
+{
+ content: "\e60c";
+}
+
+.radio-icon-checked:before
+{
+ content: "\e60c";
+}
+
+.radio-icon-checked
+{
+ color: #1abc9c;
+}
+
+.radio-input
+{
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 20px;
+ height: 20px;
+ padding: 0;
+ margin: 0;
+ outline: none !important;
+ opacity: 0;
+}
+
+RadioButton
+{
+ /* .radio */
+ position: relative;
+ padding-left: 32px;
+ margin-bottom: 12px;
+ font-size: 14px;
+ line-height: 1.5;
+ -webkit-transition: color .25s linear;
+ transition: color .25s linear;
+}
+
+SimpleList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VerticalLayout");
+ IDataGroup: ClassReference("org.apache.flex.html.supportClasses.DataGroup");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+ IViewport: ClassReference("org.apache.flex.html.supportClasses.ScrollingViewport");
+}
+
+StringItemRenderer
+{
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
+ height: 16;
+}
+
+TextArea
+{
+ padding: 6px 10px;
+ font-size: 13px;
+ border-radius: 6px;
+ border: 2px solid #1abc9c;
+}
+
+TextInput
+{
+ height: 35px;
+ padding: 6px 10px;
+ font-size: 13px;
+ line-height: 1.462;
+ border-radius: 6px;
+ border: 2px solid #1abc9c;
+}
+
+TitleBar
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TitleBarModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TitleBarView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TitleBarMeasurementBead");
+ background-color: #E2E2E2;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+ToolTip
+{
+ background-color: #FFFFCC;
+}
+
+ViewBase
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.BasicLayout");
+}
+
+
+/* Global Style Declaration */
+global
+{
+ IStatesImpl: ClassReference("org.apache.flex.core.SimpleStatesImpl");
+ IEffectTimer: ClassReference("org.apache.flex.utils.EffectTimer");
+ effectTimerInterval: 10;
+}
+
+@media -flex-flash
+{
+
+Alert
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.AlertView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+Border
+{
+ border-radius: inherit;
+ border: inherit;
+}
+
+Button
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSButtonView");
+}
+
+CheckBox
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.flat.beads.CheckboxCSSContentAndTextToggleButtonView");
+}
+
+CloseButton
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.CloseButtonView");
+}
+
+ComboBox
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ComboBoxModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ComboBoxView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ComboBoxController");
+ IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
+}
+
+Container
+{
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+ControlBar
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.ControlBarMeasurementBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+DropDownList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.DropDownListView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DropDownListController");
+ IPopUp: ClassReference("org.apache.flex.html.supportClasses.DropDownListList");
+}
+
+DropDownListList
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
+ IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
+ IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.DropDownListStringItemRenderer");
+}
+
+Image
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ImageView");
+}
+
+ImageButton
+{
+ IBeadView: ClassReference("org.apache.flex.html.beads.ImageButtonView");
+}
+
+ImageAndTextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ImageAndTextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ImageAndTextButtonView");
+}
+
+Label
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextFieldView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextFieldLabelMeasurementBead");
+}
+
+List
+{
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+}
+
+MultilineLabel
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.MultilineTextFieldView");
+}
+
+NumericStepper
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.NumericStepperView");
+
+ padding: 0px;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+ background-color: #FFFFFF;
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
+}
+
+Panel
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+PanelWithControlBar
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+RadioButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.flat.beads.RadioCSSContentAndTextToggleButtonView");
+}
+
+.vscrollbar-uparrow {
+ padding: 0px;
+ display: inline-block;
+ border-color: #16a085;
+ border-radius: initial;
+ background-color: transparent;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-bottom: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+.vscrollbar-downarrow-btn {
+ padding: 2px;
+ display: inline-block;
+ border-style: none;
+ border-radius: initial;
+ background-color: transparent;
+ width: 12;
+ height: 12;
+ margin-left: 5px;
+ vertical-align: middle;
+ }
+.vscrollbar-uparrow-btn {
+ padding: 2px;
+ display: inline-block;
+ border-style: none;
+ border-radius: initial;
+ background-color: transparent;
+ width: 12;
+ height: 12;
+ margin-left: 5px;
+ vertical-align: middle;
+ }
+.vscrollbar-downarrow {
+ padding: 0px;
+ display: inline-block;
+ border-color: #16a085;
+ border-radius: initial;
+ background-color: transparent;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-top: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+.vscrollbar-track {
+ padding: 0px;
+ position: relative;
+ width: 8px;
+ height: 8px;
+ /*margin-bottom: 20px;*/
+ cursor: pointer;
+ background-color: #ebedef;
+ border-radius: 4px;
+ /*border-radius: 32px;*/
+ box-shadow: none;
+ }
+.vscrollbar-thumb {
+ padding: 0px;
+ position: absolute;
+ z-index: 2;
+ width: 12px;
+ height: 12px;
+ cursor: pointer;
+ background-color: #16a085;
+ border-radius: 6px;
+ -webkit-transition: background .25s;
+ transition: background .25s;
+ }
+.vscrollbar-thumb:hover {
+ background-color: #48c9b0;
+ outline: none;
+ }
+.vscrollbar-thumb:active {
+ background-color: #16a085;
+ }
+
+ScrollBar
+{
+ IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
+ IBeadView: ClassReference("org.apache.flex.flat.beads.CSSScrollBarView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
+}
+
+SimpleAlert
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.AlertModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.SimpleAlertView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.AlertController");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+
+ background-color: #FFFFFF;
+ border-style: solid;
+ border-color: #000000;
+ border-width: 1px;
+}
+
+Slider
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+ iBeadView: ClassReference("org.apache.flex.html.beads.SliderView");
+ iBeadController: ClassReference("org.apache.flex.html.beads.controllers.SliderMouseController");
+ iThumbView: ClassReference("org.apache.flex.html.beads.SliderThumbView");
+ iTrackView: ClassReference("org.apache.flex.html.beads.SliderTrackView");
+}
+
+Spinner
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.RangeModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.SpinnerView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.SpinnerMouseController");
+}
+
+TextArea
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextAreaView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+ width: 135;
+ height: 20;
+}
+
+TextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
+ iMeasurementBead: ClassReference("org.apache.flex.html.beads.TextButtonMeasurementBead");
+}
+
+TextFieldItemRenderer
+{
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.ItemRendererMouseController");
+ height: 16;
+}
+
+TextInput
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.TextModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.TextInputWithBorderView");
+ IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
+ iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
+ iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
+ width: 135;
+ height: 20;
+}
+
+TitleBar
+{
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+}
+
+ToggleTextButton
+{
+ IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSTextButtonView");
+}
+
+ViewBase
+{
+ iBackgroundBead: ClassReference("org.apache.flex.html.beads.SolidBackgroundBead");
+ iBorderBead: ClassReference("org.apache.flex.html.beads.SingleLineBorderBead");
+}
+
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/FlatClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/FlatClasses.as b/frameworks/projects/Flat/as/src/FlatClasses.as
new file mode 100644
index 0000000..161c114
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/FlatClasses.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+
+/**
+ * @private
+ * This class is used to link additional classes into rpc.swc
+ * beyond those that are found by dependecy analysis starting
+ * from the classes specified in manifest.xml.
+ */
+internal class FlatClasses
+{
+
+ import org.apache.flex.flat.beads.CSSScrollBarView; CSSScrollBarView;
+ import org.apache.flex.flat.beads.CSSScrollBarButtonView; CSSScrollBarButtonView;
+ import org.apache.flex.flat.supportClasses.DropDownListStringItemRenderer; DropDownListStringItemRenderer;
+}
+
+}
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/CheckBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/CheckBox.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/CheckBox.as
new file mode 100644
index 0000000..b91a2c9
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/CheckBox.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat
+{
+ import org.apache.flex.html.CheckBox;
+
+ /**
+ * The CheckBox class provides a FlatUI-like appearance for
+ * a CheckBox.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CheckBox extends org.apache.flex.html.CheckBox
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CheckBox()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/DropDownList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/DropDownList.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/DropDownList.as
new file mode 100644
index 0000000..30a22a5
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/DropDownList.as
@@ -0,0 +1,46 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat
+{
+ import org.apache.flex.html.DropDownList;
+ /**
+ * The DropDownList class provides a FlatUI-like appearance for
+ * a DropDownList.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownList extends org.apache.flex.html.DropDownList
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownList()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/RadioButton.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/RadioButton.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/RadioButton.as
new file mode 100644
index 0000000..ca02613
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/RadioButton.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat
+{
+ import org.apache.flex.html.RadioButton;
+
+ /**
+ * The RadioButton class provides a FlatUI-like appearance for
+ * a RadioButton.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RadioButton extends org.apache.flex.html.RadioButton
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RadioButton()
+ {
+ super();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..aacefb2
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
@@ -0,0 +1,304 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.core.StyleableCSSTextField;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.CSSUtils;
+
+ /**
+ * The CSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.flat.CheckBox and RadioButton classes.
+ * It supports CSS content property for the
+ * icon.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSContentAndTextToggleButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * map of classname suffixes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private static var suffixMap:Object = {
+ "upSprite": "",
+ "downSprite": "-checked",
+ "overSprite": "-hover",
+ "upAndSelectedSprite": "-checked",
+ "downAndSelectedSprite": "-checked",
+ "overAndSelectedSprite": "-checked"
+ }
+
+ /**
+ * className to use for styling.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected var className:String;
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSContentAndTextToggleButtonView()
+ {
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upAndSelectedSprite:Sprite;
+ private var downAndSelectedSprite:Sprite;
+ private var overAndSelectedSprite:Sprite;
+
+ private var sprites:Array = [];
+
+ private var _toggleButtonModel:IToggleButtonModel;
+
+ // TODO: Can we remove this?
+ private function get toggleButtonModel() : IToggleButtonModel
+ {
+ return _toggleButtonModel;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ for (var p:String in suffixMap)
+ {
+ var s:Sprite = new Sprite();
+ sprites.push(s);
+ this[p] = s;
+
+ var tf:CSSTextField = new CSSTextField();
+ tf.type = TextFieldType.DYNAMIC;
+ tf.autoSize = TextFieldAutoSize.LEFT;
+ tf.name = "textField";
+ tf.parentHandlesPadding = true;
+ var icon:StyleableCSSTextField = new StyleableCSSTextField();
+ icon.name = "icon";
+ icon.className = className + suffixMap[p];
+ s.addChild(icon);
+ s.addChild(tf);
+ }
+
+ _toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
+ _toggleButtonModel.addEventListener("textChange", textChangeHandler);
+ _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
+ _toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
+ if (_toggleButtonModel.text !== null)
+ text = _toggleButtonModel.text;
+
+ layoutControl();
+
+ var hitArea:Shape = new Shape();
+ hitArea.graphics.beginFill(0x000000);
+ hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
+ hitArea.graphics.endFill();
+
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = hitArea;
+
+ if (toggleButtonModel.text !== null)
+ text = toggleButtonModel.text;
+ if (toggleButtonModel.html !== null)
+ html = toggleButtonModel.html;
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.styleParent = _strand;
+ tf.text = value;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.htmlText = value;
+ }
+
+ layoutControl();
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = toggleButtonModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = toggleButtonModel.html;
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * @copy org.apache.flex.core.IToggleButtonModel#selected
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+
+ /**
+ * @private
+ */
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+
+ layoutControl();
+
+ if( value ) {
+ SimpleButton(_strand).upState = upAndSelectedSprite;
+ SimpleButton(_strand).downState = downAndSelectedSprite;
+ SimpleButton(_strand).overState = overAndSelectedSprite;
+
+ } else {
+ SimpleButton(_strand).upState = upSprite;
+ SimpleButton(_strand).downState = downSprite;
+ SimpleButton(_strand).overState = overSprite;
+ }
+ }
+
+ private function selectedChangeHandler(event:Event):void
+ {
+ selected = toggleButtonModel.selected;
+ }
+
+ /**
+ * Display the icon and text label
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function layoutControl() : void
+ {
+ // TODO: Layout using descendant selectors (.checkbox .icons)
+ for (var p:String in suffixMap)
+ {
+ var s:Sprite = this[p];
+ var icon:StyleableCSSTextField = s.getChildByName("icon") as StyleableCSSTextField;
+ icon.autoSize = TextFieldAutoSize.LEFT;
+ var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
+
+ icon.CSSParent = _strand;
+ var content:String = ValuesManager.valuesImpl.getValue(icon, "content", "before");
+ if (content != null)
+ icon.text = content;
+ var mh:Number = Math.max(icon.height,tf.height);
+
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left");
+ icon.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
+ icon.y = (mh - icon.height)/2;
+
+ tf.x = icon.x + icon.width + 1;
+ tf.y = (mh - tf.height)/2;
+ }
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarButtonView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarButtonView.as
new file mode 100644
index 0000000..09669c4
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarButtonView.as
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.Loader;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.events.Event;
+ import flash.net.URLRequest;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSShape;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.ITextModel;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.utils.CSSBorderUtils;
+ import org.apache.flex.utils.CSSUtils;
+ import org.apache.flex.utils.StringTrimmer;
+
+ /**
+ * The CSSScrollBarButtonView class is the default view for
+ * the buttons in a org.apache.flex.html.ScrollBar class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSScrollBarButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSScrollBarButtonView()
+ {
+ upSprite = new Sprite();
+ downSprite = new Sprite();
+ overSprite = new Sprite();
+ upArrowShape = new CSSShape();
+ downArrowShape = new CSSShape();
+ overArrowShape = new CSSShape();
+ overArrowShape.state = "hover";
+ upSprite.addChild(upArrowShape);
+ downSprite.addChild(downArrowShape);
+ overSprite.addChild(overArrowShape);
+ }
+
+ private var textModel:ITextModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+
+ setupBackground(overSprite, overArrowShape, "hover");
+ setupBackground(downSprite, downArrowShape, "active");
+ setupBackground(upSprite, upArrowShape);
+
+ IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
+ IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
+ }
+
+ private function sizeChangeHandler(event:org.apache.flex.events.Event):void
+ {
+ setupSkins();
+ }
+
+ protected function setupSkins():void
+ {
+ setupSkin(overSprite, overArrowShape, "hover");
+ setupSkin(downSprite, downArrowShape, "active");
+ setupSkin(upSprite, upArrowShape);
+ updateHitArea();
+ }
+
+ private function setupSkin(sprite:Sprite, shape:CSSShape, state:String = null):void
+ {
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
+ var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
+ var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
+
+ var w:Object = ValuesManager.valuesImpl.getValue(shape, "width", state);
+ var h:Object = ValuesManager.valuesImpl.getValue(shape, "height", state);
+ shape.draw(Number(w), Number(h));
+
+ CSSBorderUtils.draw(sprite.graphics,
+ shape.width + pl + pr,
+ shape.height + pt + pb,
+ _strand as DisplayObject,
+ state, true);
+ }
+
+ private function setupBackground(sprite:Sprite, shape:CSSShape, state:String = null):void
+ {
+ var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
+ if (backgroundImage)
+ {
+ var loader:Loader = new Loader();
+ sprite.addChildAt(loader, 0);
+ var url:String = backgroundImage as String;
+ loader.load(new URLRequest(url));
+ loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
+ setupSkin(sprite, shape, state);
+ updateHitArea();
+ });
+ }
+ else {
+ setupSkin(sprite, shape, state);
+ updateHitArea();
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ public var upArrowShape:CSSShape;
+ public var downArrowShape:CSSShape;
+ public var overArrowShape:CSSShape;
+
+ private function updateHitArea():void
+ {
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
+ shape.graphics.endFill();
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarView.as
new file mode 100644
index 0000000..38583f6
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSScrollBarView.as
@@ -0,0 +1,241 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+ import flash.display.DisplayObject;
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IBeadLayout;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IScrollBarModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.Strand;
+ import org.apache.flex.core.UIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.IEventDispatcher;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.Button;
+ import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
+ import org.apache.flex.html.beads.IScrollBarView;
+
+ /**
+ * The ScrollBarView class is the default view for
+ * the org.apache.flex.html.supportClasses.ScrollBar class.
+ * It implements the classic desktop-like ScrollBar.
+ * A different view would implement more modern scrollbars that hide themselves
+ * until hovered over with the mouse.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSScrollBarView()
+ {
+ }
+
+ private var sbModel:IScrollBarModel;
+
+ private var _strand:IStrand;
+
+ /**
+ * The layout.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private var layout:IBeadLayout;
+
+ /**
+ * The host component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get host():IUIBase
+ {
+ return _strand as IUIBase;
+ }
+
+ /**
+ * @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;
+
+ for each (var bead:IBead in beads)
+ addBead(bead);
+
+ sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
+ sbModel.addEventListener("maximumChange", changeHandler);
+ sbModel.addEventListener("minimumChange", changeHandler);
+ sbModel.addEventListener("snapIntervalChange", changeHandler);
+ sbModel.addEventListener("stepSizeChange", changeHandler);
+ sbModel.addEventListener("pageSizeChange", changeHandler);
+ sbModel.addEventListener("valueChange", changeHandler);
+
+ // TODO: (aharui) put in values impl
+ _increment = new Button();
+ Button(_increment).className = "vscrollbar-downarrow-btn";
+ var sbView:CSSScrollBarButtonView = new CSSScrollBarButtonView();
+ sbView.upArrowShape.className = "vscrollbar-downarrow";
+ sbView.downArrowShape.className = "vscrollbar-downarrow";
+ sbView.overArrowShape.className = "vscrollbar-downarrow";
+ Button(_increment).addBead(sbView);
+ Button(_increment).addBead(new ButtonAutoRepeatController());
+ _decrement = new Button();
+ Button(_decrement).className = "vscrollbar-uparrow-btn";
+ sbView = new CSSScrollBarButtonView();
+ sbView.upArrowShape.className = "vscrollbar-uparrow";
+ sbView.downArrowShape.className = "vscrollbar-uparrow";
+ sbView.overArrowShape.className = "vscrollbar-uparrow";
+ Button(_decrement).addBead(sbView);
+ Button(_decrement).addBead(new ButtonAutoRepeatController());
+ _track = new Button();
+ Button(_track).className = "vscrollbar-track";
+ _thumb = new Button();
+ Button(_thumb).className = "vscrollbar-thumb";
+
+ UIBase(value).addElement(_decrement);
+ UIBase(value).addElement(_increment);
+ UIBase(value).addElement(_track);
+ UIBase(value).addElement(_thumb);
+
+ IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
+
+ if( _strand.getBeadByType(IBeadLayout) == null ) {
+ layout = new (ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout")) as IBeadLayout;
+ _strand.addBead(layout);
+ }
+ layout.layout();
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ layout.layout();
+ }
+
+ private var _decrement:DisplayObject;
+ private var _increment:DisplayObject;
+ private var _track:DisplayObject;
+ private var _thumb:DisplayObject;
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#decrement
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get decrement():DisplayObject
+ {
+ return _decrement;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#increment
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get increment():DisplayObject
+ {
+ return _increment;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#track
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get track():DisplayObject
+ {
+ return _track;
+ }
+
+ /**
+ * @copy org.apache.flex.html.beads.IScrollBarView#thumb
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get thumb():DisplayObject
+ {
+ return _thumb;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewHeight
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewHeight():Number
+ {
+ // don't want to put $height in an interface
+ return _strand["$height"];
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBeadView#viewWidth
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get viewWidth():Number
+ {
+ // don't want to put $width in an interface
+ return _strand["$width"];
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CheckboxCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CheckboxCSSContentAndTextToggleButtonView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CheckboxCSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..e52076f
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CheckboxCSSContentAndTextToggleButtonView.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+
+ /**
+ * The CheckboxCSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.flat.Checkbox class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CheckboxCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CheckboxCSSContentAndTextToggleButtonView()
+ {
+ super();
+
+ className = "checkbox-icon";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
new file mode 100644
index 0000000..0aaf964
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
@@ -0,0 +1,287 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+ import flash.display.DisplayObject;
+ import flash.display.DisplayObjectContainer;
+ import flash.display.Graphics;
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.CSSShape;
+ import org.apache.flex.core.CSSSprite;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.ISelectionModel;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IPopUpHost;
+ import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.events.IEventDispatcher;
+
+ /**
+ * The DropDownListView class is the default view for
+ * the org.apache.flex.flat.DropDownList class.
+ * It displays a simple text label with what appears to be a
+ * down arrow button on the right, but really, the entire
+ * view is the button that will display or dismiss the dropdown.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListView extends BeadViewBase implements IDropDownListView, IBeadView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListView()
+ {
+ upSprite = new CSSSprite();
+ upSprite.className = 'dropdown-toggle-open-btn';
+ downSprite = new CSSSprite();
+ downSprite.className = 'dropdown-toggle-open-btn';
+ overSprite = new CSSSprite();
+ overSprite.className = 'dropdown-toggle-open-btn';
+ overSprite.state = 'hover';
+ upTextField = new CSSTextField();
+ downTextField = new CSSTextField();
+ overTextField = new CSSTextField();
+ upSprite.addChild(upTextField);
+ overSprite.addChild(overTextField);
+ downSprite.addChild(downTextField);
+ upTextField.selectable = false;
+ upTextField.parentDrawsBackground = true;
+ upTextField.type = TextFieldType.DYNAMIC;
+ downTextField.selectable = false;
+ downTextField.parentDrawsBackground = true;
+ downTextField.type = TextFieldType.DYNAMIC;
+ overTextField.selectable = false;
+ overTextField.parentDrawsBackground = true;
+ overTextField.type = TextFieldType.DYNAMIC;
+ // auto-size collapses if no text
+ //upTextField.autoSize = "left";
+ //downTextField.autoSize = "left";
+ //overTextField.autoSize = "left";
+
+ upArrows = new CSSShape();
+ upArrows.className = 'dropdown-caret';
+ overArrows = new CSSShape();
+ overArrows.className = 'dropdown-caret';
+ downArrows = new CSSShape();
+ downArrows.className = 'dropdown-caret';
+ upSprite.addChild(upArrows);
+ overSprite.addChild(overArrows);
+ downSprite.addChild(downArrows);
+
+ }
+
+
+ private var selectionModel:ISelectionModel;
+
+ private var shape:Shape;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;;
+ selectionModel = value.getBeadByType(ISelectionModel) as ISelectionModel;
+ selectionModel.addEventListener("selectedIndexChanged", selectionChangeHandler);
+ shape = new Shape();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, 10, 10);
+ shape.graphics.endFill();
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = shape;
+ if (selectionModel.selectedIndex !== -1)
+ text = selectionModel.selectedItem.toString();
+ else
+ text = "^W_";
+ upTextField.height = upTextField.textHeight + 4;
+ downTextField.height = downTextField.textHeight + 4;
+ overTextField.height = overTextField.textHeight + 4;
+ if (selectionModel.selectedIndex == -1)
+ text = "";
+
+ IEventDispatcher(value).addEventListener("heightChanged", changeHandler);
+ IEventDispatcher(value).addEventListener("widthChanged", changeHandler);
+ changeHandler(null);
+ }
+
+ private function selectionChangeHandler(event:Event):void
+ {
+ text = selectionModel.selectedItem.toString();
+ }
+
+ private function changeHandler(event:Event):void
+ {
+ var ww:Number = DisplayObject(_strand).width;
+ var hh:Number = DisplayObject(_strand).height;
+ upArrows.draw(0, 0);
+ overArrows.draw(0, 0);
+ downArrows.draw(0, 0);
+ upSprite.draw(ww, hh);
+ overSprite.draw(ww, hh);
+ downSprite.draw(ww, hh);
+
+ upArrows.x = ww - upArrows.width;
+ overArrows.x = ww - overArrows.width;
+ downArrows.x = ww - downArrows.width;
+ upArrows.y = (hh - upArrows.height) / 2;
+ overArrows.y = (hh - overArrows.height) / 2;
+ downArrows.y = (hh - downArrows.height) / 2;
+
+ upTextField.width = upArrows.x;
+ downTextField.width = downArrows.x;
+ overTextField.width = overArrows.x;
+ upTextField.height = upTextField.textHeight + 5;
+ downTextField.height = downTextField.textHeight + 5;
+ overTextField.height = overTextField.textHeight + 5;
+ upTextField.y = (hh - upTextField.height) / 2;
+ downTextField.y = (hh - downTextField.height) / 2;
+ overTextField.y = (hh - overTextField.height) / 2;
+ shape.graphics.clear();
+ shape.graphics.beginFill(0xCCCCCC);
+ shape.graphics.drawRect(0, 0, ww, hh);
+ shape.graphics.endFill();
+ }
+
+ private var upTextField:CSSTextField;
+ private var downTextField:CSSTextField;
+ private var overTextField:CSSTextField;
+ private var upSprite:CSSSprite;
+ private var downSprite:CSSSprite;
+ private var overSprite:CSSSprite;
+ private var upArrows:CSSShape;
+ private var downArrows:CSSShape;
+ private var overArrows:CSSShape;
+
+ /**
+ * The text that is displayed in the view.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ return upTextField.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ var ww:Number = DisplayObject(_strand).width;
+ var hh:Number = DisplayObject(_strand).height;
+ upTextField.text = value;
+ downTextField.text = value;
+ overTextField.text = value;
+ upTextField.height = upTextField.textHeight + 5;
+ downTextField.height = downTextField.textHeight + 5;
+ overTextField.height = overTextField.textHeight + 5;
+ upTextField.y = (hh - upTextField.height) / 2;
+ downTextField.y = (hh - downTextField.height) / 2;
+ overTextField.y = (hh - overTextField.height) / 2;
+ }
+
+ private var _popUp:IStrand;
+
+ /**
+ * The dropdown/popup that displays the set of choices.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get popUp():IStrand
+ {
+ return _popUp;
+ }
+
+ private var _popUpVisible:Boolean;
+
+ /**
+ * A flag that indicates whether the dropdown/popup is
+ * visible.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get popUpVisible():Boolean
+ {
+ return _popUpVisible;
+ }
+
+ /**
+ * @private
+ */
+ public function set popUpVisible(value:Boolean):void
+ {
+ if (value != _popUpVisible)
+ {
+ _popUpVisible = value;
+ if (value)
+ {
+ if (!_popUp)
+ {
+ var popUpClass:Class = ValuesManager.valuesImpl.getValue(_strand, "iPopUp") as Class;
+ _popUp = new popUpClass() as IStrand;
+ }
+ var root:Object = DisplayObject(_strand).root;
+ var host:DisplayObjectContainer = DisplayObject(_strand).parent;
+ while (host && !(host is IPopUpHost))
+ host = host.parent;
+ if (host)
+ IPopUpHost(host).addElement(popUp);
+ }
+ else
+ {
+ DisplayObject(_popUp).parent.removeChild(_popUp as DisplayObject);
+ }
+ }
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/RadioCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/RadioCSSContentAndTextToggleButtonView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/RadioCSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..e6e3ba5
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/RadioCSSContentAndTextToggleButtonView.as
@@ -0,0 +1,47 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.beads
+{
+ /**
+ * The RadioCSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.flat.RadioButton class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class RadioCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function RadioCSSContentAndTextToggleButtonView()
+ {
+ super();
+
+ className = "radio-icon";
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
new file mode 100644
index 0000000..097f279
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListList.as
@@ -0,0 +1,76 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.supportClasses
+{
+ import org.apache.flex.core.IPopUp;
+ import org.apache.flex.html.SimpleList;
+ import org.apache.flex.html.beads.SolidBackgroundBead;
+
+ //--------------------------------------
+ // Events
+ //--------------------------------------
+
+ /**
+ * @copy org.apache.flex.core.ISelectionModel#change
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ [Event(name="change", type="org.apache.flex.events.Event")]
+
+ /**
+ * The DropDownListList class is the List class used internally
+ * by DropDownList as the dropdown/popup.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListList extends SimpleList implements IPopUp
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListList()
+ {
+ super();
+ className = "dropdown-menu";
+ }
+
+ /**
+ * @private
+ */
+ override public function addedToParent():void
+ {
+ super.addedToParent();
+
+ var bb:SolidBackgroundBead = new SolidBackgroundBead();
+ bb.backgroundColor = 0xffffff;
+ addBead(bb);
+ }
+ }
+}
[36/36] git commit: [flex-asjs] [refs/heads/develop] - merge flatui
branch
Posted by ah...@apache.org.
merge flatui branch
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/d54c90d9
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/d54c90d9
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/d54c90d9
Branch: refs/heads/develop
Commit: d54c90d928017d7606b4815355eb6ecfb87925f7
Parents: d3b4e74 acfe9b7
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 28 11:33:33 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 28 11:33:33 2015 -0700
----------------------------------------------------------------------
.gitignore | 1 +
LICENSE | 12 +
LICENSE.bin | 13 +
build.xml | 15 +-
.../DataBindingTest/src/DataBindingTest.mxml | 1 +
examples/DataBindingTest/src/MyInitialView.mxml | 3 +-
examples/DataBindingTest_Flat/build.xml | 48 ++
.../src/DataBindingTest.mxml | 53 ++
.../DataBindingTest_Flat/src/MyInitialView.mxml | 144 ++++
examples/DataBindingTest_Flat/src/README.txt | 52 ++
.../src/StockDataJSONItemConverter.as | 40 +
.../src/controllers/MyController.as | 81 ++
.../DataBindingTest_Flat/src/models/MyModel.as | 124 +++
examples/build_example.xml | 19 +
frameworks/air-config-template.xml | 6 +
frameworks/air-config.xml | 6 +
frameworks/build.xml | 15 +-
frameworks/downloads.xml | 44 +-
frameworks/flex-config-template.xml | 6 +
frameworks/flex-config.xml | 6 +
frameworks/fontsrc/FlatUIIcons.as | 47 ++
frameworks/fontsrc/build.xml | 91 ++
frameworks/projects/Core/as/src/CoreClasses.as | 7 +-
.../as/src/org/apache/flex/core/Application.as | 44 +-
.../src/org/apache/flex/core/CSSFontFaceBead.as | 146 ++++
.../as/src/org/apache/flex/core/CSSShape.as | 162 ++++
.../as/src/org/apache/flex/core/CSSSprite.as | 162 ++++
.../as/src/org/apache/flex/core/CSSTextField.as | 87 +-
.../org/apache/flex/core/SimpleCSSValuesImpl.as | 24 +-
.../apache/flex/core/StyleableCSSTextField.as | 200 +++++
.../as/src/org/apache/flex/core/UIButtonBase.as | 6 +-
.../src/org/apache/flex/utils/CSSBorderUtils.as | 218 +++++
.../as/src/org/apache/flex/utils/CSSUtils.as | 323 ++++++++
.../org/apache/flex/utils/SolidBorderUtil.as | 138 +++-
.../src/org/apache/flex/utils/StringTrimmer.as | 175 ++++
frameworks/projects/Core/basic-manifest.xml | 1 +
.../src/org/apache/flex/core/CSSFontFaceBead.js | 54 ++
frameworks/projects/Flat/as/defaults.css | 822 +++++++++++++++++++
frameworks/projects/Flat/as/src/FlatClasses.as | 37 +
.../as/src/org/apache/flex/flat/CheckBox.as | 47 ++
.../as/src/org/apache/flex/flat/DropDownList.as | 46 ++
.../as/src/org/apache/flex/flat/RadioButton.as | 47 ++
.../beads/CSSContentAndTextToggleButtonView.as | 304 +++++++
.../flex/flat/beads/CSSScrollBarButtonView.as | 178 ++++
.../apache/flex/flat/beads/CSSScrollBarView.as | 241 ++++++
...CheckboxCSSContentAndTextToggleButtonView.as | 48 ++
.../apache/flex/flat/beads/DropDownListView.as | 303 +++++++
.../RadioCSSContentAndTextToggleButtonView.as | 47 ++
.../flat/supportClasses/DropDownListList.as | 64 ++
.../DropDownListStringItemRenderer.as | 71 ++
frameworks/projects/Flat/build.xml | 161 ++++
frameworks/projects/Flat/compile-config.xml | 91 ++
frameworks/projects/Flat/flat-manifest.xml | 107 +++
.../js/src/org/apache/flex/flat/CheckBox.js | 137 ++++
.../js/src/org/apache/flex/flat/DropDownList.js | 219 +++++
.../js/src/org/apache/flex/flat/RadioButton.js | 227 +++++
frameworks/projects/HTML/as/defaults.css | 73 +-
frameworks/projects/HTML/as/src/HTMLClasses.as | 1 +
.../org/apache/flex/html/beads/CSSButtonView.as | 89 +-
.../apache/flex/html/beads/CSSTextButtonView.as | 101 ++-
.../org/apache/flex/html/beads/CheckBoxView.as | 12 +-
.../flex/html/beads/DownArrowButtonView.as | 24 +-
.../apache/flex/html/beads/DropDownListView.as | 93 ++-
.../apache/flex/html/beads/RadioButtonView.as | 8 +-
.../flex/html/beads/SingleLineBorderBead.as | 27 +-
.../flex/html/beads/SolidBackgroundBead.as | 36 +-
.../org/apache/flex/html/beads/TextAreaView.as | 17 +-
.../apache/flex/html/beads/TextFieldViewBase.as | 14 +-
.../org/apache/flex/html/beads/TextInputView.as | 44 +-
.../apache/flex/html/beads/UpArrowButtonView.as | 22 +-
.../flex/html/beads/VScrollBarThumbView.as | 25 +-
.../flex/html/beads/VScrollBarTrackView.as | 12 +-
.../beads/controllers/DropDownListController.as | 5 +-
.../flex/html/beads/layouts/VScrollBarLayout.as | 6 +-
.../html/supportClasses/DropDownListList.as | 12 -
frameworks/projects/HTML/basic-manifest.xml | 2 +
.../js/src/org/apache/flex/html/CheckBox.js | 3 +
.../js/src/org/apache/flex/html/DropDownList.js | 8 +-
.../js/src/org/apache/flex/html/RadioButton.js | 3 +
.../js/src/org/apache/flex/html/TextArea.js | 2 +
.../js/src/org/apache/flex/html/TextInput.js | 2 +
.../flex/html/beads/layouts/HorizontalLayout.js | 1 -
mustella/tests/basicTests/BasicTests.css | 339 ++++----
mustella/tests/basicTests/BasicTestsApp.mxml | 14 +-
84 files changed, 6255 insertions(+), 511 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d54c90d9/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d54c90d9/frameworks/projects/HTML/as/src/HTMLClasses.as
----------------------------------------------------------------------
diff --cc frameworks/projects/HTML/as/src/HTMLClasses.as
index fc5c993,e8b2165..61feb38
--- a/frameworks/projects/HTML/as/src/HTMLClasses.as
+++ b/frameworks/projects/HTML/as/src/HTMLClasses.as
@@@ -52,8 -52,7 +52,9 @@@ internal class HTMLClasse
import org.apache.flex.html.beads.PanelView; PanelView;
import org.apache.flex.html.beads.PanelWithControlBarView; PanelWithControlBarView;
import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
+ import org.apache.flex.html.beads.VScrollBarView; VScrollBarView;
+ import org.apache.flex.html.beads.HScrollBarView; HScrollBarView;
+ import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
import org.apache.flex.html.beads.SingleLineBorderBead; SingleLineBorderBead;
import org.apache.flex.html.beads.SliderView; SliderView;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d54c90d9/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
[25/36] git commit: [flex-asjs] [refs/heads/develop] - start moving
the FlatUI code to its own swc and revert the HTML library back to its basic
state
Posted by ah...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListStringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListStringItemRenderer.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListStringItemRenderer.as
new file mode 100644
index 0000000..e73eef0
--- /dev/null
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/supportClasses/DropDownListStringItemRenderer.as
@@ -0,0 +1,71 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.flat.supportClasses
+{
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.ITextItemRenderer;
+ import org.apache.flex.html.supportClasses.StringItemRenderer;
+
+ /**
+ * The DropDownListStringItemRenderer is a StringItemRenderer with a particular
+ * className for use in DropDownList.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class DropDownListStringItemRenderer extends StringItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function DropDownListStringItemRenderer()
+ {
+ super();
+
+ className = 'dropdown-menu-item-renderer';
+ percentWidth = 90;
+ }
+
+ /**
+ * @private
+ */
+ override public function updateRenderer():void
+ {
+ className = selected ? 'dropdown-menu-item-renderer-selected' : 'dropdown-menu-item-renderer';
+ if (selected)
+ selectedColor = ValuesManager.valuesImpl.getValue(this, 'background-color');
+ if (hovered)
+ highlightColor = ValuesManager.valuesImpl.getValue(this, 'background-color', "hover");
+ downColor = selectedColor;
+ super.updateRenderer();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/build.xml b/frameworks/projects/Flat/build.xml
new file mode 100644
index 0000000..54ceacd
--- /dev/null
+++ b/frameworks/projects/Flat/build.xml
@@ -0,0 +1,161 @@
+<?xml version="1.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.
+
+-->
+
+
+<project name="Flat" default="main" basedir=".">
+ <property name="FLEXJS_HOME" location="../../.."/>
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+ <property name="FALCON_HOME" value="${env.FALCON_HOME}"/>
+ <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/>
+ <property name="gjslint" value="gjslint" />
+ <property name="jshint" value="jshint" />
+ <condition property="no.lint" value="true">
+ <os family="windows"/>
+ </condition>
+
+ <target name="main" depends="clean,compile,test" description="Clean build of Flat.swc">
+ </target>
+
+ <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Flat.swc">
+ </target>
+
+ <target name="test" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="as/tests" />
+ <ant dir="asjs/tests" />
+ -->
+ </target>
+
+ <target name="test-js" unless="is.jenkins">
+ <!-- no tests yet
+ <ant dir="js/tests" />
+ -->
+ </target>
+
+ <target name="clean">
+ <delete failonerror="false">
+ <fileset dir="${FLEXJS_HOME}/frameworks/libs">
+ <include name="Flat.swc"/>
+ </fileset>
+ </delete>
+ <delete failonerror="false">
+ <fileset dir="${basedir}/js/out">
+ <include name="**/**"/>
+ </fileset>
+ </delete>
+ </target>
+
+ <path id="lib.path">
+ <fileset dir="${FALCON_HOME}/lib" includes="falcon-flexTasks.jar"/>
+ </path>
+
+ <target name="compile" description="Compiles .as files into .swc">
+ <echo message="Compiling libs/Flat"/>
+ <echo message="FLEX_HOME: ${FLEX_HOME}"/>
+ <echo message="FALCON_HOME: ${FALCON_HOME}"/>
+ <!-- make JS output folder now so include-file doesn't error -->
+ <mkdir dir="${basedir}/js/out" />
+
+ <!-- Load the <compc> task. We can't do this at the <project> level -->
+ <!-- because targets that run before flexTasks.jar gets built would fail. -->
+ <taskdef resource="flexTasks.tasks" classpathref="lib.path"/>
+ <!--
+ Link in the classes (and their dependencies) for the MXML tags
+ listed in this project's manifest.xml.
+ Also link the additional classes (and their dependencies)
+ listed in FlatClasses.as,
+ because these aren't referenced by the manifest classes.
+ Keep the standard metadata when compiling.
+ Include the appropriate CSS files and assets in the SWC.
+ Don't include any resources in the SWC.
+ Write a bundle list of referenced resource bundles
+ into the file bundles.properties in this directory.
+ -->
+ <compc fork="true"
+ output="${FLEXJS_HOME}/frameworks/libs/Flat.swc">
+ <jvmarg line="${compc.jvm.args}"/>
+ <load-config filename="compile-config.xml" />
+ <arg value="+playerglobal.version=${playerglobal.version}" />
+ <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+ </compc>
+ </target>
+
+ <target name="compile-asjs" >
+ <echo message="Cross-compiling Flat/asjs"/>
+ <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/>
+ <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" >
+ <jvmarg value="-Xmx384m" />
+ <jvmarg value="-Dsun.io.useCanonCaches=false" />
+ <jvmarg value="-Dflexcompiler=${FALCONJX_HOME}/../compiler" />
+ <jvmarg value="-Dflexlib=${FLEXJS_HOME}/frameworks" />
+ <arg value="+flexlib=${FLEX_HOME}/frameworks" />
+ <arg value="-js-output-type=FLEXJS" />
+ <arg value="-keep-asdoc" /><!-- allows compiler to see @flexjsignorecoercion annotations -->
+ <arg value="-output=${basedir}/js/out" />
+ <arg value="-load-config=${basedir}/compile-asjs-config.xml" />
+ <arg value="+playerglobal.version=${playerglobal.version}" />
+ <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+ <arg value="+env.AIR_HOME=${env.AIR_HOME}" />
+ </java>
+ </target>
+
+ <target name="lint-js" depends="gjslint, jshint, copy-js" />
+ <target name="copy-js" >
+ <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs">
+ <fileset dir="${basedir}/js/src">
+ <include name="**/**" />
+ </fileset>
+ <fileset dir="${basedir}/js/out">
+ <include name="**/**" />
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="gjslint" unless="no.lint">
+ <echo>running gjslint</echo>
+ <exec executable="${gjslint}" dir="${basedir}" failonerror="true">
+ <arg value="--strict" />
+ <arg value="--disable" />
+ <arg value="006,100,214,300" />
+ <!-- 006: wrong indentation -->
+ <!-- 100: cannot have non-primitive value -->
+ <!-- 214: @fileoverview tag missing description -->
+ <!-- 300: missing newline at end of file -->
+ <arg value="--max_line_length" />
+ <arg value="120" />
+ <arg value="-r" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+ <target name="jshint" unless="no.lint">
+ <echo>running jshint</echo>
+ <exec executable="${jshint}" dir="${basedir}" failonerror="true">
+ <arg value="--config" />
+ <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" />
+ <arg value="${basedir}/js/src" />
+ </exec>
+ </target>
+
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/compile-config.xml b/frameworks/projects/Flat/compile-config.xml
new file mode 100644
index 0000000..b8a2f60
--- /dev/null
+++ b/frameworks/projects/Flat/compile-config.xml
@@ -0,0 +1,91 @@
+<!--
+
+ 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.
+
+-->
+<flex-config>
+
+ <compiler>
+ <accessible>false</accessible>
+
+ <external-library-path>
+ <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
+ <path-element>../../libs/Binding.swc</path-element>
+ <path-element>../../libs/Core.swc</path-element>
+ <path-element>../../libs/Graphics.swc</path-element>
+ <path-element>../../libs/HTML.swc</path-element>
+ </external-library-path>
+
+ <mxml>
+ <children-as-data>true</children-as-data>
+ </mxml>
+ <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event>
+ <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind>
+ <binding-value-change-event-type>valueChange</binding-value-change-event-type>
+
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Managed</name>
+ <name>ChangeEvent</name>
+ <name>NonCommittingChangeEvent</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <locale/>
+
+ <library-path/>
+
+ <namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+ <manifest>flat-manifest.xml</manifest>
+ </namespace>
+ </namespaces>
+
+ <source-path>
+ <path-element>as/src</path-element>
+ <!--<path-element>asjs/src</path-element>-->
+ </source-path>
+
+ <warn-no-constructor>false</warn-no-constructor>
+ </compiler>
+
+ <include-file>
+ <name>defaults.css</name>
+ <path>as/defaults.css</path>
+ </include-file>
+ <include-file>
+ <name>js/out/*</name>
+ <path>js/out/*</path>
+ </include-file>
+ <include-file>
+ <name>js/src/*</name>
+ <path>js/src/*</path>
+ </include-file>
+
+ <include-classes>
+ <class>FlatClasses</class>
+ <!--<class>FlatASJSClasses</class>-->
+ </include-classes>
+
+ <include-namespaces>
+ <uri>library://ns.apache.org/flexjs/flat</uri>
+ </include-namespaces>
+
+ <target-player>${playerglobal.version}</target-player>
+
+
+</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/flat-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/flat-manifest.xml b/frameworks/projects/Flat/flat-manifest.xml
new file mode 100644
index 0000000..1677425
--- /dev/null
+++ b/frameworks/projects/Flat/flat-manifest.xml
@@ -0,0 +1,105 @@
+<?xml version="1.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.
+
+-->
+
+
+<componentPackage>
+
+ <component id="Button" class="org.apache.flex.html.Button" lookupOnly="true" />
+ <component id="ButtonBar" class="org.apache.flex.html.ButtonBar" lookupOnly="true" />
+ <component id="CloseButton" class="org.apache.flex.html.CloseButton" lookupOnly="true" />
+ <component id="DropDownList" class="org.apache.flex.flat.DropDownList" />
+ <component id="DropDownListList" class="org.apache.flex.flat.supportClasses.DropDownListList" />
+ <component id="Image" class="org.apache.flex.html.Image" lookupOnly="true" />
+ <component id="Label" class="org.apache.flex.html.Label" lookupOnly="true" />
+ <component id="MultilineLabel" class="org.apache.flex.html.MultilineLabel" lookupOnly="true" />
+ <component id="ImageAndTextButton" class="org.apache.flex.html.ImageAndTextButton" lookupOnly="true" />
+ <component id="TextButton" class="org.apache.flex.html.TextButton" lookupOnly="true" />
+ <component id="ToggleTextButton" class="org.apache.flex.html.ToggleTextButton" lookupOnly="true" />
+ <component id="TextInput" class="org.apache.flex.html.TextInput" lookupOnly="true" />
+ <component id="TextArea" class="org.apache.flex.html.TextArea" lookupOnly="true" />
+ <component id="List" class="org.apache.flex.html.List" lookupOnly="true" />
+ <component id="SimpleList" class="org.apache.flex.html.SimpleList" lookupOnly="true" />
+ <component id="CheckBox" class="org.apache.flex.flat.CheckBox" />
+ <component id="RadioButton" class="org.apache.flex.flat.RadioButton" />
+ <component id="ComboBox" class="org.apache.flex.html.ComboBox" lookupOnly="true" />
+ <component id="Container" class="org.apache.flex.html.Container" lookupOnly="true" />
+ <component id="HContainer" class="org.apache.flex.html.HContainer" lookupOnly="true" />
+ <component id="VContainer" class="org.apache.flex.html.VContainer" lookupOnly="true" />
+ <component id="Panel" class="org.apache.flex.html.Panel" lookupOnly="true" />
+ <component id="PanelView" class="org.apache.flex.html.beads.PanelView" lookupOnly="true" />
+ <component id="PanelWithControlBar" class="org.apache.flex.html.PanelWithControlBar" lookupOnly="true" />
+ <component id="ControlBar" class="org.apache.flex.html.ControlBar" lookupOnly="true" />
+ <component id="TitleBar" class="org.apache.flex.html.TitleBar" lookupOnly="true" />
+ <component id="TitleBarModel" class="org.apache.flex.html.beads.models.TitleBarModel" lookupOnly="true" />
+ <component id="ToolTip" class="org.apache.flex.html.ToolTip" lookupOnly="true" />
+ <component id="BasicLayout" class="org.apache.flex.html.beads.layouts.BasicLayout" lookupOnly="true" />
+ <component id="VerticalLayout" class="org.apache.flex.html.beads.layouts.VerticalLayout" lookupOnly="true" />
+ <component id="HorizontalLayout" class="org.apache.flex.html.beads.layouts.HorizontalLayout" lookupOnly="true" />
+ <component id="TileLayout" class="org.apache.flex.html.beads.layouts.TileLayout" lookupOnly="true" />
+ <component id="ListView" class="org.apache.flex.html.beads.ListView" lookupOnly="true" />
+ <component id="ListViewNoSelectionState" class="org.apache.flex.html.beads.ListViewNoSelectionState" lookupOnly="true" />
+ <component id="MultilineTextFieldView" class="org.apache.flex.html.beads.MultilineTextFieldView" lookupOnly="true" />
+
+ <component id="SimpleAlert" class="org.apache.flex.html.SimpleAlert" lookupOnly="true" />
+ <component id="Alert" class="org.apache.flex.html.Alert" lookupOnly="true" />
+ <component id="Spinner" class="org.apache.flex.html.Spinner" lookupOnly="true" />
+ <component id="Slider" class="org.apache.flex.html.Slider" lookupOnly="true" />
+ <component id="SolidBackgroundBead" class="org.apache.flex.html.beads.SolidBackgroundBead" lookupOnly="true" />
+ <component id="NumericStepper" class="org.apache.flex.html.NumericStepper" lookupOnly="true" />
+ <component id="TextFieldItemRenderer" class="org.apache.flex.html.supportClasses.TextFieldItemRenderer" lookupOnly="true" />
+ <component id="StringItemRenderer" class="org.apache.flex.html.supportClasses.StringItemRenderer" lookupOnly="true" />
+ <component id="DataItemRenderer" class="org.apache.flex.html.supportClasses.DataItemRenderer" lookupOnly="true" />
+ <component id="ButtonBarButtonItemRenderer" class="org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer" lookupOnly="true" />
+ <component id="ScrollBar" class="org.apache.flex.html.supportClasses.ScrollBar" lookupOnly="true" />
+ <component id="CSSScrollBarView" class="org.apache.flex.flat.beads.CSSScrollBarView" />
+ <component id="NumericOnlyTextInputBead" class="org.apache.flex.html.accessories.NumericOnlyTextInputBead" lookupOnly="true" />
+ <component id="PasswordInputBead" class="org.apache.flex.html.accessories.PasswordInputBead" lookupOnly="true" />
+ <component id="TextPromptBead" class="org.apache.flex.html.accessories.TextPromptBead" lookupOnly="true" />
+ <component id="HRule" class="org.apache.flex.html.HRule" lookupOnly="true" />
+ <component id="Spacer" class="org.apache.flex.html.Spacer" lookupOnly="true" />
+ <component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" lookupOnly="true" />
+ <component id="CheckboxCSSContentAndTextToggleButtonView" class="org.apache.flex.flat.beads.CheckboxCSSContentAndTextToggleButtonView" />
+ <component id="RadioCSSContentAndTextToggleButtonView" class="org.apache.flex.flat.beads.RadioCSSContentAndTextToggleButtonView" />
+ <component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" lookupOnly="true" />
+
+ <component id="DataGrid" class="org.apache.flex.html.DataGrid" lookupOnly="true" />
+ <component id="DataGridColumn" class="org.apache.flex.html.supportClasses.DataGridColumn" lookupOnly="true" />
+ <component id="DataGridLayout" class="org.apache.flex.html.beads.layouts.DataGridLayout" lookupOnly="true" />
+
+ <component id="DateChooser" class="org.apache.flex.html.DateChooser" lookupOnly="true" />
+ <component id="DateField" class="org.apache.flex.html.DateField" lookupOnly="true" />
+ <component id="VerticalColumnLayout" class="org.apache.flex.html.beads.layouts.VerticalColumnLayout" lookupOnly="true" />
+
+ <component id="ToolTipBead" class="org.apache.flex.html.accessories.ToolTipBead" lookupOnly="true" />
+
+ <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier" lookupOnly="true" />
+ <component id="ImageButton" class="org.apache.flex.html.ImageButton" lookupOnly="true" />
+ <component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout" lookupOnly="true" />
+ <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout" lookupOnly="true" />
+ <component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout" lookupOnly="true" />
+ <component id="MXMLBeadViewBase" class="org.apache.flex.html.MXMLBeadViewBase" lookupOnly="true" />
+
+ <component id="Border" class="org.apache.flex.html.supportClasses.Border" lookupOnly="true" />
+
+ <component id="ViewBase" class="org.apache.flex.core.ViewBase" lookupOnly="true" />
+ <component id="ViewBaseDataBinding" class="org.apache.flex.binding.ViewBaseDataBinding" lookupOnly="true" />
+ <component id="State" class="org.apache.flex.states.State" lookupOnly="true" />
+
+</componentPackage>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/js/src/org/apache/flex/flat/CheckBox.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/js/src/org/apache/flex/flat/CheckBox.js b/frameworks/projects/Flat/js/src/org/apache/flex/flat/CheckBox.js
new file mode 100644
index 0000000..d5d0a42
--- /dev/null
+++ b/frameworks/projects/Flat/js/src/org/apache/flex/flat/CheckBox.js
@@ -0,0 +1,137 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.flat.CheckBox');
+
+goog.require('org.apache.flex.core.UIBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.flat.CheckBox = function() {
+ org.apache.flex.flat.CheckBox.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.flat.CheckBox,
+ org.apache.flex.core.UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.flat.CheckBox.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'CheckBox',
+ qName: 'org.apache.flex.flat.CheckBox'}] };
+
+
+/**
+ * @override
+ */
+org.apache.flex.flat.CheckBox.prototype.createElement =
+ function() {
+ var cb;
+
+ this.element = document.createElement('label');
+
+ this.input = document.createElement('input');
+ this.input.type = 'checkbox';
+ this.input.className = 'checkbox-input';
+ this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
+ this.element.appendChild(this.input);
+
+ this.checkbox = document.createElement('span');
+ this.checkbox.className = 'checkbox-icon';
+ this.checkbox.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
+ this.checkbox.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
+ this.element.appendChild(this.checkbox);
+
+ this.textNode = document.createTextNode('');
+ this.element.appendChild(this.textNode);
+ this.element.className = 'CheckBox';
+ this.typeNames = 'CheckBox';
+
+ this.positioner = this.element;
+ this.input.flexjs_wrapper = this;
+ this.checkbox.flexjs_wrapper = this;
+ this.element.flexjs_wrapper = this;
+
+ return this.element;
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.CheckBox.prototype.mouseOverHandler =
+ function(e) {
+ this.checkbox.className = 'checkbox-icon-hover';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.CheckBox.prototype.mouseOutHandler =
+ function(e) {
+ if (this.input.checked)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.CheckBox.prototype.selectionChangeHandler =
+ function(e) {
+ if (this.input.checked)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
+};
+
+
+Object.defineProperties(org.apache.flex.flat.CheckBox.prototype, {
+ /** @export */
+ text: {
+ /** @this {org.apache.flex.flat.CheckBox} */
+ get: function() {
+ return this.textNode.nodeValue;
+ },
+ /** @this {org.apache.flex.flat.CheckBox} */
+ set: function(value) {
+ this.textNode.nodeValue = value;
+ }
+ },
+ /** @export */
+ selected: {
+ /** @this {org.apache.flex.flat.CheckBox} */
+ get: function() {
+ return this.input.checked;
+ },
+ /** @this {org.apache.flex.flat.CheckBox} */
+ set: function(value) {
+ this.input.checked = value;
+ if (value)
+ this.checkbox.className = 'checkbox-icon-checked';
+ else
+ this.checkbox.className = 'checkbox-icon';
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js b/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js
new file mode 100644
index 0000000..08cef2e
--- /dev/null
+++ b/frameworks/projects/Flat/js/src/org/apache/flex/flat/DropDownList.js
@@ -0,0 +1,219 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.flat.DropDownList');
+
+goog.require('org.apache.flex.core.ListBase');
+goog.require('org.apache.flex.html.beads.models.ArraySelectionModel');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.ListBase}
+ */
+org.apache.flex.flat.DropDownList = function() {
+ org.apache.flex.flat.DropDownList.base(this, 'constructor');
+ this.model = new org.apache.flex.html.beads.models.ArraySelectionModel();
+};
+goog.inherits(org.apache.flex.flat.DropDownList,
+ org.apache.flex.core.ListBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.flat.DropDownList.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'DropDownList',
+ qName: 'org.apache.flex.flat.DropDownList'}] };
+
+
+/**
+ * @override
+ */
+org.apache.flex.flat.DropDownList.prototype.createElement =
+ function() {
+ var button, input;
+
+ this.element = document.createElement('div');
+
+ this.button = button = document.createElement('button');
+ button.className = 'dropdown-toggle-open-btn';
+ goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this));
+ this.element.appendChild(button);
+
+ var caret = document.createElement('span');
+ caret.className = 'dropdown-caret';
+
+ this.element.style.position = 'relative';
+
+ this.positioner = this.element;
+
+ // add a click handler so that a click outside of the combo box can
+ // dismiss the pop-up should it be visible.
+ goog.events.listen(document, 'click',
+ goog.bind(this.dismissPopup, this));
+
+ button.flexjs_wrapper = this;
+ this.element.flexjs_wrapper = this;
+ caret.flexjs_wrapper = this;
+
+ return this.element;
+};
+
+
+/**
+ * @export
+ * @param {Object} event The event.
+ */
+org.apache.flex.flat.DropDownList.prototype.selectChanged =
+ function(event) {
+ var select;
+
+ select = event.target;
+
+ this.selectedIndex = parseInt(select.id, 10);
+
+ this.menu.parentNode.removeChild(this.menu);
+ this.menu = null;
+
+ this.dispatchEvent('change');
+};
+
+
+/**
+ * @export
+ * @param {Object=} opt_event The event.
+ */
+org.apache.flex.flat.DropDownList.prototype.dismissPopup =
+ function(opt_event) {
+ // remove the popup if it already exists
+ if (this.menu) {
+ this.menu.parentNode.removeChild(this.menu);
+ this.menu = null;
+ }
+};
+
+
+/**
+ * @export
+ * @param {Object} event The event.
+ */
+org.apache.flex.flat.DropDownList.prototype.buttonClicked =
+ function(event) {
+ /**
+ * @type {Array.<string>}
+ */
+ var dp;
+ var i, button, left, n, opt, opts, pn, popup, select, si, top, width;
+
+ event.stopPropagation();
+
+ if (this.popup) {
+ this.dismissPopup();
+
+ return;
+ }
+
+ button = this.element.childNodes.item(0);
+
+ pn = this.element;
+ top = pn.offsetTop + button.offsetHeight;
+ left = pn.offsetLeft;
+ width = pn.offsetWidth;
+
+ /*
+ popup = document.createElement('div');
+ popup.className = 'dropdown-menu';
+ popup.id = 'test';
+ popup.style.position = 'absolute';
+ popup.style.top = top.toString() + 'px';
+ popup.style.left = left.toString() + 'px';
+ popup.style.width = width.toString() + 'px';
+ popup.style.margin = '0px auto';
+ popup.style.padding = '0px';
+ popup.style.zIndex = '10000';
+ */
+
+ this.menu = select = document.createElement('ul');
+ select.style.width = width.toString() + 'px';
+ goog.events.listen(select, 'click', goog.bind(this.selectChanged, this));
+ select.className = 'dropdown-menu';
+
+ dp = /** @type {Array.<string>} */ (this.dataProvider);
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('li');
+ opt.style.backgroundColor = 'transparent';
+ var ir = document.createElement('a');
+ ir.innerHTML = dp[i];
+ ir.id = i.toString();
+ if (i == this.selectedIndex)
+ ir.className = 'dropdown-menu-item-renderer-selected';
+ else
+ ir.className = 'dropdown-menu-item-renderer';
+ opt.appendChild(ir);
+ select.appendChild(opt);
+ }
+
+ this.element.appendChild(select);
+};
+
+
+Object.defineProperties(org.apache.flex.flat.DropDownList.prototype, {
+ dataProvider: {
+ /** @this {org.apache.flex.flat.DropDownList} */
+ get: function() {
+ return this.model.dataProvider;
+ },
+ /** @this {org.apache.flex.flat.DropDownList} */
+ set: function(value) {
+ var dp, i, n, opt;
+
+ this.model.dataProvider = value;
+ }
+ },
+ /** @export */
+ selectedIndex: {
+ // TODO: (aharui) copied from ListBase because you
+ // can't just override the setter in a defineProps
+ // structure.
+ /** @this {org.apache.flex.flat.DropDownList} */
+ get: function() {
+ return this.model.selectedIndex;
+ },
+ /** @this {org.apache.flex.flat.DropDownList} */
+ set: function(value) {
+ this.model.selectedIndex = value;
+ this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
+ }
+ },
+ /** @export */
+ selectedItem: {
+ // TODO: (aharui) copied from ListBase because you
+ // can't just override the setter in a defineProps
+ // structure.
+ /** @this {org.apache.flex.flat.DropDownList} */
+ get: function() {
+ return this.model.selectedItem;
+ },
+ /** @this {org.apache.flex.flat.DropDownList} */
+ set: function(value) {
+ this.model.selectedItem = value;
+ this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/Flat/js/src/org/apache/flex/flat/RadioButton.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/js/src/org/apache/flex/flat/RadioButton.js b/frameworks/projects/Flat/js/src/org/apache/flex/flat/RadioButton.js
new file mode 100644
index 0000000..461f7f9
--- /dev/null
+++ b/frameworks/projects/Flat/js/src/org/apache/flex/flat/RadioButton.js
@@ -0,0 +1,227 @@
+/**
+ * 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.
+ */
+
+goog.provide('org.apache.flex.flat.RadioButton');
+
+goog.require('org.apache.flex.core.UIBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.flat.RadioButton = function() {
+ org.apache.flex.flat.RadioButton.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.flat.RadioButton,
+ org.apache.flex.core.UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.flat.RadioButton.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'RadioButton',
+ qName: 'org.apache.flex.flat.RadioButton'}] };
+
+
+/**
+ * Provides unique name
+ */
+org.apache.flex.flat.RadioButton.radioCounter = 0;
+
+
+/**
+ * @override
+ */
+org.apache.flex.flat.RadioButton.prototype.createElement =
+ function() {
+
+ // hide this eleement
+ this.input = document.createElement('input');
+ this.input.type = 'radio';
+ this.input.className = 'radio-input';
+ this.input.id = '_radio_' + org.apache.flex.flat.RadioButton.radioCounter++;
+ this.input.addEventListener('change', goog.bind(this.selectionChangeHandler, this));
+
+ this.radio = document.createElement('span');
+ this.radio.className = 'radio-icon';
+ this.radio.addEventListener('mouseover', goog.bind(this.mouseOverHandler, this));
+ this.radio.addEventListener('mouseout', goog.bind(this.mouseOutHandler, this));
+
+ this.textNode = document.createTextNode('radio button');
+
+ this.labelFor = document.createElement('label');
+ this.labelFor.appendChild(this.input);
+ this.labelFor.appendChild(this.radio);
+ this.labelFor.appendChild(this.textNode);
+ this.labelFor.style.position = 'relative';
+
+ this.element = this.labelFor;
+ this.element.className = 'RadioButton';
+ this.typeNames = 'RadioButton';
+
+ this.positioner = this.element;
+ this.input.flexjs_wrapper = this;
+ this.radio.flexjs_wrapper = this;
+ this.element.flexjs_wrapper = this;
+ this.textNode.flexjs_wrapper = this;
+
+ return this.element;
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.RadioButton.prototype.mouseOverHandler =
+ function(e) {
+ this.radio.className = 'radio-icon-hover';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.RadioButton.prototype.mouseOutHandler =
+ function(e) {
+ if (this.input.checked)
+ this.radio.className = 'radio-icon-checked';
+ else
+ this.radio.className = 'radio-icon';
+};
+
+
+/**
+ * @param {Event} e The event object.
+ */
+org.apache.flex.flat.RadioButton.prototype.selectionChangeHandler =
+ function(e) {
+ // this should reset the icons in the non-selected radio
+ this.selectedValue = this.value;
+};
+
+
+/**
+ * @export
+ */
+org.apache.flex.flat.RadioButton.prototype.initModel =
+ function() {
+};
+
+
+/**
+ * @export
+ */
+org.apache.flex.flat.RadioButton.prototype.initSkin =
+ function() {
+};
+
+
+Object.defineProperties(org.apache.flex.flat.RadioButton.prototype, {
+ /** @export */
+ id: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ org.apache.flex.utils.Language.superSetter(org.apache.flex.flat.RadioButton, this, 'id', value);
+ this.labelFor.id = value;
+ this.input.id = value;
+ }
+ },
+ /** @export */
+ groupName: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ get: function() {
+ return this.input.name;
+ },
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ this.input.name = value;
+ }
+ },
+ /** @export */
+ text: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ get: function() {
+ return this.textNode.nodeValue;
+ },
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ this.textNode.nodeValue = value;
+ }
+ },
+ /** @export */
+ selected: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ get: function() {
+ return this.input.checked;
+ },
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ this.input.checked = value;
+ if (this.input.checked)
+ this.radio.className = 'radio-icon-checked';
+ else
+ this.radio.className = 'radio-icon';
+ }
+ },
+ /** @export */
+ value: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ get: function() {
+ return this.input.value;
+ },
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ this.input.value = value;
+ }
+ },
+ /** @export */
+ selectedValue: {
+ /** @this {org.apache.flex.flat.RadioButton} */
+ get: function() {
+ var buttons, groupName, i, n;
+
+ groupName = this.input.name;
+ buttons = document.getElementsByName(groupName);
+ n = buttons.length;
+
+ for (i = 0; i < n; i++) {
+ if (buttons[i].checked) {
+ return buttons[i].value;
+ }
+ }
+ return null;
+ },
+ /** @this {org.apache.flex.flat.RadioButton} */
+ set: function(value) {
+ var buttons, groupName, i, n;
+
+ groupName = this.input.name;
+ buttons = document.getElementsByName(groupName);
+ n = buttons.length;
+ for (i = 0; i < n; i++) {
+ if (buttons[i].value === value) {
+ buttons[i].checked = true;
+ buttons[i].flexjs_wrapper.selected = true;
+ }
+ else
+ buttons[i].flexjs_wrapper.selected = false;
+ }
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 0344efc..91ed55a 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -517,7 +517,7 @@ Button
CheckBox
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CheckboxCSSContentAndTextToggleButtonView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CheckBoxView");
}
CloseButton
@@ -563,7 +563,7 @@ DropDownListList
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.DropDownListStringItemRenderer");
+ IItemRenderer: ClassReference("org.apache.flex.html.supportClasses.StringItemRenderer");
}
Image
@@ -631,7 +631,7 @@ PanelWithControlBar
RadioButton
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.RadioCSSContentAndTextToggleButtonView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.RadioButtonView");
}
.vscrollbar-uparrow {
@@ -724,7 +724,7 @@ ScrollBar
{
IBeadLayout: ClassReference("org.apache.flex.html.beads.layouts.VScrollBarLayout");
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ScrollBarModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CSSScrollBarView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.ScrollBarView");
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.VScrollBarMouseController");
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/HTMLClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/HTMLClasses.as b/frameworks/projects/HTML/as/src/HTMLClasses.as
index b1bf557..e8b2165 100644
--- a/frameworks/projects/HTML/as/src/HTMLClasses.as
+++ b/frameworks/projects/HTML/as/src/HTMLClasses.as
@@ -52,9 +52,7 @@ internal class HTMLClasses
import org.apache.flex.html.beads.PanelView; PanelView;
import org.apache.flex.html.beads.PanelWithControlBarView; PanelWithControlBarView;
import org.apache.flex.html.beads.RadioButtonView; RadioButtonView;
- import org.apache.flex.html.beads.CSSScrollBarView; CSSScrollBarView;
import org.apache.flex.html.beads.ScrollBarView; ScrollBarView;
- import org.apache.flex.html.beads.CSSScrollBarButtonView; CSSScrollBarButtonView;
import org.apache.flex.html.beads.SimpleAlertView; SimpleAlertView;
import org.apache.flex.html.beads.SingleLineBorderBead; SingleLineBorderBead;
import org.apache.flex.html.beads.SliderView; SliderView;
@@ -98,7 +96,6 @@ internal class HTMLClasses
import org.apache.flex.html.beads.layouts.TileLayout; TileLayout;
import org.apache.flex.html.beads.TextItemRendererFactoryForArrayData; TextItemRendererFactoryForArrayData;
import org.apache.flex.html.beads.DataItemRendererFactoryForArrayData; DataItemRendererFactoryForArrayData;
- import org.apache.flex.html.supportClasses.DropDownListStringItemRenderer; DropDownListStringItemRenderer;
import org.apache.flex.html.supportClasses.DataGroup; DataGroup;
import org.apache.flex.html.supportClasses.Viewport; Viewport;
import org.apache.flex.html.supportClasses.ScrollingViewport; ScrollingViewport;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
deleted file mode 100644
index 40bb0c9..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
+++ /dev/null
@@ -1,304 +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.html.beads
-{
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IToggleButtonModel;
- import org.apache.flex.core.StyleableCSSTextField;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.utils.CSSUtils;
-
- /**
- * The CSSContentAndTextToggleButtonView class is the default view for
- * the org.apache.flex.html.CheckBox and RadioButton classes.
- * It supports CSS content property for the
- * icon.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSContentAndTextToggleButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * map of classname suffixes.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private static var suffixMap:Object = {
- "upSprite": "",
- "downSprite": "-checked",
- "overSprite": "-hover",
- "upAndSelectedSprite": "-checked",
- "downAndSelectedSprite": "-checked",
- "overAndSelectedSprite": "-checked"
- }
-
- /**
- * className to use for styling.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected var className:String;
-
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSContentAndTextToggleButtonView()
- {
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- private var upAndSelectedSprite:Sprite;
- private var downAndSelectedSprite:Sprite;
- private var overAndSelectedSprite:Sprite;
-
- private var sprites:Array = [];
-
- private var _toggleButtonModel:IToggleButtonModel;
-
- // TODO: Can we remove this?
- private function get toggleButtonModel() : IToggleButtonModel
- {
- return _toggleButtonModel;
- }
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
-
- for (var p:String in suffixMap)
- {
- var s:Sprite = new Sprite();
- sprites.push(s);
- this[p] = s;
-
- var tf:CSSTextField = new CSSTextField();
- tf.type = TextFieldType.DYNAMIC;
- tf.autoSize = TextFieldAutoSize.LEFT;
- tf.name = "textField";
- tf.parentHandlesPadding = true;
- var icon:StyleableCSSTextField = new StyleableCSSTextField();
- icon.name = "icon";
- icon.className = className + suffixMap[p];
- s.addChild(icon);
- s.addChild(tf);
- }
-
- _toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
- _toggleButtonModel.addEventListener("textChange", textChangeHandler);
- _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
- _toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
- if (_toggleButtonModel.text !== null)
- text = _toggleButtonModel.text;
-
- layoutControl();
-
- var hitArea:Shape = new Shape();
- hitArea.graphics.beginFill(0x000000);
- hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
- hitArea.graphics.endFill();
-
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = hitArea;
-
- if (toggleButtonModel.text !== null)
- text = toggleButtonModel.text;
- if (toggleButtonModel.html !== null)
- html = toggleButtonModel.html;
- }
-
- /**
- * @copy org.apache.flex.html.Label#text
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get text():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.text;
- }
-
- /**
- * @private
- */
- public function set text(value:String):void
- {
- for each( var s:Sprite in sprites )
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.styleParent = _strand;
- tf.text = value;
- }
-
- layoutControl();
- }
-
- /**
- * @copy org.apache.flex.html.Label#html
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get html():String
- {
- var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
- return tf.htmlText;
- }
-
- /**
- * @private
- */
- public function set html(value:String):void
- {
- for each(var s:Sprite in sprites)
- {
- var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
- tf.htmlText = value;
- }
-
- layoutControl();
- }
-
- private function textChangeHandler(event:Event):void
- {
- text = toggleButtonModel.text;
- }
-
- private function htmlChangeHandler(event:Event):void
- {
- html = toggleButtonModel.html;
- }
-
- private var _selected:Boolean;
-
- /**
- * @copy org.apache.flex.core.IToggleButtonModel#selected
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get selected():Boolean
- {
- return _selected;
- }
-
- /**
- * @private
- */
- public function set selected(value:Boolean):void
- {
- _selected = value;
-
- layoutControl();
-
- if( value ) {
- SimpleButton(_strand).upState = upAndSelectedSprite;
- SimpleButton(_strand).downState = downAndSelectedSprite;
- SimpleButton(_strand).overState = overAndSelectedSprite;
-
- } else {
- SimpleButton(_strand).upState = upSprite;
- SimpleButton(_strand).downState = downSprite;
- SimpleButton(_strand).overState = overSprite;
- }
- }
-
- private function selectedChangeHandler(event:Event):void
- {
- selected = toggleButtonModel.selected;
- }
-
- /**
- * Display the icon and text label
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- protected function layoutControl() : void
- {
- // TODO: Layout using descendant selectors (.checkbox .icons)
- for (var p:String in suffixMap)
- {
- var s:Sprite = this[p];
- var icon:StyleableCSSTextField = s.getChildByName("icon") as StyleableCSSTextField;
- icon.autoSize = TextFieldAutoSize.LEFT;
- var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
-
- icon.CSSParent = _strand;
- var content:String = ValuesManager.valuesImpl.getValue(icon, "content", "before");
- if (content != null)
- icon.text = content;
- var mh:Number = Math.max(icon.height,tf.height);
-
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left");
- icon.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
- icon.y = (mh - icon.height)/2;
-
- tf.x = icon.x + icon.width + 1;
- tf.y = (mh - tf.height)/2;
- }
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.as
deleted file mode 100644
index aa3d25e..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarButtonView.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.html.beads
-{
- import flash.display.DisplayObject;
- import flash.display.Loader;
- import flash.display.Shape;
- import flash.display.SimpleButton;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.net.URLRequest;
-
- import org.apache.flex.core.BeadViewBase;
- import org.apache.flex.core.CSSShape;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ITextModel;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.utils.CSSBorderUtils;
- import org.apache.flex.utils.CSSUtils;
- import org.apache.flex.utils.StringTrimmer;
-
- /**
- * The CSSButtonView class is the default view for
- * the org.apache.flex.html.Button class.
- * It allows the look of the button to be expressed
- * in CSS via the background-image style. This view
- * does not display text. Use CSSTextButtonView and
- * TextButton instead.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSScrollBarButtonView extends BeadViewBase implements IBeadView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSScrollBarButtonView()
- {
- upSprite = new Sprite();
- downSprite = new Sprite();
- overSprite = new Sprite();
- upArrowShape = new CSSShape();
- downArrowShape = new CSSShape();
- overArrowShape = new CSSShape();
- overArrowShape.state = "hover";
- upSprite.addChild(upArrowShape);
- downSprite.addChild(downArrowShape);
- overSprite.addChild(overArrowShape);
- }
-
- private var textModel:ITextModel;
-
- private var shape:Shape;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set strand(value:IStrand):void
- {
- super.strand = value;
- shape = new Shape();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, 10, 10);
- shape.graphics.endFill();
- SimpleButton(value).upState = upSprite;
- SimpleButton(value).downState = downSprite;
- SimpleButton(value).overState = overSprite;
- SimpleButton(value).hitTestState = shape;
-
- setupBackground(overSprite, overArrowShape, "hover");
- setupBackground(downSprite, downArrowShape, "active");
- setupBackground(upSprite, upArrowShape);
-
- IEventDispatcher(_strand).addEventListener("widthChanged",sizeChangeHandler);
- IEventDispatcher(_strand).addEventListener("heightChanged",sizeChangeHandler);
- }
-
- private function sizeChangeHandler(event:org.apache.flex.events.Event):void
- {
- setupSkins();
- }
-
- protected function setupSkins():void
- {
- setupSkin(overSprite, overArrowShape, "hover");
- setupSkin(downSprite, downArrowShape, "active");
- setupSkin(upSprite, upArrowShape);
- updateHitArea();
- }
-
- private function setupSkin(sprite:Sprite, shape:CSSShape, state:String = null):void
- {
- var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
- var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-left", state);
- var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-right", state);
- var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-top", state);
- var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand, "padding-bottom", state);
- var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, DisplayObject(_strand).width);
- var pr:Number = CSSUtils.getRightValue(paddingRight, padding, DisplayObject(_strand).width);
- var pt:Number = CSSUtils.getTopValue(paddingTop, padding, DisplayObject(_strand).height);
- var pb:Number = CSSUtils.getBottomValue(paddingBottom, padding, DisplayObject(_strand).height);
-
- var w:Object = ValuesManager.valuesImpl.getValue(shape, "width", state);
- var h:Object = ValuesManager.valuesImpl.getValue(shape, "height", state);
- shape.draw(Number(w), Number(h));
-
- CSSBorderUtils.draw(sprite.graphics,
- shape.width + pl + pr,
- shape.height + pt + pb,
- _strand as DisplayObject,
- state, true);
- }
-
- private function setupBackground(sprite:Sprite, shape:CSSShape, state:String = null):void
- {
- var backgroundImage:Object = ValuesManager.valuesImpl.getValue(_strand, "background-image", state);
- if (backgroundImage)
- {
- var loader:Loader = new Loader();
- sprite.addChildAt(loader, 0);
- var url:String = backgroundImage as String;
- loader.load(new URLRequest(url));
- loader.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, function (e:flash.events.Event):void {
- setupSkin(sprite, shape, state);
- updateHitArea();
- });
- }
- else {
- setupSkin(sprite, shape, state);
- updateHitArea();
- }
- }
-
- private var upSprite:Sprite;
- private var downSprite:Sprite;
- private var overSprite:Sprite;
- public var upArrowShape:CSSShape;
- public var downArrowShape:CSSShape;
- public var overArrowShape:CSSShape;
-
- private function updateHitArea():void
- {
- shape.graphics.clear();
- shape.graphics.beginFill(0xCCCCCC);
- shape.graphics.drawRect(0, 0, upSprite.width, upSprite.height);
- shape.graphics.endFill();
-
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
deleted file mode 100644
index 0d48de8..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSScrollBarView.as
+++ /dev/null
@@ -1,240 +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.html.beads
-{
- import flash.display.DisplayObject;
-
- import org.apache.flex.core.IBead;
- import org.apache.flex.core.IBeadLayout;
- import org.apache.flex.core.IBeadView;
- import org.apache.flex.core.IScrollBarModel;
- import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IUIBase;
- import org.apache.flex.core.Strand;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.Button;
- import org.apache.flex.html.beads.controllers.ButtonAutoRepeatController;
-
- /**
- * The ScrollBarView class is the default view for
- * the org.apache.flex.html.supportClasses.ScrollBar class.
- * It implements the classic desktop-like ScrollBar.
- * A different view would implement more modern scrollbars that hide themselves
- * until hovered over with the mouse.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CSSScrollBarView extends Strand implements IBeadView, IStrand, IScrollBarView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CSSScrollBarView()
- {
- }
-
- private var sbModel:IScrollBarModel;
-
- private var _strand:IStrand;
-
- /**
- * The layout.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- private var layout:IBeadLayout;
-
- /**
- * The host component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get host():IUIBase
- {
- return _strand as IUIBase;
- }
-
- /**
- * @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;
-
- for each (var bead:IBead in beads)
- addBead(bead);
-
- sbModel = value.getBeadByType(IScrollBarModel) as IScrollBarModel;
- sbModel = _strand.getBeadByType(IScrollBarModel) as IScrollBarModel;
- sbModel.addEventListener("maximumChange", changeHandler);
- sbModel.addEventListener("minimumChange", changeHandler);
- sbModel.addEventListener("snapIntervalChange", changeHandler);
- sbModel.addEventListener("stepSizeChange", changeHandler);
- sbModel.addEventListener("pageSizeChange", changeHandler);
- sbModel.addEventListener("valueChange", changeHandler);
-
- // TODO: (aharui) put in values impl
- _increment = new Button();
- Button(_increment).className = "vscrollbar-downarrow-btn";
- var sbView:CSSScrollBarButtonView = new CSSScrollBarButtonView();
- sbView.upArrowShape.className = "vscrollbar-downarrow";
- sbView.downArrowShape.className = "vscrollbar-downarrow";
- sbView.overArrowShape.className = "vscrollbar-downarrow";
- Button(_increment).addBead(sbView);
- Button(_increment).addBead(new ButtonAutoRepeatController());
- _decrement = new Button();
- Button(_decrement).className = "vscrollbar-uparrow-btn";
- sbView = new CSSScrollBarButtonView();
- sbView.upArrowShape.className = "vscrollbar-uparrow";
- sbView.downArrowShape.className = "vscrollbar-uparrow";
- sbView.overArrowShape.className = "vscrollbar-uparrow";
- Button(_decrement).addBead(sbView);
- Button(_decrement).addBead(new ButtonAutoRepeatController());
- _track = new Button();
- Button(_track).className = "vscrollbar-track";
- _thumb = new Button();
- Button(_thumb).className = "vscrollbar-thumb";
-
- UIBase(value).addElement(_decrement);
- UIBase(value).addElement(_increment);
- UIBase(value).addElement(_track);
- UIBase(value).addElement(_thumb);
-
- IEventDispatcher(_strand).addEventListener("heightChanged", changeHandler);
-
- if( _strand.getBeadByType(IBeadLayout) == null ) {
- layout = new (ValuesManager.valuesImpl.getValue(_strand, "iBeadLayout")) as IBeadLayout;
- _strand.addBead(layout);
- }
- layout.layout();
- }
-
- private function changeHandler(event:Event):void
- {
- layout.layout();
- }
-
- private var _decrement:DisplayObject;
- private var _increment:DisplayObject;
- private var _track:DisplayObject;
- private var _thumb:DisplayObject;
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#decrement
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get decrement():DisplayObject
- {
- return _decrement;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#increment
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get increment():DisplayObject
- {
- return _increment;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#track
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get track():DisplayObject
- {
- return _track;
- }
-
- /**
- * @copy org.apache.flex.html.beads.IScrollBarView#thumb
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get thumb():DisplayObject
- {
- return _thumb;
- }
-
- /**
- * @copy org.apache.flex.core.IBeadView#viewHeight
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get viewHeight():Number
- {
- // don't want to put $height in an interface
- return _strand["$height"];
- }
-
- /**
- * @copy org.apache.flex.core.IBeadView#viewWidth
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function get viewWidth():Number
- {
- // don't want to put $width in an interface
- return _strand["$width"];
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
deleted file mode 100644
index e38fd0d..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CheckboxCSSContentAndTextToggleButtonView.as
+++ /dev/null
@@ -1,48 +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.html.beads
-{
-
- /**
- * The CheckboxCSSContentAndTextToggleButtonView class is the default view for
- * the org.apache.flex.html.Checkbox class.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class CheckboxCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function CheckboxCSSContentAndTextToggleButtonView()
- {
- super();
-
- className = "checkbox-icon";
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
deleted file mode 100644
index 8d99f32..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/RadioCSSContentAndTextToggleButtonView.as
+++ /dev/null
@@ -1,47 +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.html.beads
-{
- /**
- * The RadioCSSContentAndTextToggleButtonView class is the default view for
- * the org.apache.flex.html.RadioButton class.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class RadioCSSContentAndTextToggleButtonView extends CSSContentAndTextToggleButtonView
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function RadioCSSContentAndTextToggleButtonView()
- {
- super();
-
- className = "radio-icon";
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
deleted file mode 100644
index e1a95d5..0000000
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/supportClasses/DropDownListStringItemRenderer.as
+++ /dev/null
@@ -1,70 +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.html.supportClasses
-{
- import flash.text.TextFieldAutoSize;
- import flash.text.TextFieldType;
-
- import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.ValuesManager;
- import org.apache.flex.events.Event;
- import org.apache.flex.html.beads.ITextItemRenderer;
-
- /**
- * The DropDownListStringItemRenderer is a StringItemRenderer with a particular
- * className for use in DropDownList.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class DropDownListStringItemRenderer extends StringItemRenderer
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function DropDownListStringItemRenderer()
- {
- super();
-
- className = 'dropdown-menu-item-renderer';
- percentWidth = 90;
- }
-
- /**
- * @private
- */
- override public function updateRenderer():void
- {
- className = selected ? 'dropdown-menu-item-renderer-selected' : 'dropdown-menu-item-renderer';
- if (selected)
- selectedColor = ValuesManager.valuesImpl.getValue(this, 'background-color');
- if (hovered)
- highlightColor = ValuesManager.valuesImpl.getValue(this, 'background-color', "hover");
- downColor = selectedColor;
- super.updateRenderer();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5c6408ce/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml b/frameworks/projects/HTML/basic-manifest.xml
index 9066637..1591aed 100644
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ b/frameworks/projects/HTML/basic-manifest.xml
@@ -74,8 +74,6 @@
<component id="HRule" class="org.apache.flex.html.HRule" />
<component id="Spacer" class="org.apache.flex.html.Spacer" />
<component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
- <component id="CheckboxCSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.CheckboxCSSContentAndTextToggleButtonView"/>
- <component id="RadioCSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.RadioCSSContentAndTextToggleButtonView"/>
<component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" />
<component id="DataGrid" class="org.apache.flex.html.DataGrid"/>
[15/36] git commit: [flex-asjs] [refs/heads/develop] - add font files
to build scripts
Posted by ah...@apache.org.
add font files to build scripts
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/44ebb493
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/44ebb493
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/44ebb493
Branch: refs/heads/develop
Commit: 44ebb493b497a6f745838978b7112b00f1abac33
Parents: a2c39e7
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 13:00:51 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 13:00:51 2015 -0700
----------------------------------------------------------------------
examples/build_example.xml | 5 ++
frameworks/build.xml | 7 ++-
frameworks/downloads.xml | 44 ++++++++++++-
frameworks/fontsrc/FlatUIIcons.as | 24 +++++++
frameworks/fontsrc/build.xml | 91 +++++++++++++++++++++++++++
frameworks/projects/HTML/as/defaults.css | 4 +-
6 files changed, 170 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index c3ab330..a8a5973 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -61,6 +61,11 @@
<include name="**/*.jpg" />
</fileset>
</copy>
+ <copy todir="${basedir}/bin-debug/fonts">
+ <fileset dir="${FLEX_HOME}/frameworks/fonts">
+ <include name="**/*.swf" />
+ </fileset>
+ </copy>
</target>
<target name="compileair" description="Compiles ${example}">
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index 70ffa3e..0dafc4e 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -60,7 +60,7 @@
<property file="${FLEXJS_HOME}/build.properties"/>
<property name="FLEX_HOME" value="${FLEXJS_HOME}" />
- <target name="main" depends="check-compile-env,clean,prepare,compile"
+ <target name="main" depends="check-compile-env,clean,prepare,compile,fonts"
description="Clean build of all SWCs"/>
<target name="check-compile-env" description="Check for the required environment variables">
@@ -150,6 +150,10 @@
<target name="js" depends="compile-asjs, lint-js" />
+ <target name="fonts">
+ <ant dir="${basedir}/fontsrc" target="main"/>
+ </target>
+
<target name="other.locales" description ="Builds resource SWCs for all locales">
<!--<ant dir="${basedir}/projects/FlexJSUI" target="other.locales"/>-->
</target>
@@ -185,6 +189,7 @@
<ant dir="${basedir}/projects/JQuery" target="clean"/>
<ant dir="${basedir}/projects/Mobile" target="clean"/>
<ant dir="${basedir}/projects/Network" target="clean"/>
+ <ant dir="${basedir}/fontsrc" target="clean"/>
<!-- delete the FlashBuilder executable directories -->
<delete includeemptydirs="true" failonerror="false">
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/downloads.xml
----------------------------------------------------------------------
diff --git a/frameworks/downloads.xml b/frameworks/downloads.xml
index 77b99b2..0a3ee07 100644
--- a/frameworks/downloads.xml
+++ b/frameworks/downloads.xml
@@ -32,12 +32,12 @@
clean does not remove these since they don't change often and the downloads take time.
-->
<target name="main"
- depends="swfobject-download"
+ depends="swfobject-download,flat-ui-download"
description="Copies third-party software into place for build">
<echo message="Use thirdparty-clean or super-clean to remove these."/>
</target>
- <target name="clean" depends="swfobject-clean"
+ <target name="clean" depends="swfobject-clean,flat-ui-clean"
description="Cleans thirdparty downloaded files.">
</target>
@@ -77,4 +77,44 @@
</delete>
</target>
+ <!-- swfobject.js (Version 2.2) -->
+ <!-- Because this requires a network connection it downloads SWFObject only if it doesn't already exist. -->
+ <target name="flat-ui-check" description="Checks if SWFObject has been downloaded.">
+ <available file="${FLEXJS_HOME}/frameworks/fonts/flat-ui-icons-regular.ttf" property="flat-ui.present"/>
+ </target>
+
+ <target name="flat-ui-download" depends="flat-ui-check" unless="flat-ui.present"
+ description="Copies FlatUI from github">
+
+ <mkdir dir="${download.dir}"/>
+ <get src="https://github.com/designmodo/Flat-UI/archive/2.2.2.zip"
+ dest="${download.dir}/flat-ui_2_2.zip"
+ verbose="false"/>
+
+ <mkdir dir="${FLEXJS_HOME}/frameworks/fonts"/>
+ <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts">
+ <patternset>
+ <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.eot"/>
+ <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.ttf"/>
+ <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.svg"/>
+ <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.woff"/>
+ </patternset>
+ <flattenmapper />
+ </unzip>
+ <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts">
+ <patternset>
+ <include name="Flat-UI-2.2.2/README.md"/>
+ </patternset>
+ <flattenmapper />
+ </unzip>
+ </target>
+
+ <target name="flat-ui-clean" description="Deletes flat-ui fonts.">
+ <delete failonerror="false">
+ <fileset dir="${FLEXJS_HOME}/frameworks/fonts">
+ <include name="**"/>
+ </fileset>
+ </delete>
+ </target>
+
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/fontsrc/FlatUIIcons.as
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/FlatUIIcons.as b/frameworks/fontsrc/FlatUIIcons.as
new file mode 100644
index 0000000..014899e
--- /dev/null
+++ b/frameworks/fontsrc/FlatUIIcons.as
@@ -0,0 +1,24 @@
+package
+{
+import flash.display.Sprite;
+import flash.text.Font;
+
+public class FlatUIIcons extends Sprite
+{
+ /*
+ * Embed a font with bold typeface by location.
+ */
+ [Embed(source='../fonts/flat-ui-icons-regular.ttf',
+ fontWeight='normal',
+ fontName='Flat-UI-Icons',
+ mimeType='application/x-font',
+ embedAsCFF='false'
+ )]
+ private var font2:Class;
+
+ public function FlatUIIcons()
+ {
+ Font.registerFont(font2);
+ }
+}
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/fontsrc/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/build.xml b/frameworks/fontsrc/build.xml
new file mode 100644
index 0000000..149021f
--- /dev/null
+++ b/frameworks/fontsrc/build.xml
@@ -0,0 +1,91 @@
+<?xml version="1.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.
+
+-->
+
+<!-- Note:
+ If you modify this file you may have to make the same change in build_framework.xml.
+ build_framework.xml is renamed to build.xml when it is packaged.
+ It is used to build the frameworks directory from the zip file.
+-->
+<project name="fonts" default="main" basedir=".">
+
+ <property name="FLEXJS_HOME" location="../.."/>
+
+ <!-- Required for OSX 10.6 / Snow Leopard Performance. -->
+ <!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
+ <!-- local.d32 is set/used in build.properties so this needs to be done first. -->
+ <condition property="local.d32" value="-d32">
+ <and>
+ <os family="mac"/>
+ <matches pattern="1.6.*" string="${java.version}"/>
+ <equals arg1="${sun.arch.data.model}" arg2="64"/>
+ <equals arg1="${os.arch}" arg2="x86_64"/>
+ </and>
+ </condition>
+
+ <!-- Property for the platform. -->
+ <condition property="isMac">
+ <os family="mac"/>
+ </condition>
+ <condition property="isWindows">
+ <os family="windows" />
+ </condition>
+ <condition property="isLinux">
+ <and>
+ <os family="unix"/>
+ <not>
+ <os family="mac"/>
+ </not>
+ </and>
+ </condition>
+
+ <property file="${FLEXJS_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${FLEXJS_HOME}/build.properties"/>
+
+ <target name="main" depends="check-compile-env,compile"
+ description="Create font swfs"/>
+
+ <target name="check-compile-env" description="Check for the required environment variables">
+ <ant antfile="${FLEXJS_HOME}/build.xml" target="check-compile-env" dir="${FLEXJS_HOME}"/>
+ </target>
+
+ <target name="compile" depends="prepare" description="Builds all font swfs">
+ <!-- order may matter due to dependencies -->
+ <antcall target="flat-ui-icons"/>
+ </target>
+
+ <target name="flat-ui-icons" description="build flat-ui-icons-regular.swf">
+ <java fork="true"
+ jar="${FLEX_SDK_HOME}/lib/mxmlc.jar">
+ <jvmarg line="${mxmlc.jvm.args}"/>
+ <arg value="+flexlib=${FLEX_SDK_HOME}/frameworks" />
+ <arg value="-output=${basedir}/../fonts/flat-ui-icons-regular.swf" />
+ <arg value="${basedir}/FlatUIIcons.as" />
+ </java>
+ </target>
+
+ <target name="prepare">
+ <property name="FLEX_SDK_HOME" value="${env.FLEX_HOME}" />
+ </target>
+
+ <target name="clean">
+ <delete file="${basedir}/../fonts/flat-ui-icons-regular.swf" />
+ </target>
+</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index cd9389c..c34fea3 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -23,8 +23,8 @@
@font-face {
font-family: 'Flat-UI-Icons';
- src: url('../fonts/glyphicons/flat-ui-icons-regular.eot');
- src: url('../fonts/glyphicons/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons/flat-ui-icons-regular.woff') format('woff'), url('../fonts/glyphicons/flat-ui-icons-regular.ttf') format('truetype'), url('../fonts/glyphicons/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
+ src: url('fonts/flat-ui-icons-regular.eot');
+ src: url('fonts/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('fonts/flat-ui-icons-regular.woff') format('woff'), url('fonts/flat-ui-icons-regular.ttf') format('truetype'), url('fonts/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
}
/* Global style declaration */
[11/36] git commit: [flex-asjs] [refs/heads/develop] - pick up styles
Posted by ah...@apache.org.
pick up styles
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/619796dc
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/619796dc
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/619796dc
Branch: refs/heads/develop
Commit: 619796dc3a8ef55b0704485411ff18d70a7da8ee
Parents: 334c1e9
Author: Alex Harui <ah...@apache.org>
Authored: Thu Jul 16 13:45:15 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Jul 16 13:45:15 2015 -0700
----------------------------------------------------------------------
frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/619796dc/frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js
index a763823..b599ede 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/TextInput.js
@@ -46,6 +46,8 @@ org.apache.flex.html.TextInput.prototype.FLEXJS_CLASS_INFO =
org.apache.flex.html.TextInput.prototype.createElement = function() {
this.element = document.createElement('input');
this.element.setAttribute('type', 'input');
+ this.element.className = 'TextInput';
+ this.typeNames = 'TextInput';
//attach input handler to dispatch flexjs change event when user write in textinput
//goog.events.listen(this.element, 'change', goog.bind(this.killChangeHandler, this));
[21/36] git commit: [flex-asjs] [refs/heads/develop] - Merge branch
'develop' into flatui
Posted by ah...@apache.org.
Merge branch 'develop' into flatui
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f66378cb
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f66378cb
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f66378cb
Branch: refs/heads/develop
Commit: f66378cbf05e9ca14c5b58a858a5bb6178776754
Parents: 9d1950f 95cb140
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 24 06:17:39 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 24 06:17:39 2015 -0700
----------------------------------------------------------------------
examples/ContainerTest/build.xml | 48 +++++
examples/ContainerTest/src/ContainerTest.mxml | 39 ++++
examples/ContainerTest/src/MyInitialView.mxml | 180 +++++++++++++++++++
.../ContainerTest/src/assets/logo_orange.png | Bin 0 -> 33897 bytes
.../ContainerTest/src/models/ProductsModel.as | 44 +++++
examples/ContainerTest/src/products/Product.as | 43 +++++
.../src/products/ProductItemRenderer.as | 83 +++++++++
examples/ContainerTest/src/smallbluerect.jpg | Bin 0 -> 13500 bytes
examples/ContainerTest/src/smallgreenrect.jpg | Bin 0 -> 13542 bytes
examples/ContainerTest/src/smallorangerect.gif | Bin 0 -> 821 bytes
examples/ContainerTest/src/smallorangerect.jpg | Bin 0 -> 13571 bytes
examples/ContainerTest/src/smallpurplerect.jpg | Bin 0 -> 13517 bytes
examples/ContainerTest/src/smallredrect.jpg | Bin 0 -> 13477 bytes
examples/ContainerTest/src/smallyellowrect.jpg | Bin 0 -> 13598 bytes
examples/build.xml | 2 +
.../org/apache/flex/charts/beads/ChartView.as | 4 +
.../charts/beads/HorizontalCategoryAxisBead.as | 7 +
.../charts/beads/HorizontalLinearAxisBead.as | 7 +
.../charts/beads/VerticalCategoryAxisBead.as | 7 +
.../flex/charts/beads/VerticalLinearAxisBead.as | 7 +
.../flex/charts/beads/layouts/BarChartLayout.as | 10 +-
.../charts/beads/layouts/ColumnChartLayout.as | 10 +-
.../org/apache/flex/charts/core/ChartBase.js | 4 +-
.../charts/supportClasses/ChartAxisGroup.js | 6 +
.../js/src/org/apache/flex/core/BeadViewBase.js | 9 +-
frameworks/projects/HTML/as/defaults.css | 4 +-
.../HTML/as/src/org/apache/flex/html/List.as | 2 +-
.../org/apache/flex/html/beads/ButtonBarView.as | 4 +-
.../org/apache/flex/html/beads/ContainerView.as | 71 ++++++--
.../src/org/apache/flex/html/beads/ListView.as | 11 +-
.../src/org/apache/flex/html/beads/PanelView.as | 17 +-
.../flex/html/beads/PanelWithControlBarView.as | 38 ++--
.../flex/html/beads/SolidBackgroundBead.as | 3 +-
.../flex/html/beads/layouts/BasicLayout.as | 30 ----
.../flex/html/beads/layouts/ButtonBarLayout.as | 39 +---
.../flex/html/beads/layouts/HorizontalLayout.as | 37 +---
.../flex/html/beads/layouts/TileLayout.as | 37 +---
.../flex/html/beads/layouts/VerticalLayout.as | 37 +---
.../html/supportClasses/ScrollingViewport.as | 12 +-
.../org/apache/flex/html/MXMLBeadViewBase.as | 3 +
.../org/apache/flex/html/beads/DataGridView.as | 3 +
.../HTML/js/src/org/apache/flex/html/List.js | 18 +-
.../HTML/js/src/org/apache/flex/html/Panel.js | 2 +
.../org/apache/flex/html/beads/ContainerView.js | 171 +++++++++++++++---
.../src/org/apache/flex/html/beads/ListView.js | 19 +-
.../src/org/apache/flex/html/beads/PanelView.js | 30 ++--
.../ListSingleSelectionMouseController.js | 5 +-
.../flex/html/beads/layouts/ButtonBarLayout.js | 42 ++---
.../flex/html/beads/layouts/TileLayout.js | 29 +++
.../flex/html/beads/models/ViewportModel.js | 162 +++++++++++++++++
.../html/supportClasses/ContainerContentArea.js | 60 +++++++
.../html/supportClasses/DataItemRenderer.js | 15 +-
.../html/supportClasses/ScrollingViewport.js | 37 +++-
.../html/supportClasses/UIItemRendererBase.js | 5 +-
.../apache/flex/html/supportClasses/Viewport.js | 24 ++-
55 files changed, 1132 insertions(+), 345 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f66378cb/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f66378cb/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SolidBackgroundBead.as
----------------------------------------------------------------------
[17/36] git commit: [flex-asjs] [refs/heads/develop] - missing header
and comments
Posted by ah...@apache.org.
missing header and comments
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4e6524cf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4e6524cf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4e6524cf
Branch: refs/heads/develop
Commit: 4e6524cfd42f8b68984b63b1ed6754286c82c7e7
Parents: f931f2a
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 16:14:45 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 16:14:45 2015 -0700
----------------------------------------------------------------------
frameworks/fontsrc/FlatUIIcons.as | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4e6524cf/frameworks/fontsrc/FlatUIIcons.as
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/FlatUIIcons.as b/frameworks/fontsrc/FlatUIIcons.as
index 014899e..8c14cfc 100644
--- a/frameworks/fontsrc/FlatUIIcons.as
+++ b/frameworks/fontsrc/FlatUIIcons.as
@@ -1,12 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
{
import flash.display.Sprite;
import flash.text.Font;
+/**
+ * This mini-application is used to generate a font swf that can be used
+ * in FlexJS applications. Unlike the output of the fontswf utility,
+ * this swf registers the font.
+ */
public class FlatUIIcons extends Sprite
{
/*
- * Embed a font with bold typeface by location.
+ * Embed a font by location.
*/
[Embed(source='../fonts/flat-ui-icons-regular.ttf',
fontWeight='normal',
[27/36] git commit: [flex-asjs] [refs/heads/develop] - don't block if
no fonts
Posted by ah...@apache.org.
don't block if no fonts
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2c5501cf
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2c5501cf
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2c5501cf
Branch: refs/heads/develop
Commit: 2c5501cf9986ae59cf71153ab4a932ae3e0a45ba
Parents: 5c6408c
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 27 15:35:36 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 27 15:35:36 2015 -0700
----------------------------------------------------------------------
.../Core/as/src/org/apache/flex/core/CSSFontFaceBead.as | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2c5501cf/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
index f17f33b..bc9839a 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/core/CSSFontFaceBead.as
@@ -88,6 +88,12 @@ package org.apache.flex.core
{
if (!loaders)
loaders = [];
+
+ if (!fontFaces || fontFaces.length == 0)
+ {
+ IEventDispatcher(_strand).removeEventListener("preinitialize", preinitHandler);
+ return;
+ }
for each (var url:String in fontFaces)
{
[09/36] git commit: [flex-asjs] [refs/heads/develop] - CSS driven
checkboxes and radio buttons
Posted by ah...@apache.org.
CSS driven checkboxes and radio buttons
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/bc31635d
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/bc31635d
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/bc31635d
Branch: refs/heads/develop
Commit: bc31635d760d796fba2cb28a3d381382100e2a9f
Parents: 6017e95
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 13 21:58:29 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 13 21:58:29 2015 -0700
----------------------------------------------------------------------
frameworks/projects/HTML/as/defaults.css | 86 +++++-
.../beads/CSSContentAndTextToggleButtonView.as | 295 +++++++++++++++++++
frameworks/projects/HTML/basic-manifest.xml | 1 +
3 files changed, 380 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bc31635d/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index 76830dd..5580777 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -20,6 +20,13 @@
@namespace "library://ns.apache.org/flexjs/basic";
@namespace svg "library://ns.apache.org/flexjs/svg";
+@font-face {
+ font-family: 'Flat-UI-Icons';
+
+ src: url('../fonts/glyphicons/flat-ui-icons-regular.eot');
+ src: url('../fonts/glyphicons/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons/flat-ui-icons-regular.woff') format('woff'), url('../fonts/glyphicons/flat-ui-icons-regular.ttf') format('truetype'), url('../fonts/glyphicons/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
+}
+
/* Global style declaration */
*
{
@@ -96,6 +103,30 @@ ButtonBarButtonItemRenderer
height: 30;
}
+CheckBox
+{
+ content: "\e60d";
+
+ /* .checkbox */
+ position: relative;
+ padding-left: 32px;
+ margin-bottom: 12px;
+ font-size: 14px;
+ line-height: 1.5;
+ -webkit-transition: color .25s linear;
+ transition: color .25s linear;
+}
+
+CheckBox:hover
+{
+ content: "\e60e";
+}
+
+CheckBox:checked
+{
+ content: "\e60e";
+}
+
Container
{
IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
@@ -199,6 +230,57 @@ PanelWithControlBar
padding: 2px;
}
+.icon-checked
+{
+ /* .radio .icon-checked:before */
+ /* .radio .icon-unchecked:before */
+ font-family: 'Flat-UI-Icons';
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+
+ speak: none;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ font-size: 20px;
+ line-height: 20px;
+ color: #bdc3c7;
+
+}
+
+.icon-checked:checked
+{
+ color: #1abc9c;
+}
+
+RadioButton
+{
+ content: "\e60b";
+
+ /* .radio */
+ position: relative;
+ padding-left: 32px;
+ margin-bottom: 12px;
+ font-size: 14px;
+ line-height: 1.5;
+ -webkit-transition: color .25s linear;
+ transition: color .25s linear;
+}
+
+RadioButton:hover
+{
+ content: "\e60c";
+
+}
+
+RadioButton:checked
+{
+ content: "\e60c";
+
+}
+
SimpleList
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ArraySelectionModel");
@@ -290,7 +372,7 @@ Button
CheckBox
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.CheckBoxView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSContentAndTextToggleButtonView");
}
CloseButton
@@ -404,7 +486,7 @@ PanelWithControlBar
RadioButton
{
IBeadModel: ClassReference("org.apache.flex.html.beads.models.ValueToggleButtonModel");
- IBeadView: ClassReference("org.apache.flex.html.beads.RadioButtonView");
+ IBeadView: ClassReference("org.apache.flex.html.beads.CSSContentAndTextToggleButtonView");
}
ScrollBar
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bc31635d/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
new file mode 100644
index 0000000..48eb9fe
--- /dev/null
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSContentAndTextToggleButtonView.as
@@ -0,0 +1,295 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.html.beads
+{
+ import flash.display.Shape;
+ import flash.display.SimpleButton;
+ import flash.display.Sprite;
+ import flash.text.TextFieldAutoSize;
+ import flash.text.TextFieldType;
+
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSTextField;
+ import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.IStrand;
+ import org.apache.flex.core.IToggleButtonModel;
+ import org.apache.flex.core.StyleableCSSTextField;
+ import org.apache.flex.core.ValuesManager;
+ import org.apache.flex.events.Event;
+ import org.apache.flex.utils.CSSUtils;
+
+ /**
+ * The CSSContentAndTextToggleButtonView class is the default view for
+ * the org.apache.flex.html.CheckBox and RadioButton classes.
+ * It supports CSS content property for the
+ * icon.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class CSSContentAndTextToggleButtonView extends BeadViewBase implements IBeadView
+ {
+ /**
+ * map of pseudo states.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ private static var statesMap:Object = {
+ "upSprite": null,
+ "downSprite": "active",
+ "overSprite": "hover",
+ "upAndSelectedSprite": "checked",
+ "downAndSelectedSprite": "checked",
+ "overAndSelectedSprite": "checked"
+ }
+
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function CSSContentAndTextToggleButtonView()
+ {
+ for (var p:String in statesMap)
+ {
+ var s:Sprite = new Sprite();
+ sprites.push(s);
+ this[p] = s;
+
+ var tf:CSSTextField = new CSSTextField();
+ tf.type = TextFieldType.DYNAMIC;
+ tf.autoSize = TextFieldAutoSize.LEFT;
+ tf.name = "textField";
+ tf.parentHandlesPadding = true;
+ var icon:StyleableCSSTextField = new StyleableCSSTextField();
+ icon.name = "icon";
+ icon.className = "icon-checked";
+ icon.styleState = statesMap[p];
+ s.addChild(icon);
+ s.addChild(tf);
+ }
+ }
+
+ private var upSprite:Sprite;
+ private var downSprite:Sprite;
+ private var overSprite:Sprite;
+ private var upAndSelectedSprite:Sprite;
+ private var downAndSelectedSprite:Sprite;
+ private var overAndSelectedSprite:Sprite;
+
+ private var sprites:Array = [];
+
+ private var _toggleButtonModel:IToggleButtonModel;
+
+ // TODO: Can we remove this?
+ private function get toggleButtonModel() : IToggleButtonModel
+ {
+ return _toggleButtonModel;
+ }
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set strand(value:IStrand):void
+ {
+ super.strand = value;
+
+ _toggleButtonModel = value.getBeadByType(IToggleButtonModel) as IToggleButtonModel;
+ _toggleButtonModel.addEventListener("textChange", textChangeHandler);
+ _toggleButtonModel.addEventListener("htmlChange", htmlChangeHandler);
+ _toggleButtonModel.addEventListener("selectedChange", selectedChangeHandler);
+ if (_toggleButtonModel.text !== null)
+ text = _toggleButtonModel.text;
+
+ layoutControl();
+
+ var hitArea:Shape = new Shape();
+ hitArea.graphics.beginFill(0x000000);
+ hitArea.graphics.drawRect(0,0,upSprite.width, upSprite.height);
+ hitArea.graphics.endFill();
+
+ SimpleButton(value).upState = upSprite;
+ SimpleButton(value).downState = downSprite;
+ SimpleButton(value).overState = overSprite;
+ SimpleButton(value).hitTestState = hitArea;
+
+ if (toggleButtonModel.text !== null)
+ text = toggleButtonModel.text;
+ if (toggleButtonModel.html !== null)
+ html = toggleButtonModel.html;
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#text
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get text():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.text;
+ }
+
+ /**
+ * @private
+ */
+ public function set text(value:String):void
+ {
+ for each( var s:Sprite in sprites )
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.styleParent = _strand;
+ tf.text = value;
+ }
+
+ layoutControl();
+ }
+
+ /**
+ * @copy org.apache.flex.html.Label#html
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get html():String
+ {
+ var tf:CSSTextField = upSprite.getChildByName('textField') as CSSTextField;
+ return tf.htmlText;
+ }
+
+ /**
+ * @private
+ */
+ public function set html(value:String):void
+ {
+ for each(var s:Sprite in sprites)
+ {
+ var tf:CSSTextField = s.getChildByName('textField') as CSSTextField;
+ tf.htmlText = value;
+ }
+
+ layoutControl();
+ }
+
+ private function textChangeHandler(event:Event):void
+ {
+ text = toggleButtonModel.text;
+ }
+
+ private function htmlChangeHandler(event:Event):void
+ {
+ html = toggleButtonModel.html;
+ }
+
+ private var _selected:Boolean;
+
+ /**
+ * @copy org.apache.flex.core.IToggleButtonModel#selected
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function get selected():Boolean
+ {
+ return _selected;
+ }
+
+ /**
+ * @private
+ */
+ public function set selected(value:Boolean):void
+ {
+ _selected = value;
+
+ layoutControl();
+
+ if( value ) {
+ SimpleButton(_strand).upState = upAndSelectedSprite;
+ SimpleButton(_strand).downState = downAndSelectedSprite;
+ SimpleButton(_strand).overState = overAndSelectedSprite;
+
+ } else {
+ SimpleButton(_strand).upState = upSprite;
+ SimpleButton(_strand).downState = downSprite;
+ SimpleButton(_strand).overState = overSprite;
+ }
+ }
+
+ private function selectedChangeHandler(event:Event):void
+ {
+ selected = toggleButtonModel.selected;
+ }
+
+ /**
+ * Display the icon and text label
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ protected function layoutControl() : void
+ {
+ // TODO: Layout using descendant selectors (.checkbox .icons)
+ for (var p:String in statesMap)
+ {
+ var s:Sprite = this[p];
+ var state:String = statesMap[p];
+ var icon:StyleableCSSTextField = s.getChildByName("icon") as StyleableCSSTextField;
+ icon.autoSize = TextFieldAutoSize.LEFT;
+ var tf:CSSTextField = s.getChildByName("textField") as CSSTextField;
+
+ icon.CSSParent = _strand;
+ var content:String = ValuesManager.valuesImpl.getValue(_strand, "content", state);
+ if (content != null)
+ icon.text = content;
+ var mh:Number = Math.max(icon.height,tf.height);
+
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding", state);
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left", state);
+ icon.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
+ icon.y = (mh - icon.height)/2;
+
+ tf.x = icon.x + icon.width + 1;
+ tf.y = (mh - tf.height)/2;
+ }
+
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/bc31635d/frameworks/projects/HTML/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/basic-manifest.xml b/frameworks/projects/HTML/basic-manifest.xml
index 1591aed..74002c9 100644
--- a/frameworks/projects/HTML/basic-manifest.xml
+++ b/frameworks/projects/HTML/basic-manifest.xml
@@ -74,6 +74,7 @@
<component id="HRule" class="org.apache.flex.html.HRule" />
<component id="Spacer" class="org.apache.flex.html.Spacer" />
<component id="ImageAndTextButtonView" class="org.apache.flex.html.beads.ImageAndTextButtonView" />
+ <component id="CSSContentAndTextToggleButtonView" class="org.apache.flex.html.beads.CSSContentAndTextToggleButtonView"/>
<component id="ScrollingViewport" class="org.apache.flex.html.supportClasses.ScrollingViewport" />
<component id="DataGrid" class="org.apache.flex.html.DataGrid"/>
[19/36] git commit: [flex-asjs] [refs/heads/develop] - almost have
the dropdownlist working in JS
Posted by ah...@apache.org.
almost have the dropdownlist working in JS
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2eda7491
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2eda7491
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2eda7491
Branch: refs/heads/develop
Commit: 2eda74913c91df1467c1c801bf61a4a11e8c2221
Parents: c204976
Author: Alex Harui <ah...@apache.org>
Authored: Mon Jul 20 12:04:19 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Jul 20 12:04:19 2015 -0700
----------------------------------------------------------------------
examples/DataBindingTest/src/MyInitialView.mxml | 2 +-
.../as/src/org/apache/flex/utils/CSSUtils.as | 36 +++--
.../org/apache/flex/utils/SolidBorderUtil.as | 80 +++++++++-
frameworks/projects/HTML/as/defaults.css | 42 +++++
.../org/apache/flex/html/beads/CSSButtonView.as | 2 +-
.../apache/flex/html/beads/CSSTextButtonView.as | 2 +-
.../flex/html/beads/SingleLineBorderBead.as | 77 +++++++--
.../js/src/org/apache/flex/html/DropDownList.js | 160 +++++++++++++++----
8 files changed, 336 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/examples/DataBindingTest/src/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/DataBindingTest/src/MyInitialView.mxml b/examples/DataBindingTest/src/MyInitialView.mxml
index 0cb7911..0d14f92 100644
--- a/examples/DataBindingTest/src/MyInitialView.mxml
+++ b/examples/DataBindingTest/src/MyInitialView.mxml
@@ -126,7 +126,7 @@ limitations under the License.
<js:beads>
<js:VerticalLayout />
</js:beads>
- <js:DropDownList id="list" width="100" height="17"
+ <js:DropDownList id="list" width="100" height="30"
change="_symbol = list.selectedItem as String; dispatchEvent(new CustomEvent('listChanged'))"
dataProvider="{MyModel(applicationModel).strings}" />
<js:RadioButton id="radio1" text="Price" value="Ask" groupName="group1" change="radioChanged(event)"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
index 2f6d6d5..bb290b6 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSUtils.as
@@ -115,7 +115,8 @@ package org.apache.flex.utils
c2 = stringValue.indexOf(")");
stringValue = stringValue.substring(c + 4, c2);
var parts3:Array = stringValue.split(",");
- return (uint(parts3[0]) << 16 +
+ return (0xFF000000 +
+ uint(parts3[0]) << 16 +
uint(parts3[1]) << 8 +
uint(parts3[2]));
}
@@ -286,22 +287,23 @@ package org.apache.flex.utils
* @productversion FlexJS 0.0
*/
public static var colorMap:Object = {
- white: 0xFFFFFF,
- silver: 0xC0C0C0,
- gray: 0x808080,
- black: 0x000000,
- red: 0xFF0000,
- maroon: 0x800000,
- yellow: 0xFFFF00,
- olive: 0x808000,
- lime: 0x00FF00,
- green: 0x008000,
- aqua: 0x00FFFF,
- teal: 0x008080,
- blue: 0x0000FF,
- navy: 0x000080,
- fuchsia: 0xFF00FF,
- purple: 0x800080
+ transparent: 0,
+ white: 0xFFFFFFFF,
+ silver: 0xFFC0C0C0,
+ gray: 0xFF808080,
+ black: 0xFF000000,
+ red: 0xFFFF0000,
+ maroon: 0xFF800000,
+ yellow: 0xFFFFFF00,
+ olive: 0xFF808000,
+ lime: 0xFF00FF00,
+ green: 0xFF008000,
+ aqua: 0xFF00FFFF,
+ teal: 0xFF008080,
+ blue: 0xFF0000FF,
+ navy: 0xFF000080,
+ fuchsia: 0xFFFF00FF,
+ purple: 0xFF800080
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
index 5848826..59c0fcf 100644
--- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
+++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as
@@ -36,7 +36,8 @@ public class SolidBorderUtil
{
/**
* Draw a solid color border as specified. Will fill with
- * the backgroundColor if specified.
+ * the backgroundColor if specified. The border draws
+ * inside with given width/height.
*
* @param g The flash.display.DisplayObject#graphics
* @param x The x position
@@ -94,5 +95,82 @@ public class SolidBorderUtil
g.endFill();
}
}
+
+ /**
+ * Draw a solid color border as specified. Only square corners
+ * are supported as the real usage for this is to handle
+ * CSS triangles. The border is drawn around the given
+ * width and height.
+ *
+ * @param g The flash.display.DisplayObject#graphics
+ * @param x The x position
+ * @param y The y position
+ * @param width The width
+ * @param height The height
+ * @param colorTop The rgba color (alpha is in highest order byte)
+ * @param colorRight The rgba color
+ * @param colorBottom The rgba color
+ * @param colorLeft The rgba color
+ * @param backgroundColor The optional fill color
+ * @param thicknessTop The thickness of the border
+ * @param thicknessRight The thickness of the border
+ * @param thicknessBottom The thickness of the border
+ * @param thicknessLeft The thickness of the border
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public static function drawDetailedBorder(g:Graphics, x:Number, y:Number,
+ width:Number, height:Number,
+ colorTop:uint, colorRight:uint, colorBottom:uint, colorLeft:uint,
+ thicknessTop:int = 0, thicknessRight:int = 0, thicknessBottom:int = 0, thicknessLeft:int = 0
+ ):void
+ {
+ g.lineStyle(); // don't draw the line, it tends to get aligned on half-pixels
+
+ if (thicknessTop > 0)
+ {
+ g.beginFill(colorTop & 0xFFFFFF, colorTop >> 24 / 255);
+ g.moveTo(-thicknessLeft, -thicknessTop);
+ g.lineTo(width + thicknessRight, -thicknessTop);
+ g.lineTo(width, 0);
+ g.lineTo(0, 0);
+ g.lineTo(-thicknessLeft, -thicknessTop);
+ g.endFill();
+ }
+ if (thicknessLeft > 0)
+ {
+ g.beginFill(colorLeft & 0xFFFFFF, colorLeft >> 24 / 255);
+ g.moveTo(-thicknessLeft, -thicknessTop);
+ g.lineTo(0, 0);
+ g.lineTo(0, height);
+ g.lineTo(-thicknessLeft, height + thicknessBottom);
+ g.lineTo(-thicknessLeft, -thicknessTop);
+ g.endFill();
+ }
+ if (thicknessRight > 0)
+ {
+ g.beginFill(colorRight & 0xFFFFFF, colorRight >> 24 / 255);
+ g.moveTo(width + thicknessRight, -thicknessTop);
+ g.lineTo(width + thicknessRight, height + thicknessBottom);
+ g.lineTo(width, height);
+ g.lineTo(width, 0);
+ g.lineTo(width + thicknessRight, -thicknessTop);
+ g.endFill();
+ }
+ if (thicknessBottom > 0)
+ {
+ g.beginFill(colorBottom & 0xFFFFFF, colorBottom >> 24 / 255);
+ g.moveTo(-thicknessLeft, height + thicknessBottom);
+ g.lineTo(0, height);
+ g.lineTo(width, height);
+ g.lineTo(width + thicknessRight, height + thicknessBottom);
+ g.lineTo(-thicknessLeft, height + thicknessBottom);
+ g.endFill();
+ }
+ }
+
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index c34fea3..1f7eeb7 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -228,6 +228,48 @@ DateField {
IFormatBead: ClassReference("org.apache.flex.html.accessories.DateFormatMMDDYYYYBead");
}
+.dropdown-menu {
+ z-index: 1000;
+ min-width: 220px;
+ padding: 0;
+ margin-top: 9px;
+ font-size: 14px;
+ background-color: #f3f4f5;
+ border: none;
+ border-radius: 4px;
+ box-shadow: none;
+ }
+.dropdown-menu-divider {
+ height: 2px;
+ margin: 3px 0;
+ overflow: hidden;
+ background-color: rgba(202, 206, 209, .5);
+ }
+.dropdown-menu-item-renderer {
+ padding: 8px 16px;
+ line-height: 1.429;
+ color: #606d7a;
+}
+
+.dropdown-toggle-open-btn {
+ color: #fff;
+ background-color: #48c9b0;
+ border-color: #48c9b0;
+ }
+
+.dropdown-caret {
+ display: inline-block;
+ width: 0;
+ height: 0;
+ margin-left: 5px;
+ vertical-align: middle;
+ border-top: 8px solid;
+ border-right: 6px solid transparent;
+ border-left: 6px solid transparent;
+ -webkit-transition: border-color .25s, color .25s;
+ transition: border-color .25s, color .25s;
+ }
+
HContainer
{
IBeadView: ClassReference("org.apache.flex.html.beads.ContainerView");
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
index 4377e8e..c41bbd7 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSButtonView.as
@@ -114,7 +114,7 @@ package org.apache.flex.html.beads
value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
if (value != null)
borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
if (value != null)
borderThickness = value as uint;
if (borderStyle == "none")
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
index 98dc7f5..866259e 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/CSSTextButtonView.as
@@ -168,7 +168,7 @@ package org.apache.flex.html.beads
value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
if (value != null)
borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
if (value != null)
borderThickness = value as uint;
if (borderStyle == "none")
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
index 470fa9d..6a39157 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/SingleLineBorderBead.as
@@ -21,8 +21,8 @@ package org.apache.flex.html.beads
import flash.display.Graphics;
import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IStatesObject;
import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IStatesObject;
import org.apache.flex.core.UIBase;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
@@ -105,14 +105,9 @@ package org.apache.flex.html.beads
value = ValuesManager.valuesImpl.getValue(_strand, "border-color", state);
if (value != null)
borderColor = CSSUtils.toColor(value);
- value = ValuesManager.valuesImpl.getValue(_strand, "border-thickness", state);
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-width", state);
if (value != null)
borderThickness = value as uint;
- if (borderStyle == "none")
- {
- borderStyle = "solid";
- borderThickness = 0;
- }
var borderRadius:String;
var borderEllipseWidth:Number = NaN;
@@ -131,10 +126,70 @@ package org.apache.flex.html.beads
borderEllipseHeight = CSSUtils.toNumber(arr[1]);
}
}
- SolidBorderUtil.drawBorder(g,
- 0, 0, w, h,
- borderColor, null, borderThickness, 1,
- borderEllipseWidth, borderEllipseHeight);
+ if (borderStyle == "none")
+ {
+ var n:int;
+ var values:Array;
+ var colorTop:uint;
+ var colorLeft:uint;
+ var colorRight:uint;
+ var colorBottom:uint;
+ var widthTop:int = -1;
+ var widthLeft:int = -1;
+ var widthBottom:int = -1;
+ var widthRight:int = -1;
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-top", state);
+ if (value != null)
+ {
+ values = value.split(" ");
+ n = values.length;
+ widthTop = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorTop = CSSUtils.toColorWithAlpha(values[2]);
+ }
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-left", state);
+ if (value != null)
+ {
+ values = value.split(" ");
+ n = values.length;
+ widthLeft = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorLeft = CSSUtils.toColorWithAlpha(values[2]);
+ }
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-bottom", state);
+ if (value != null)
+ {
+ values = value.split(" ");
+ n = values.length;
+ widthBottom = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorBottom = CSSUtils.toColorWithAlpha(values[2]);
+ }
+ value = ValuesManager.valuesImpl.getValue(_strand, "border-right", state);
+ if (value != null)
+ {
+ values = value.split(" ");
+ n = values.length;
+ widthRight = CSSUtils.toNumber(values[0]);
+ // assume solid for now
+ if (n > 2)
+ colorRight = CSSUtils.toColorWithAlpha(values[2]);
+ }
+ SolidBorderUtil.drawDetailedBorder(g, 0, 0, w, h,
+ colorTop, colorRight, colorBottom, colorLeft,
+ widthTop, widthRight, widthBottom, widthLeft);
+ }
+ else
+ {
+ borderThickness = 0;
+ SolidBorderUtil.drawBorder(g,
+ 0, 0, w, h,
+ borderColor, null, borderThickness, 1,
+ borderEllipseWidth, borderEllipseHeight);
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2eda7491/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
index 7df803f..df61633 100644
--- a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
+++ b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js
@@ -44,41 +44,145 @@ org.apache.flex.html.DropDownList.prototype.FLEXJS_CLASS_INFO =
/**
* @override
*/
-org.apache.flex.html.DropDownList.prototype.
- createElement = function() {
- this.element = document.createElement('select');
- this.element.size = 1;
- goog.events.listen(this.element, 'change',
- goog.bind(this.changeHandler, this));
+org.apache.flex.html.DropDownList.prototype.createElement =
+ function() {
+ var button, input;
+
+ this.element = document.createElement('div');
+
+ this.button = button = document.createElement('button');
+ button.className = 'dropdown-toggle-open-btn';
+ goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this));
+ this.element.appendChild(button);
+
+ var caret = document.createElement('span');
+ caret.className = 'dropdown-caret';
+
+ this.element.style.position = 'relative';
+
this.positioner = this.element;
+ // add a click handler so that a click outside of the combo box can
+ // dismiss the pop-up should it be visible.
+ goog.events.listen(document, 'click',
+ goog.bind(this.dismissPopup, this));
+
+ button.flexjs_wrapper = this;
this.element.flexjs_wrapper = this;
+ caret.flexjs_wrapper = this;
return this.element;
};
+/**
+ * @export
+ * @param {Object} event The event.
+ */
+org.apache.flex.html.DropDownList.prototype.selectChanged =
+ function(event) {
+ var select;
+
+ select = event.currentTarget;
+
+ this.selectedItem = select.options[select.selectedIndex].value;
+
+ this.popup.parentNode.removeChild(this.popup);
+ this.popup = null;
+
+ this.dispatchEvent(event);
+};
+
+
+/**
+ * @export
+ * @param {Object=} opt_event The event.
+ */
+org.apache.flex.html.DropDownList.prototype.dismissPopup =
+ function(opt_event) {
+ // remove the popup if it already exists
+ if (this.popup) {
+ this.popup.parentNode.removeChild(this.popup);
+ this.popup = null;
+ }
+};
+
+
+/**
+ * @export
+ * @param {Object} event The event.
+ */
+org.apache.flex.html.DropDownList.prototype.buttonClicked =
+ function(event) {
+ /**
+ * @type {Array.<string>}
+ */
+ var dp;
+ var i, button, left, n, opt, opts, pn, popup, select, si, top, width;
+
+ event.stopPropagation();
+
+ if (this.popup) {
+ this.dismissPopup();
+
+ return;
+ }
+
+ button = this.element.childNodes.item(0);
+
+ pn = this.element;
+ top = pn.offsetTop + button.offsetHeight;
+ left = pn.offsetLeft;
+ width = pn.offsetWidth;
+
+ popup = document.createElement('div');
+ popup.className = 'dropdown-menu';
+ popup.id = 'test';
+ popup.style.position = 'absolute';
+ popup.style.top = top.toString() + 'px';
+ popup.style.left = left.toString() + 'px';
+ popup.style.width = width.toString() + 'px';
+ popup.style.margin = '0px auto';
+ popup.style.padding = '0px';
+ popup.style.zIndex = '10000';
+
+ this.menu = select = document.createElement('select');
+ select.style.width = width.toString() + 'px';
+ goog.events.listen(select, 'change', goog.bind(this.selectChanged, this));
+ opts = select.options;
+
+ dp = /** @type {Array.<string>} */ (this.dataProvider);
+ n = dp.length;
+ for (i = 0; i < n; i++) {
+ opt = document.createElement('option');
+ opt.className = 'dropdown-menu-item-renderer';
+ opt.text = dp[i];
+ opts.add(opt);
+ }
+
+ select.size = n;
+
+ si = this.selectedIndex;
+ if (si < 0) {
+ select.value = null;
+ } else {
+ select.value = dp[si];
+ }
+
+ this.popup = popup;
+
+ popup.appendChild(select);
+ document.body.appendChild(popup);
+};
+
+
Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
- /** @export */
dataProvider: {
/** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
var dp, i, n, opt;
this.model.dataProvider = value;
-
- dp = this.element.options;
- n = dp.length;
- for (i = 0; i < n; i++) {
- dp.remove(0);
- }
-
- n = value.length;
- for (i = 0; i < n; i++) {
- opt = document.createElement('option');
- opt.text = value[i];
- dp.add(opt);
- }
}
},
/** @export */
@@ -93,7 +197,7 @@ Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
/** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
this.model.selectedIndex = value;
- this.element.selectedIndex = value;
+ this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
}
},
/** @export */
@@ -108,17 +212,7 @@ Object.defineProperties(org.apache.flex.html.DropDownList.prototype, {
/** @this {org.apache.flex.html.DropDownList} */
set: function(value) {
this.model.selectedItem = value;
- this.element.selectedIndex = this.selectedIndex;
- }
+ this.button.innerHTML = this.selectedItem + '<span class="dropdown-caret"/>';
+ }
}
});
-
-
-/**
- * @protected
- */
-org.apache.flex.html.DropDownList.prototype.changeHandler =
- function() {
- this.model.selectedIndex = this.element.selectedIndex;
- this.dispatchEvent('change');
-};
[34/36] git commit: [flex-asjs] [refs/heads/develop] - fix up
positions and backgrounds
Posted by ah...@apache.org.
fix up positions and backgrounds
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/13cd2021
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/13cd2021
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/13cd2021
Branch: refs/heads/develop
Commit: 13cd20217370824de6ebce1536a2ae581e4dd1a3
Parents: 0ae79f4
Author: Alex Harui <ah...@apache.org>
Authored: Tue Jul 28 11:29:52 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Jul 28 11:29:52 2015 -0700
----------------------------------------------------------------------
frameworks/projects/Flat/as/defaults.css | 8 +--
.../beads/CSSContentAndTextToggleButtonView.as | 4 +-
.../apache/flex/flat/beads/DropDownListView.as | 59 ++++++++++++--------
3 files changed, 42 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13cd2021/frameworks/projects/Flat/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/defaults.css b/frameworks/projects/Flat/as/defaults.css
index ef89360..95dcd1e 100644
--- a/frameworks/projects/Flat/as/defaults.css
+++ b/frameworks/projects/Flat/as/defaults.css
@@ -260,6 +260,7 @@ DateField {
.dropdown-toggle-open-btn {
border-radius: 4px;
+ font-size: 14px;
color: #fff;
background-color: #1abc9c;
border-color: #1abc9c;
@@ -267,6 +268,7 @@ DateField {
.dropdown-toggle-open-btn:hover {
border-radius: 4px;
+ font-size: 14px;
color: #fff;
background-color: #48c9b0;
border-color: #48c9b0;
@@ -559,7 +561,6 @@ DropDownList
IBeadView: ClassReference("org.apache.flex.flat.beads.DropDownListView");
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.DropDownListController");
IPopUp: ClassReference("org.apache.flex.flat.supportClasses.DropDownListList");
- height: 43px;
}
DropDownListList
@@ -568,6 +569,7 @@ DropDownListList
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.TextItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
IItemRenderer: ClassReference("org.apache.flex.flat.supportClasses.DropDownListStringItemRenderer");
+ iBackgroundBead: ClassReference('org.apache.flex.html.beads.SolidBackgroundBead');
border-style: solid;
border-radius: 4px;
border-color: #000000;
@@ -774,8 +776,6 @@ TextArea
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
- width: 135;
- height: 20;
}
TextButton
@@ -798,8 +798,6 @@ TextInput
IBeadController: ClassReference("org.apache.flex.html.beads.controllers.EditableTextKeyboardController");
iBorderBead: ClassReference('org.apache.flex.html.beads.SingleLineBorderBead');
iBorderModel: ClassReference('org.apache.flex.html.beads.models.SingleLineBorderModel');
- width: 135;
- height: 20;
}
TitleBar
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13cd2021/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
index aacefb2..aa3e8b5 100644
--- a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/CSSContentAndTextToggleButtonView.as
@@ -292,10 +292,10 @@ package org.apache.flex.flat.beads
var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left");
- icon.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
+ icon.x = 0;
icon.y = (mh - icon.height)/2;
- tf.x = icon.x + icon.width + 1;
+ tf.x = CSSUtils.getLeftValue(paddingLeft, padding, s.width);
tf.y = (mh - tf.height)/2;
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/13cd2021/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
index 0d4d032..a9e4cde 100644
--- a/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
+++ b/frameworks/projects/Flat/as/src/org/apache/flex/flat/beads/DropDownListView.as
@@ -26,20 +26,21 @@ package org.apache.flex.flat.beads
import flash.display.Sprite;
import flash.text.TextFieldType;
- import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.BeadViewBase;
+ import org.apache.flex.core.CSSShape;
+ import org.apache.flex.core.CSSSprite;
import org.apache.flex.core.CSSTextField;
- import org.apache.flex.core.CSSShape;
- import org.apache.flex.core.CSSSprite;
import org.apache.flex.core.IBeadView;
+ import org.apache.flex.core.ILayoutChild;
import org.apache.flex.core.IPopUpHost;
import org.apache.flex.core.ISelectionModel;
import org.apache.flex.core.IStrand;
- import org.apache.flex.core.IPopUpHost;
- import org.apache.flex.core.IUIBase;
+ import org.apache.flex.core.IUIBase;
import org.apache.flex.core.ValuesManager;
import org.apache.flex.events.Event;
import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.html.beads.IDropDownListView;
+ import org.apache.flex.html.beads.IDropDownListView;
+ import org.apache.flex.utils.CSSUtils;
/**
* The DropDownListView class is the default view for
@@ -80,12 +81,15 @@ package org.apache.flex.flat.beads
downSprite.addChild(downTextField);
upTextField.selectable = false;
upTextField.parentDrawsBackground = true;
+ upTextField.parentHandlesPadding = true;
upTextField.type = TextFieldType.DYNAMIC;
downTextField.selectable = false;
downTextField.parentDrawsBackground = true;
+ downTextField.parentHandlesPadding = true;
downTextField.type = TextFieldType.DYNAMIC;
overTextField.selectable = false;
overTextField.parentDrawsBackground = true;
+ overTextField.parentHandlesPadding = true;
overTextField.type = TextFieldType.DYNAMIC;
// auto-size collapses if no text
//upTextField.autoSize = "left";
@@ -154,29 +158,47 @@ package org.apache.flex.flat.beads
{
var ww:Number = DisplayObject(_strand).width;
var hh:Number = DisplayObject(_strand).height;
+ var padding:Object = ValuesManager.valuesImpl.getValue(_strand, "padding");
+ var paddingLeft:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-left");
+ var paddingRight:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-right");
+ var paddingTop:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-top");
+ var paddingBottom:Object = ValuesManager.valuesImpl.getValue(_strand,"padding-bottom");
+ var pl:Number = CSSUtils.getLeftValue(paddingLeft, padding, ww);
+ var pr:Number = CSSUtils.getRightValue(paddingRight, padding, ww);
+ var pt:Number = CSSUtils.getLeftValue(paddingTop, padding, hh);
+ var pb:Number = CSSUtils.getRightValue(paddingBottom, padding, hh);
+
upArrows.draw(0, 0);
overArrows.draw(0, 0);
downArrows.draw(0, 0);
+ if (ILayoutChild(_strand).isHeightSizedToContent() && text != "")
+ {
+ hh = upTextField.textHeight + pt + pb;
+ ILayoutChild(_strand).setHeight(hh, true);
+ }
upSprite.draw(ww, hh);
overSprite.draw(ww, hh);
downSprite.draw(ww, hh);
- upArrows.x = ww - upArrows.width;
- overArrows.x = ww - overArrows.width;
- downArrows.x = ww - downArrows.width;
+ upArrows.x = ww - upArrows.width - pr;
+ overArrows.x = ww - overArrows.width - pr;
+ downArrows.x = ww - downArrows.width - pr;
upArrows.y = (hh - upArrows.height) / 2;
overArrows.y = (hh - overArrows.height) / 2;
downArrows.y = (hh - downArrows.height) / 2;
- upTextField.width = upArrows.x;
- downTextField.width = downArrows.x;
- overTextField.width = overArrows.x;
+ upTextField.width = upTextField.textWidth + 4;
+ downTextField.width = downTextField.textWidth + 4;
+ overTextField.width = overTextField.textWidth + 4;
upTextField.height = upTextField.textHeight + 5;
downTextField.height = downTextField.textHeight + 5;
overTextField.height = overTextField.textHeight + 5;
upTextField.y = (hh - upTextField.height) / 2;
- downTextField.y = (hh - downTextField.height) / 2;
- overTextField.y = (hh - overTextField.height) / 2;
+ downTextField.y = (hh - downTextField.height) / 2;
+ overTextField.y = (hh - overTextField.height) / 2;
+ upTextField.x = pl;
+ downTextField.x = pl;
+ overTextField.x = pl;
shape.graphics.clear();
shape.graphics.beginFill(0xCCCCCC);
shape.graphics.drawRect(0, 0, ww, hh);
@@ -211,17 +233,10 @@ package org.apache.flex.flat.beads
*/
public function set text(value:String):void
{
- var ww:Number = DisplayObject(_strand).width;
- var hh:Number = DisplayObject(_strand).height;
upTextField.text = value;
downTextField.text = value;
overTextField.text = value;
- upTextField.height = upTextField.textHeight + 5;
- downTextField.height = downTextField.textHeight + 5;
- overTextField.height = overTextField.textHeight + 5;
- upTextField.y = (hh - upTextField.height) / 2;
- downTextField.y = (hh - downTextField.height) / 2;
- overTextField.y = (hh - overTextField.height) / 2;
+ changeHandler(null);
}
private var _popUp:IStrand;