| 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 |
<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="isDebug: true"></script> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
<script type="text/javascript"> |
| 17 |
dojo.require("dojox.gfx"); |
| 18 |
|
| 19 |
createSurface = function(){ |
| 20 |
var surface = dojox.gfx.createSurface("test", 500, 500); |
| 21 |
surface.whenLoaded(makeShapes); |
| 22 |
}; |
| 23 |
|
| 24 |
makeShapes = function(surface){ |
| 25 |
var styles = ["none", "Solid", "ShortDash", "ShortDot", "ShortDashDot", "ShortDashDotDot", |
| 26 |
"Dot", "Dash", "LongDash", "DashDot", "LongDashDot", "LongDashDotDot"]; |
| 27 |
var font = "normal normal normal 10pt Arial"; // CSS font style |
| 28 |
var y_offset = dojox.gfx.normalizedLength("4pt"); |
| 29 |
for(var i = 0; i < styles.length; ++i){ |
| 30 |
var y = 20 + i * 20; |
| 31 |
surface.createText({x: 140, y: y + y_offset, text: styles[i], align: "end"}).setFont(font).setFill("black"); |
| 32 |
surface.createLine({x1: 150, y1: y, x2: 490, y2: y}).setStroke({style: styles[i], width: 3, cap: "round"}); |
| 33 |
} |
| 34 |
}; |
| 35 |
|
| 36 |
dojo.addOnLoad(createSurface); |
| 37 |
|
| 38 |
</script> |
| 39 |
</head> |
| 40 |
<body> |
| 41 |
<h1>dojox.gfx: Line style test</h1> |
| 42 |
<div id="test"></div> |
| 43 |
<p>That's all Folks!</p> |
| 44 |
</body> |
| 45 |
</html> |