1 | <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" > |
---|
2 | <head> |
---|
3 | <title>Testing polyline and line transforms</title> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
---|
5 | <style type="text/css"> |
---|
6 | @import "../../../dojo/resources/dojo.css"; |
---|
7 | @import "../../../dijit/tests/css/dijitTests.css"; |
---|
8 | </style> |
---|
9 | <script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script> |
---|
10 | <script type="text/javascript"> |
---|
11 | dojo.require("dojox.gfx"); |
---|
12 | dojo.require("dojox.gfx.shape"); |
---|
13 | dojo.require("dojox.gfx.path"); |
---|
14 | dojo.require("dojox.gfx.arc"); |
---|
15 | |
---|
16 | createSurface = function(){ |
---|
17 | var surface = dojox.gfx.createSurface("test", 500, 500); |
---|
18 | surface.whenLoaded(makeShapes); |
---|
19 | }; |
---|
20 | |
---|
21 | makeShapes = function(surface){ |
---|
22 | var line = surface.createLine({x1: 250, y1: 50, x2: 250, y2: 250}) |
---|
23 | .setStroke({color: "blue"}) |
---|
24 | ; |
---|
25 | var poly = surface.createPolyline([{x: 250, y: 250}, {x: 300, y: 300}, {x: 250, y: 350}, {x: 200, y: 300}, {x: 250, y: 250}]) |
---|
26 | .setStroke({color: "blue"}) |
---|
27 | ; |
---|
28 | var rotate = dojox.gfx.matrix.rotategAt(5, 250, 250); |
---|
29 | //var rotate = dojox.gfx.matrix.rotategAt(0.4, 250, 250); |
---|
30 | |
---|
31 | window.setInterval(function() { |
---|
32 | line.applyTransform(rotate); |
---|
33 | poly.applyTransform(rotate); |
---|
34 | }, |
---|
35 | 100 |
---|
36 | ); |
---|
37 | }; |
---|
38 | |
---|
39 | dojo.addOnLoad(createSurface); |
---|
40 | |
---|
41 | </script> |
---|
42 | </head> |
---|
43 | <body> |
---|
44 | <h1>dojox.gfx Polyline test</h1> |
---|
45 | <div id="test" style="width: 500px; height: 500px;"></div> |
---|
46 | <p>That's all Folks!</p> |
---|
47 | </body> |
---|
48 | </html> |
---|