flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bigosma...@apache.org
Subject [01/11] git commit: [flex-asjs] [refs/heads/develop] - Creating new package org.apache.flex.svg.staticControls
Date Tue, 23 Jul 2013 21:47:59 GMT
Updated Branches:
  refs/heads/develop eee39872f -> a24f61227


Creating new package org.apache.flex.svg.staticControls


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/73777063
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/73777063
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/73777063

Branch: refs/heads/develop
Commit: 73777063c33580dbfc7808c872dda4292a4e0319
Parents: 2925c32
Author: Om <bigosmallm@gmail.com>
Authored: Mon Apr 15 23:48:25 2013 -0700
Committer: Om <bigosmallm@gmail.com>
Committed: Mon Apr 15 23:48:25 2013 -0700

----------------------------------------------------------------------
 .../flex/svg/staticControls/TextButton.as       |  32 +++
 .../flex/svg/staticControls/TextButton.js       |  62 +++++
 .../svg/staticControls/skins/TextButtonSkin.svg | 261 +++++++++++++++++++
 3 files changed, 355 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/73777063/frameworks/as/src/org/apache/flex/svg/staticControls/TextButton.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/svg/staticControls/TextButton.as b/frameworks/as/src/org/apache/flex/svg/staticControls/TextButton.as
new file mode 100644
index 0000000..a493e31
--- /dev/null
+++ b/frameworks/as/src/org/apache/flex/svg/staticControls/TextButton.as
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.svg.staticControls
+{
+	import flash.display.DisplayObject;
+	
+	import org.apache.flex.html.staticControls.TextButton;
+	
+	public class TextButton extends org.apache.flex.html.staticControls.TextButton
+	{
+		public function TextButton(upState:DisplayObject=null, overState:DisplayObject=null, downState:DisplayObject=null,
hitTestState:DisplayObject=null)
+		{
+			super(upState, overState, downState, hitTestState);
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/73777063/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/TextButton.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/TextButton.js b/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/TextButton.js
new file mode 100644
index 0000000..3edccdb
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/TextButton.js
@@ -0,0 +1,62 @@
+/**
+ * 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.svg.staticControls.TextButton');
+
+goog.require('org.apache.flex.core.UIBase');
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.svg.staticControls.TextButton = function() {
+    org.apache.flex.core.UIBase.call(this);
+};
+goog.inherits(
+    org.apache.flex.svg.staticControls.TextButton, org.apache.flex.core.UIBase
+);
+
+/**
+ * @override
+ * @this {org.apache.flex.svg.staticControls.TextButton}
+ * @param {Object} p The parent element.
+ */
+org.apache.flex.svg.staticControls.TextButton.prototype.addToParent =
+    function(p) {
+    this.element = document.createElement('button');
+    this.element.setAttribute('type', 'button');
+
+    p.appendChild(this.element);
+
+    this.positioner = this.element;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.svg.staticControls.TextButton}
+ * @return {string} The text getter.
+ */
+org.apache.flex.svg.staticControls.TextButton.prototype.get_text = function() {
+    return this.element.innerHTML;
+};
+
+/**
+ * @expose
+ * @this {org.apache.flex.svg.staticControls.TextButton}
+ * @param {string} value The text setter.
+ */
+org.apache.flex.svg.staticControls.TextButton.prototype.set_text =
+    function(value) {
+    this.element.innerHTML = value;
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/73777063/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/skins/TextButtonSkin.svg
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/skins/TextButtonSkin.svg
b/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/skins/TextButtonSkin.svg
new file mode 100644
index 0000000..51be9eb
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/svg/staticControls/skins/TextButtonSkin.svg
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" class="button" width="100%" height="100%"

+	onload="return init(evt)"
+	onmouseover="return handleMouseOver(evt)" 
+	onmousedown="return handleMouseDown(evt)" 
+	onmouseup="return handleMouseUp(evt)" 
+	onmouseout="return handleMouseOut(evt)"
+	onclick="handleOnClick(evt)"
+	>
+	<style type="text/css">
+		.button {cursor: pointer;}
+	</style>
+  
+  <script type="text/ecmascript">
+	<![CDATA[
+		
+		var labelStr = "";
+		var clickHandler;
+		
+		function init(event)
+		{
+			//Set Initial button state
+			document.getElementById("button_up").style.display="inline";
+			document.getElementById("button_over").style.display="none";
+			document.getElementById("button_down").style.display="none";
+			
+			//Set label from the embed's frameElement.attributes values
+			labelStr = window.frameElement.attributes["label"].value;
+			var labelElement = document.getElementById("labelDisplay");
+			labelElement.firstChild.nodeValue = labelStr;
+			
+			//Store callbacks
+			clickHandler = window.frameElement.attributes["onclick"].value;
+		}
+	
+		function handleMouseOver(event)
+		{
+			document.getElementById("button_up").style.display="none";
+			document.getElementById("button_over").style.display="inline";
+			document.getElementById("button_down").style.display="none";
+		}
+		
+		function handleMouseDown(event)
+		{
+			document.getElementById("button_up").style.display="none";
+			document.getElementById("button_over").style.display="none";
+			document.getElementById("button_down").style.display="inline";
+		}
+		
+		function handleMouseUp(event)
+		{
+			document.getElementById("button_up").style.display="none";
+			document.getElementById("button_over").style.display="inline";
+			document.getElementById("button_down").style.display="none";
+		}
+		
+		function handleMouseOut(event)
+		{
+			document.getElementById("button_up").style.display="inline";
+			document.getElementById("button_over").style.display="none";
+			document.getElementById("button_down").style.display="none";
+		}
+		
+		function handleOnClick(evt)
+		{
+			top[clickHandler](evt,this);
+		}
+
+	]]></script>
+	<svg xmlns="http://www.w3.org/2000/svg" id="button_up" width="100%" height="100%" version="1.1"
>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="-1" right="-1" top="-1"
bottom="-1">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientx63x32" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#000000" stop-opacity="0.01" />
+					<stop offset="1" stop-color="#000000" stop-opacity="0.07" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_shadow" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_up_idLinearGradientx63x32)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientx63x54" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#FFFFFF" stop-opacity="0.85" />
+					<stop offset="1" stop-color="#D8D8D8" stop-opacity="0.85" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_fill" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_up_idLinearGradientx63x54)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientx63x76" x1="0%" y1="100%" x2="0%" y2="0%">
+					<stop offset="0.0" stop-color="#000000" stop-opacity="0.0627" />
+					<stop offset="0.48" stop-color="#000000" stop-opacity="0.0099" />
+					<stop offset="0.48001" stop-color="#000000" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_lowlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_up_idLinearGradientx63x76)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientx63x100" gradientTransform="rotate(90)">
+					<stop offset="0.0" stop-color="#FFFFFF" stop-opacity="0.33" />
+					<stop offset="0.48" stop-color="#FFFFFF" stop-opacity="0.33" />
+					<stop offset="0.48001" stop-color="#FFFFFF" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_highlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_up_idLinearGradientx63x100)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientStrokex63x129" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#FFFFFF" />
+					<stop offset="1" stop-color="#D8D8D8" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_highlightStroke" rx="2" ry="2" width="100%" height="100%" fill="none"
style="stroke-width:2;stroke:url(#button_up_idLinearGradientStrokex63x129)" />
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="0" right="0" top="0"
bottom="0">
+			<defs>
+				<linearGradient id="button_up_idLinearGradientStrokex63x205" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#000000" stop-opacity="0.5625" />
+					<stop offset="1" stop-color="#000000" stop-opacity="0.75" />
+				</linearGradient>
+			</defs>
+			<rect id="button_up_border" rx="2" ry="2" width="100%" height="100%" fill="none" style="stroke-width:2;stroke:url(#button_up_idLinearGradientStrokex63x205)"
/>
+		</svg>
+	</svg>
+
+	<svg xmlns="http://www.w3.org/2000/svg" id="button_over" width="100%" height="100%" version="1.1"
>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="-1" right="-1" top="-1"
bottom="-1">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientx63x32" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#000000" stop-opacity="0.01" />
+					<stop offset="1" stop-color="#000000" stop-opacity="0.07" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_shadow" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_over_idLinearGradientx63x32)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientx63x54" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#BBBDBD" stop-opacity="0.85" />
+					<stop offset="1" stop-color="#9FA0A1" stop-opacity="0.85" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_fill" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_over_idLinearGradientx63x54)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientx63x76" x1="0%" y1="100%" x2="0%"
y2="0%">
+					<stop offset="0.0" stop-color="#000000" stop-opacity="0.0627" />
+					<stop offset="0.48" stop-color="#000000" stop-opacity="0.0099" />
+					<stop offset="0.48001" stop-color="#000000" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_lowlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_over_idLinearGradientx63x76)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientx63x100" gradientTransform="rotate(90)">
+					<stop offset="0.0" stop-color="#FFFFFF" stop-opacity="0.22" />
+					<stop offset="0.48" stop-color="#FFFFFF" stop-opacity="0.22" />
+					<stop offset="0.48001" stop-color="#FFFFFF" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_highlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_over_idLinearGradientx63x100)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientStrokex63x129" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#FFFFFF" stop-opacity="0.22" />
+					<stop offset="1" stop-color="#D8D8D8" stop-opacity="0.22" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_highlightStroke" rx="2" ry="2" width="100%" height="100%" fill="none"
style="stroke-width:2;stroke:url(#button_over_idLinearGradientStrokex63x129)" />
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="0" right="0" top="0"
bottom="0">
+			<defs>
+				<linearGradient id="button_over_idLinearGradientStrokex63x205" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#000000" stop-opacity="0.5625" />
+					<stop offset="1" stop-color="#000000" stop-opacity="0.75" />
+				</linearGradient>
+			</defs>
+			<rect id="button_over_border" width="100%" height="100%" rx="2" ry="2" fill="none"
style="stroke-width:2;stroke:url(#button_over_idLinearGradientStrokex63x205)" />
+		</svg>
+	</svg>
+	<svg xmlns="http://www.w3.org/2000/svg" id="button_down" width="100%" height="100%" version="1.1"
>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="-1" right="-1" top="-1"
bottom="-1">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientx63x32" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#FFFFFF" stop-opacity="0" />
+					<stop offset="1" stop-color="#FFFFFF" stop-opacity="0.5" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_shadow" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_down_idLinearGradientx63x32)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientx63x54" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#AAAAAA" stop-opacity="0.85" />
+					<stop offset="1" stop-color="#929496" stop-opacity="0.85" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_fill" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_down_idLinearGradientx63x54)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientx63x76" x1="0%" y1="100%" x2="0%"
y2="0%">
+					<stop offset="0.0" stop-color="#000000" stop-opacity="0.0627" />
+					<stop offset="0.48" stop-color="#000000" stop-opacity="0.0099" />
+					<stop offset="0.48001" stop-color="#000000" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_lowlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_down_idLinearGradientx63x76)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientx63x100" gradientTransform="rotate(90)">
+					<stop offset="0.0" stop-color="#FFFFFF" stop-opacity="0.12" />
+					<stop offset="0.48" stop-color="#FFFFFF" stop-opacity="0.12" />
+					<stop offset="0.48001" stop-color="#FFFFFF" stop-opacity="0" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_highlight" rx="2" ry="2" width="100%" height="100%" style="fill:url(#button_down_idLinearGradientx63x100)"
/>
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="1" right="1" top="1"
bottom="1">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientStrokex63x149" gradientTransform="rotate(90)">
+					<stop offset="0.0" stop-color="#000000" stop-opacity="0.25" />
+					<stop offset="0.001" stop-color="#000000" stop-opacity="0.25" />
+					<stop offset="0.0011" stop-color="#000000" stop-opacity="0.07" />
+					<stop offset="0.965" stop-color="#000000" stop-opacity="0.07" />
+					<stop offset="0.9651" stop-color="#000000" stop-opacity="0.00" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_hldownstroke1" rx="2" ry="2" width="100%" height="100%" fill="none"
style="stroke-width:2;stroke:url(#button_down_idLinearGradientStrokex63x149)" />
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="2" right="2" top="2"
bottom="2">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientStrokex63x182" gradientTransform="rotate(90)">
+					<stop offset="0.0" stop-color="#000000" stop-opacity="0.09" />
+					<stop offset="0.0001" stop-color="#000000" stop-opacity="0.00" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_hldownstroke2" rx="2" ry="2" width="100%" height="100%" fill="none"
style="stroke-width:2;stroke:url(#button_down_idLinearGradientStrokex63x182)" />
+		</svg>
+		<svg xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" left="0" right="0" top="0"
bottom="0">
+			<defs>
+				<linearGradient id="button_down_idLinearGradientStrokex63x205" gradientTransform="rotate(90)">
+					<stop offset="0" stop-color="#000000" stop-opacity="0.6375" />
+					<stop offset="1" stop-color="#000000" stop-opacity="0.85" />
+				</linearGradient>
+			</defs>
+			<rect id="button_down_border" width="100%" height="100%" rx="2" ry="2" fill="none"
style="stroke-width:2;stroke:url(#button_down_idLinearGradientStrokex63x205)" />
+		</svg>
+	</svg>
+	<svg id="labelDisplaySVG" xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"
version="1.1" >
+		<text id="labelDisplay" text-anchor="middle" font-family="verdana" font-size="12" dy=".3em"
x="50%" y="50%" > </text>
+	</svg>
+	<rect id="mouse_catcher" width="100%" height="100%" fill="none" pointer-events="all"/>
+</svg>
\ No newline at end of file


Mime
View raw message