You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ti...@apache.org on 2012/02/03 14:59:44 UTC
svn commit: r1240174 - in /incubator/flex/whiteboard/tink/navigators:
examples/src/TimeMachineLayoutExamples.mxml
src/ws/tink/spark/layouts/TimeMachineLayout.as
Author: tink
Date: Fri Feb 3 13:59:43 2012
New Revision: 1240174
URL: http://svn.apache.org/viewvc?rev=1240174&view=rev
Log:
Added depthColorAlpha property.
Modified:
incubator/flex/whiteboard/tink/navigators/examples/src/TimeMachineLayoutExamples.mxml
incubator/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/TimeMachineLayout.as
Modified: incubator/flex/whiteboard/tink/navigators/examples/src/TimeMachineLayoutExamples.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/tink/navigators/examples/src/TimeMachineLayoutExamples.mxml?rev=1240174&r1=1240173&r2=1240174&view=diff
==============================================================================
--- incubator/flex/whiteboard/tink/navigators/examples/src/TimeMachineLayoutExamples.mxml (original)
+++ incubator/flex/whiteboard/tink/navigators/examples/src/TimeMachineLayoutExamples.mxml Fri Feb 3 13:59:43 2012
@@ -3,8 +3,7 @@
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:st="library://ns.tink.ws/flex/spark"
- xmlns:local="*" viewSourceURL="srcview/index.html"
- >
+ viewSourceURL="srcview/index.html">
<fx:Library>
<fx:Definition name="Divider">
@@ -44,9 +43,9 @@
<st:NavigatorGroup id="navigatorGroup">
<st:layout>
- <st:TimeMachineLayout numVisibleElements="{numVisibleElements.value}"
+ <st:TimeMachineLayout numVisibleElements="{numVisibleElements.value}" maximumZ="{maximumZ.value}"
depthColor="{useDepthColor.selected ? depthColor.selectedColor : -1}"
- maximumZ="{maximumZ.value}"
+ depthColorAlpha="{depthColorAlpha.value}"
horizontalDisplacement="{horizontalDisplacement.value}"
verticalDisplacement="{verticalDisplacement.value}"
horizontalAlign="{horizontalAlign.selectedItem}"
@@ -109,9 +108,9 @@
<s:layout>
<st:TimeMachineLayout selectedIndex="{list.selectedIndex}"
- numVisibleElements="{numVisibleElements.value}"
+ numVisibleElements="{numVisibleElements.value}" maximumZ="{maximumZ.value}"
depthColor="{useDepthColor.selected ? depthColor.selectedColor : -1}"
- maximumZ="{maximumZ.value}"
+ depthColorAlpha="{depthColorAlpha.value}"
horizontalDisplacement="{horizontalDisplacement.value}"
verticalDisplacement="{verticalDisplacement.value}"
horizontalAlign="{horizontalAlign.selectedItem}"
Modified: incubator/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/TimeMachineLayout.as
URL: http://svn.apache.org/viewvc/incubator/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/TimeMachineLayout.as?rev=1240174&r1=1240173&r2=1240174&view=diff
==============================================================================
--- incubator/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/TimeMachineLayout.as (original)
+++ incubator/flex/whiteboard/tink/navigators/src/ws/tink/spark/layouts/TimeMachineLayout.as Fri Feb 3 13:59:43 2012
@@ -226,6 +226,47 @@ package ws.tink.spark.layouts
//----------------------------------
+ // depthColorAlpha
+ //----------------------------------
+
+ /**
+ * @private
+ * Storage property for depthColorAlpha.
+ */
+ private var _depthColorAlpha : Number = 1;
+
+ [Inspectable(category="General", defaultValue="1")]
+
+ /**
+ * The alpha to be used for the color tint that is applied to elements
+ * as their are moved back on the z axis.
+ *
+ * @default 1
+ *
+ * @see #depthColor
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get depthColorAlpha():Number
+ {
+ return _depthColorAlpha;
+ }
+ /**
+ * @private
+ */
+ public function set depthColorAlpha( value:Number ) : void
+ {
+ if( _depthColorAlpha == value ) return;
+
+ _depthColorAlpha = value;
+ invalidateTargetDisplayList();
+ }
+
+
+ //----------------------------------
// verticalAlign
//----------------------------------
@@ -592,7 +633,7 @@ package ws.tink.spark.layouts
*/
protected function transformElement( element:IVisualElement, viewIndex:int, indexOffset:Number, alphaDeltaOffset:Number, zDeltaOffset:Number, isFirst:Boolean ):void
{
- var colorValue:Number = ( ( _colorDelta * viewIndex ) - alphaDeltaOffset );
+ var colorValue:Number = ( ( _colorDelta * viewIndex ) - alphaDeltaOffset ) * ( depthColorAlpha / 100 );
setElementLayoutBoundsSize( element, false );
element.depth = numIndicesInView - ( viewIndex + 1 );
@@ -780,7 +821,6 @@ package ws.tink.spark.layouts
*/
override protected function updateDisplayListReal():void
{
- trace( "real" );
super.updateDisplayListReal();
// var prevVirtualElements:Vector.<IVisualElement> = ( _visibleElements ) ? _visibleElements.concat() : new Vector.<IVisualElement>();