test_poly.html 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. <!--
  10. The next line should include Microsoft's Silverligth.js, if you plan to use the silverlight backend
  11. <script type="text/javascript" src="Silverlight.js"></script>
  12. -->
  13. <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug: true"></script>
  14. <script type="text/javascript" src="../_base.js"></script>
  15. <script type="text/javascript" src="../shape.js"></script>
  16. <script type="text/javascript" src="../path.js"></script>
  17. <script type="text/javascript" src="../arc.js"></script>
  18. <!--<script type="text/javascript" src="../vml.js"></script>-->
  19. <!--<script type="text/javascript" src="../svg.js"></script>-->
  20. <!--<script type="text/javascript" src="../canvas.js"></script>-->
  21. <!--<script type="text/javascript" src="../silverlight.js"></script>-->
  22. <script type="text/javascript">
  23. dojo.require("dojox.gfx");
  24. makeShapes = function(){
  25. var surface = dojox.gfx.createSurface("test", 500, 500);
  26. var line = surface.createLine({x1: 250, y1: 50, x2: 250, y2: 250})
  27. .setStroke({color: "blue"})
  28. ;
  29. var poly = surface.createPolyline([{x: 250, y: 250}, {x: 300, y: 300}, {x: 250, y: 350}, {x: 200, y: 300}, {x: 250, y: 250}])
  30. .setStroke({color: "blue"})
  31. ;
  32. var rotate = dojox.gfx.matrix.rotategAt(5, 250, 250);
  33. //var rotate = dojox.gfx.matrix.rotategAt(0.4, 250, 250);
  34. window.setInterval(function() {
  35. line.applyTransform(rotate);
  36. poly.applyTransform(rotate);
  37. },
  38. 100
  39. );
  40. };
  41. dojo.addOnLoad(makeShapes);
  42. </script>
  43. </head>
  44. <body>
  45. <h1>dojox.gfx Polyline test</h1>
  46. <div id="test" style="width: 500px; height: 500px;"></div>
  47. <p>That's all Folks!</p>
  48. </body>
  49. </html>