test_linestyle.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
  2. <head>
  3. <title>Dojo Unified 2D Graphics</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="../vml.js"></script>-->
  18. <!--<script type="text/javascript" src="../svg.js"></script>-->
  19. <!--<script type="text/javascript" src="../silverlight.js"></script>-->
  20. <script type="text/javascript">
  21. dojo.require("dojox.gfx");
  22. makeShapes = function(){
  23. var surface = dojox.gfx.createSurface(document.getElementById("test"), 500, 500);
  24. var styles = ["none", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot",
  25. "Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"];
  26. var font = "normal normal normal 10pt Arial"; // CSS font style
  27. var y_offset = dojox.gfx.normalizedLength("4pt");
  28. for(var i = 0; i < styles.length; ++i){
  29. var y = 20 + i * 20;
  30. surface.createText({x: 140, y: y + y_offset, text: styles[i], align: "end"}).setFont(font).setFill("black");
  31. surface.createLine({x1: 150, y1: y, x2: 490, y2: y}).setStroke({style: styles[i], width: 3, cap: "round"});
  32. }
  33. };
  34. dojo.addOnLoad(makeShapes);
  35. </script>
  36. </head>
  37. <body>
  38. <h1>dojox.gfx: Line style test</h1>
  39. <div id="test"></div>
  40. <p>That's all Folks!</p>
  41. </body>
  42. </html>