2150 |
mathias |
1 |
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" >
|
|
|
2 |
<head>
|
|
|
3 |
<title>Testing arc</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 |
|
|
|
25 |
makeShapes = function(){
|
|
|
26 |
var surface = dojox.gfx.createSurface("test", 500, 500);
|
|
|
27 |
|
|
|
28 |
var m = dojox.gfx.matrix;
|
|
|
29 |
var g1 = surface.createGroup();
|
|
|
30 |
var g2 = g1.createGroup();
|
|
|
31 |
|
|
|
32 |
var rx = 100, ry = 60, xRotg = -30;
|
|
|
33 |
var startPoint = m.multiplyPoint(m.rotateg(xRotg), {x: -rx, y: 0 });
|
|
|
34 |
var endPoint = m.multiplyPoint(m.rotateg(xRotg), {x: 0, y: -ry});
|
|
|
35 |
|
|
|
36 |
var re1 = g1.createPath()
|
|
|
37 |
.moveTo(startPoint)
|
|
|
38 |
.arcTo(rx, ry, xRotg, true, false, endPoint)
|
|
|
39 |
.setStroke({color: "red", width: 3})
|
|
|
40 |
;
|
|
|
41 |
var ge1 = g1.createPath()
|
|
|
42 |
.moveTo(re1.getLastPosition())
|
|
|
43 |
.arcTo(rx, ry, xRotg, false, false, startPoint)
|
|
|
44 |
.setStroke({color: "black"})
|
|
|
45 |
;
|
|
|
46 |
var re2 = g2.createPath()
|
|
|
47 |
.moveTo(startPoint)
|
|
|
48 |
.arcTo(rx, ry, xRotg, false, true, endPoint)
|
|
|
49 |
.setStroke({color: "green", width: 3})
|
|
|
50 |
;
|
|
|
51 |
var ge2 = g2.createPath()
|
|
|
52 |
.moveTo(re2.getLastPosition())
|
|
|
53 |
.arcTo(rx, ry, xRotg, true, true, startPoint)
|
|
|
54 |
.setStroke({color: "black"})
|
|
|
55 |
;
|
|
|
56 |
|
|
|
57 |
g1.setTransform({dx: 200, dy: 200});
|
|
|
58 |
g2.setTransform({dx: 10, dy: 10});
|
|
|
59 |
};
|
|
|
60 |
|
|
|
61 |
dojo.addOnLoad(makeShapes);
|
|
|
62 |
|
|
|
63 |
</script>
|
|
|
64 |
</head>
|
|
|
65 |
<body>
|
|
|
66 |
<h1>Testing arc</h1>
|
|
|
67 |
<!--<p><button onclick="makeShapes();">Go</button></p>-->
|
|
|
68 |
<div id="test" style="width: 500px; height: 500px;"></div>
|
|
|
69 |
<p>That's all Folks!</p>
|
|
|
70 |
</body>
|
|
|
71 |
</html>
|