flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [38/51] [partial] this folder was called TourDeFlex_content.com and was hidden by .gitignore
Date Fri, 01 Aug 2014 05:43:59 GMT
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/d43c133c/TourDeFlex/TourDeFlex_content/flex4.0/CustomLayout-FlickrWheel/srcview/source/NumberInterpolatorWrapping.as.html
----------------------------------------------------------------------
diff --git a/TourDeFlex/TourDeFlex_content/flex4.0/CustomLayout-FlickrWheel/srcview/source/NumberInterpolatorWrapping.as.html
b/TourDeFlex/TourDeFlex_content/flex4.0/CustomLayout-FlickrWheel/srcview/source/NumberInterpolatorWrapping.as.html
new file mode 100644
index 0000000..b20402e
--- /dev/null
+++ b/TourDeFlex/TourDeFlex_content/flex4.0/CustomLayout-FlickrWheel/srcview/source/NumberInterpolatorWrapping.as.html
@@ -0,0 +1,118 @@
+<!--
+  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.
+-->
+<!-- saved from url=(0014)about:internet -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<title>NumberInterpolatorWrapping.as</title>
+<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
+</head>
+
+<body><pre><span class="ActionScriptpackage">package</span>
+<span class="ActionScriptBracket/Brace">{</span>
+<span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">spark</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">effects</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">interpolation</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">IInterpolator</span>;
+    
+<span class="ActionScriptReserved">public</span> <span class="ActionScriptclass">class</span>
<span class="ActionScriptDefault_Text">NumberInterpolatorWrapping</span> <span
class="ActionScriptReserved">implements</span> <span class="ActionScriptDefault_Text">IInterpolator</span>
+<span class="ActionScriptBracket/Brace">{</span>
+    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span>:<span class="ActionScriptDefault_Text">Number</span>;
+    <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span>
<span class="ActionScriptDefault_Text">_rangeEnd</span>:<span class="ActionScriptDefault_Text">Number</span>;
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptDefault_Text">NumberInterpolatorWrapping</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">rangeBegin</span>:<span
class="ActionScriptDefault_Text">Number</span><span class="ActionScriptOperator">,</span>
<span class="ActionScriptDefault_Text">rangeEnd</span>:<span class="ActionScriptDefault_Text">Number</span><span
class="ActionScriptBracket/Brace">)</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptDefault_Text">_rangeBegin</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">rangeBegin</span>;
+        <span class="ActionScriptDefault_Text">_rangeEnd</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">rangeEnd</span>;
+    <span class="ActionScriptBracket/Brace">}</span>
+        
+    <span class="ActionScriptASDoc">/**
+     * Returns the type that an implementor can handle
+     */</span>
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptReserved">get</span> <span class="ActionScriptDefault_Text">interpolatedType</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptBracket/Brace">)</span>:<span
class="ActionScriptDefault_Text">Class</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">Number</span>;
+    <span class="ActionScriptBracket/Brace">}</span>
+    
+    <span class="ActionScriptASDoc">/**
+     * Given an elapsed fraction of an animation between 0 and 1,
+     * and start and end values, this function returns some value
+     * based on whatever interpolation the implementor chooses to
+     * provide.
+     */</span>
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptDefault_Text">interpolate</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">fraction</span>:<span class="ActionScriptDefault_Text">Number</span><span
class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">startValue</span>:<span
class="ActionScriptDefault_Text">Object</span><span class="ActionScriptOperator">,</span>
<span class="ActionScriptDefault_Text">endValue</span>:<span class="ActionScriptDefault_Text">Object</span><span
class="ActionScriptBracket/Brace">)</span>:<span class="ActionScriptDefault_Text">Object</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">fraction</span> <span class="ActionScriptOperator">==</span>
0<span class="ActionScriptBracket/Brace">)</span>
+            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">startValue</span>;
+        <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span>
<span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">fraction</span>
<span class="ActionScriptOperator">==</span> 1<span class="ActionScriptBracket/Brace">)</span>
+            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">endValue</span>;
+        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">start</span>:<span
class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">startValue</span><span class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">end</span>:<span
class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">endValue</span><span class="ActionScriptBracket/Brace">)</span>;
+
+        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">end</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">start</span><span class="ActionScriptBracket/Brace">)</span>
<span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">Math</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">abs</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_rangeEnd</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">_rangeBegin</span><span
class="ActionScriptBracket/Brace">)</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScript
 Default_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">end</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">start</span><span class="ActionScriptBracket/Brace">)</span><span
class="ActionScriptBracket/Brace">)</span>
+        <span class="ActionScriptBracket/Brace">{</span>
+            <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">start</span>
<span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">fraction</span>
<span class="ActionScriptOperator">*</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">end</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">start</span><span class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptBracket/Brace">}</span>
+        <span class="ActionScriptReserved">else</span>
+        <span class="ActionScriptBracket/Brace">{</span>
+            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">result</span>:<span
class="ActionScriptDefault_Text">Number</span>;
+            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">start</span> <span class="ActionScriptOperator">&lt;</span>
<span class="ActionScriptDefault_Text">end</span><span class="ActionScriptBracket/Brace">)</span>
+            <span class="ActionScriptBracket/Brace">{</span>
+                <span class="ActionScriptDefault_Text">result</span> <span
class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">start</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">fraction</span>
<span class="ActionScriptOperator">*</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">_rangeEnd</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">start</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">end</span><span class="ActionScriptBracket/Brace">)</span><span
class="ActionScriptBracket/Brace">)</span>;
+                <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">&lt;</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span><span class="ActionScriptBracket/Brace">)</span>
+                    <span class="ActionScriptDefault_Text">result</span> <span
class="ActionScriptOperator">+=</span> <span class="ActionScriptDefault_Text">_rangeEnd</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">_rangeBegin</span>;
+                <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">result</span>;
+            <span class="ActionScriptBracket/Brace">}</span>
+            <span class="ActionScriptReserved">else</span>
+            <span class="ActionScriptBracket/Brace">{</span>
+                <span class="ActionScriptDefault_Text">result</span> <span
class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">start</span>
<span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">fraction</span>
<span class="ActionScriptOperator">*</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">_rangeEnd</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">start</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">end</span><span class="ActionScriptBracket/Brace">)</span><span
class="ActionScriptBracket/Brace">)</span>;
+                <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">&gt;</span>
<span class="ActionScriptDefault_Text">_rangeEnd</span><span class="ActionScriptBracket/Brace">)</span>
+                    <span class="ActionScriptDefault_Text">result</span> <span
class="ActionScriptOperator">-=</span> <span class="ActionScriptDefault_Text">_rangeEnd</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">_rangeBegin</span>;
+                <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">result</span>;
+            <span class="ActionScriptBracket/Brace">}</span>
+        <span class="ActionScriptBracket/Brace">}</span>        
+    <span class="ActionScriptBracket/Brace">}</span>
+    
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptDefault_Text">increment</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">baseValue</span>:<span class="ActionScriptDefault_Text">Object</span><span
class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">incrementValue</span>:<span
class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">)</span>:<span
class="ActionScriptDefault_Text">Object</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">result</span>:<span
class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">baseValue</span><span class="ActionScriptBracket/Brace">)</span>
<span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">Number</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">incrementValue</span><span
class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptComment">// This won't handle situations where we're
adding more than
+</span>        <span class="ActionScriptComment">// the range itself, but since
this will only be called when
+</span>        <span class="ActionScriptComment">// the user submits a 'byValue'
that large, it seems unlikely
+</span>        <span class="ActionScriptComment">// at the very least
+</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">&gt;</span>
<span class="ActionScriptDefault_Text">_rangeEnd</span><span class="ActionScriptBracket/Brace">)</span>
+            <span class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span> <span class="ActionScriptOperator">+</span>
<span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">result</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">_rangeEnd</span><span
class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">result</span>;
+    <span class="ActionScriptBracket/Brace">}</span>
+    
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptDefault_Text">decrement</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">baseValue</span>:<span class="ActionScriptDefault_Text">Object</span><span
class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">decrementValue</span>:<span
class="ActionScriptDefault_Text">Object</span><span class="ActionScriptBracket/Brace">)</span>:<span
class="ActionScriptDefault_Text">Object</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">result</span>:<span
class="ActionScriptDefault_Text">Number</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">baseValue</span><span class="ActionScriptBracket/Brace">)</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">Number</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">decrementValue</span><span
class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptComment">// This won't handle situations where we're
subtracting more than
+</span>        <span class="ActionScriptComment">// the range itself, but since
this will only be called when
+</span>        <span class="ActionScriptComment">// the user submits a 'byValue'
that large, it seems unlikely
+</span>        <span class="ActionScriptComment">// at the very least
+</span>        <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">&lt;</span>
<span class="ActionScriptDefault_Text">_rangeBegin</span><span class="ActionScriptBracket/Brace">)</span>
+            <span class="ActionScriptDefault_Text">result</span> <span class="ActionScriptOperator">=</span>
<span class="ActionScriptDefault_Text">_rangeEnd</span> <span class="ActionScriptOperator">+</span>
<span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">_rangeBegin</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">result</span><span
class="ActionScriptBracket/Brace">)</span>;
+        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">result</span>;
+    <span class="ActionScriptBracket/Brace">}</span>
+    
+    <span class="ActionScriptReserved">public</span> <span class="ActionScriptfunction">function</span>
<span class="ActionScriptDefault_Text">getLength</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">startValue</span>:<span class="ActionScriptDefault_Text">Number</span><span
class="ActionScriptOperator">,</span> <span class="ActionScriptDefault_Text">endValue</span>:<span
class="ActionScriptDefault_Text">Number</span><span class="ActionScriptBracket/Brace">)</span>:<span
class="ActionScriptDefault_Text">Number</span>
+    <span class="ActionScriptBracket/Brace">{</span>
+        <span class="ActionScriptReserved">return</span> <span class="ActionScriptDefault_Text">Math</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">min</span><span
class="ActionScriptBracket/Brace">(</span> <span class="ActionScriptDefault_Text">Math</span><span
class="ActionScriptOperator">.</span><span class="ActionScriptDefault_Text">abs</span><span
class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">startValue</span>
<span class="ActionScriptOperator">-</span> <span class="ActionScriptDefault_Text">endValue</span><span
class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">,</span>
<span class="ActionScriptDefault_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">_rangeEnd</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScr
 iptDefault_Text">_rangeBegin</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">Math</span><span class="ActionScriptOperator">.</span><span
class="ActionScriptDefault_Text">abs</span><span class="ActionScriptBracket/Brace">(</span><span
class="ActionScriptDefault_Text">startValue</span> <span class="ActionScriptOperator">-</span>
<span class="ActionScriptDefault_Text">endValue</span><span class="ActionScriptBracket/Brace">)</span><span
class="ActionScriptBracket/Brace">)</span><span class="ActionScriptBracket/Brace">)</span>;
+    <span class="ActionScriptBracket/Brace">}</span>   
+
+<span class="ActionScriptBracket/Brace">}</span>
+<span class="ActionScriptBracket/Brace">}</span></pre></body>
+</html>


Mime
View raw message