incubator-flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From que...@apache.org
Subject svn commit: r1408090 - in /incubator/flex/sdk/branches/develop: frameworks/projects/framework/src/mx/printing/ mustella/tests/Printing/ mustella/tests/Printing/Properties/ mustella/tests/Printing/SWFs/
Date Sun, 11 Nov 2012 19:27:46 GMT
Author: quetwo
Date: Sun Nov 11 19:27:45 2012
New Revision: 1408090

URL: http://svn.apache.org/viewvc?rev=1408090&view=rev
Log:
Patch from JIRA FLEX-29017.  Makes change to FlexPrintJob to expose the PrintJob private member.
 Also adds Mustella tests for FlexPrintJob.

Added:
    incubator/flex/sdk/branches/develop/mustella/tests/Printing/
    incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/
    incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/PrintJob_Properties.mxml
    incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/
    incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/FlexPrintJob_Basic.mxml
Modified:
    incubator/flex/sdk/branches/develop/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as

Modified: incubator/flex/sdk/branches/develop/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as?rev=1408090&r1=1408089&r2=1408090&view=diff
==============================================================================
--- incubator/flex/sdk/branches/develop/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as
(original)
+++ incubator/flex/sdk/branches/develop/frameworks/projects/framework/src/mx/printing/FlexPrintJob.as
Sun Nov 11 19:27:45 2012
@@ -80,17 +80,29 @@ public class FlexPrintJob
     //  Properties
     //
     //--------------------------------------------------------------------------
+	
+	//----------------------------------
+	//  printJob
+	//----------------------------------
 
     /**
      *  @private
+	 *  Storage for the printJob property.
      */
-    private var printJob:PrintJob = new PrintJob();
-
-    //--------------------------------------------------------------------------
-    //
-    //  Properties
-    //
-    //--------------------------------------------------------------------------
+    private var _printJob:PrintJob = new PrintJob();
+	
+	/**
+	 *  The printJob property; 
+	 *  
+	 *  @langversion 3.0
+	 *  @playerversion Flash 9
+	 *  @playerversion AIR 1.1
+	 *  @productversion Flex 4.9
+	 */
+	public function get printJob():PrintJob
+	{
+		return _printJob;
+	}
 
     //----------------------------------
     //  pageHeight
@@ -205,12 +217,12 @@ public class FlexPrintJob
      */
     public function start():Boolean
     {
-        var ok:Boolean = printJob.start();
+        var ok:Boolean = _printJob.start();
         
         if (ok)
         {
-            _pageWidth = printJob.pageWidth;
-            _pageHeight = printJob.pageHeight;
+            _pageWidth = _printJob.pageWidth;
+            _pageHeight = _printJob.pageHeight;
         }
         
         return ok;
@@ -443,7 +455,7 @@ public class FlexPrintJob
                 var printJobOptions:PrintJobOptions = new PrintJobOptions();
                 printJobOptions.printAsBitmap = _printAsBitmap;
 
-                printJob.addPage(Sprite(obj), r, printJobOptions);
+                _printJob.addPage(Sprite(obj), r, printJobOptions);
             }
         }
 
@@ -540,7 +552,7 @@ public class FlexPrintJob
      */
     public function send():void
     {
-        printJob.send();
+        _printJob.send();
     }
 
     /**

Added: incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/PrintJob_Properties.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/PrintJob_Properties.mxml?rev=1408090&view=auto
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/PrintJob_Properties.mxml
(added)
+++ incubator/flex/sdk/branches/develop/mustella/tests/Printing/Properties/PrintJob_Properties.mxml
Sun Nov 11 19:27:45 2012
@@ -0,0 +1,57 @@
+<?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.
+
+-->
+<UnitTester testDir="Printing/Properties/"  xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*" testSWF="FlexPrintJob_Basic.mxml">
+
+	<!-- this set of lines Alert a template that must be in each unit test -->
+	<mx:Script>
+	<![CDATA[
+	public static function init(o:DisplayObject):void
+	{
+	}
+	]]>
+	</mx:Script>
+	<mx:Metadata>
+	<![CDATA[
+		[Mixin]
+	]]>
+	</mx:Metadata>
+	<!-- end of set of lines that must be in each unit test -->
+
+	<mx:Script>
+	<![CDATA[
+			import mx.printing.FlexPrintJob;
+			import mx.controls.Alert;
+	]]>
+	</mx:Script>
+
+	<testCases>
+
+		<TestCase testID="PrintJob_Properties_default_orientation" description="Tests if the
printJob property of FlexPrintJob can be accessed"  keywords="[FlexPrintJob, PrintJob]">
+			<setup>
+				<RunCode code="application.fPrintJob = new FlexPrintJob()" />
+				<RunCode code="application.setOrientation()" />
+			</setup>
+			<body>
+                <AssertPropertyValue target="printJobOrientation" propertyName="text"
 value="0" />
+			</body>  
+		</TestCase>
+
+	</testCases>
+</UnitTester>

Added: incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/FlexPrintJob_Basic.mxml
URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/FlexPrintJob_Basic.mxml?rev=1408090&view=auto
==============================================================================
--- incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/FlexPrintJob_Basic.mxml
(added)
+++ incubator/flex/sdk/branches/develop/mustella/tests/Printing/SWFs/FlexPrintJob_Basic.mxml
Sun Nov 11 19:27:45 2012
@@ -0,0 +1,41 @@
+<?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.
+
+-->
+<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" backgroundColor="0xFFFFFF"
+	width="750" height="600" >
+	
+	<mx:Script>
+		<![CDATA[
+			import mx.printing.FlexPrintJob;
+			import mx.controls.Alert;
+			
+			public var fPrintJob : FlexPrintJob;
+
+			public function setOrientation():void
+			{
+				printJobOrientation.text = fPrintJob.printJob.orientation;
+			}
+			
+		]]>
+	</mx:Script>	
+		
+	<mx:Label id="printJobOrientation" text="No" />
+	
+</mx:Application>
+- 



Mime
View raw message