| 1 |
<?xml version="1.0" standalone="no"?> |
| 2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" |
| 3 |
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> |
| 4 |
|
| 5 |
<!-- |
| 6 |
|
| 7 |
Licensed to the Apache Software Foundation (ASF) under one or more |
| 8 |
contributor license agreements. See the NOTICE file distributed with |
| 9 |
this work for additional information regarding copyright ownership. |
| 10 |
The ASF licenses this file to You under the Apache License, Version 2.0 |
| 11 |
(the "License"); you may not use this file except in compliance with |
| 12 |
the License. You may obtain a copy of the License at |
| 13 |
|
| 14 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 15 |
|
| 16 |
Unless required by applicable law or agreed to in writing, software |
| 17 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 18 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 19 |
See the License for the specific language governing permissions and |
| 20 |
limitations under the License. |
| 21 |
|
| 22 |
--> |
| 23 |
<!-- ====================================================================== --> |
| 24 |
<!-- check updates on gradients, filter, mask, and clip regarding to --> |
| 25 |
<!-- geometry updates --> |
| 26 |
<!-- --> |
| 27 |
<!-- @author [email protected] --> |
| 28 |
<!-- @version $Id$ --> |
| 29 |
<!-- ====================================================================== --> |
| 30 |
|
| 31 |
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| 32 |
|
| 33 |
<svg xmlns="http://www.w3.org/2000/svg" |
| 34 |
xmlns:xlink="http://www.w3.org/1999/xlink" |
| 35 |
id="body" width="450" height="500" viewBox="0 0 450 500"> |
| 36 |
|
| 37 |
<title>Marker with geometry updates</title> |
| 38 |
|
| 39 |
<text x="50%" y="25" class="title">Marker with geometry and property updates. |
| 40 |
<tspan x="50%" dy="1.1em" style="font-style:italic; font-size:12">(click on shapes or run button)</tspan></text> |
| 41 |
|
| 42 |
<script type="text/ecmascript"> |
| 43 |
|
| 44 |
var svgNamespaceURI = "http://www.w3.org/2000/svg"; |
| 45 |
var stroke = document.getElementById("stroke"); |
| 46 |
var userspace = document.getElementById("userspace"); |
| 47 |
var start = document.getElementById("start"); |
| 48 |
var mid = document.getElementById("mid"); |
| 49 |
var end = document.getElementById("end"); |
| 50 |
var all = document.getElementById("all"); |
| 51 |
|
| 52 |
function changeGeometryEvt(evt) { |
| 53 |
changeGeometry(evt.target); |
| 54 |
} |
| 55 |
function changeGeometry(tgt) { |
| 56 |
tgt.setAttribute("points", |
| 57 |
"130 150 150 170 110 190 150 210 110 230 150 250 110 270 150 290 110 310 150 330 110 350 130 370"); |
| 58 |
} |
| 59 |
|
| 60 |
function changeMarkerStartEvt(evt) { changeMarkerStart(evt.target); } |
| 61 |
function changeMarkerStart(tgt) { |
| 62 |
changeProperty(tgt, "marker-start", "url(#markerRed)"); |
| 63 |
} |
| 64 |
function changeMarkerMidEvt(evt) { changeMarkerMid(evt.target); } |
| 65 |
function changeMarkerMid(tgt) { |
| 66 |
changeProperty(tgt, "marker-mid", "url(#markerRed)"); |
| 67 |
} |
| 68 |
function changeMarkerEndEvt(evt) { changeMarkerEnd(evt.target); } |
| 69 |
function changeMarkerEnd(tgt) { |
| 70 |
changeProperty(tgt, "marker-end", "url(#markerRed)"); |
| 71 |
} |
| 72 |
function changeMarkerEvt(evt) { changeMarker(evt.target); } |
| 73 |
function changeMarker(tgt) { |
| 74 |
changeProperty(tgt, "marker", "url(#markerRed)"); |
| 75 |
} |
| 76 |
function changeProperty(tgt, prop, val) { |
| 77 |
tgt.style.setProperty(prop, val, ""); |
| 78 |
} |
| 79 |
|
| 80 |
function run() { |
| 81 |
changeGeometry(stroke); |
| 82 |
changeGeometry(userspace); |
| 83 |
changeMarkerStart(start); |
| 84 |
changeMarkerMid(mid); |
| 85 |
changeMarkerEnd(end); |
| 86 |
changeMarker(all); |
| 87 |
} |
| 88 |
|
| 89 |
function regardStart() { |
| 90 |
run(); |
| 91 |
setTimeout("regardTestInstance.scriptDone()", 100); |
| 92 |
} |
| 93 |
|
| 94 |
</script> |
| 95 |
|
| 96 |
<defs> |
| 97 |
|
| 98 |
<marker id="markerUserSpaceOnUse" refX="8" refY="8" markerUnits="userSpaceOnUse" markerWidth="16" markerHeight="16"> |
| 99 |
<circle cx="8" cy="8" r="8" style="fill:#aaa" /> |
| 100 |
</marker> |
| 101 |
|
| 102 |
<marker id="markerStrokeWidth" refX="2" refY="2" markerUnits="strokeWidth" markerWidth="4" markerHeight="4"> |
| 103 |
<circle cx="2" cy="2" r="2" style="fill:#aaa" /> |
| 104 |
</marker> |
| 105 |
|
| 106 |
<marker id="markerRed" refX="2" refY="2" markerUnits="strokeWidth" markerWidth="4" markerHeight="4"> |
| 107 |
<circle cx="2" cy="2" r="2" style="fill:#a44" /> |
| 108 |
</marker> |
| 109 |
</defs> |
| 110 |
|
| 111 |
<g id="test-content" transform="translate(0, -20)"> |
| 112 |
|
| 113 |
<g id="board" style="fill:none; stroke:black"> |
| 114 |
<rect x="40" y="80" width="65" height="20" style="fill:#eee"/> |
| 115 |
<rect x="105" y="80" width="65" height="20" style="fill:#eee"/> |
| 116 |
<rect x="170" y="80" width="65" height="20" style="fill:#eee"/> |
| 117 |
<rect x="235" y="80" width="65" height="20" style="fill:#eee"/> |
| 118 |
<rect x="300" y="80" width="65" height="20" style="fill:#eee"/> |
| 119 |
<rect x="365" y="80" width="65" height="20" style="fill:#eee"/> |
| 120 |
|
| 121 |
<rect x="20" y="100" width="20" height="380" style="fill:#eee"/> |
| 122 |
|
| 123 |
<rect x="40" y="100" width="65" height="380" /> |
| 124 |
<rect x="105" y="100" width="65" height="380" /> |
| 125 |
<rect x="170" y="100" width="65" height="380" /> |
| 126 |
<rect x="235" y="100" width="65" height="380" /> |
| 127 |
<rect x="300" y="100" width="65" height="380" /> |
| 128 |
<rect x="365" y="100" width="65" height="380" /> |
| 129 |
|
| 130 |
<g style="fill:black; stroke:none; text-anchor:middle"> |
| 131 |
<text x="72.5" y="94">strokeWidth</text> |
| 132 |
<text x="137.5" y="94">userspace<desc>userSpaceOnUse</desc></text> |
| 133 |
<text x="202.5" y="94">start</text> |
| 134 |
<text x="267.5" y="94">mid</text> |
| 135 |
<text x="332.5" y="94">end</text> |
| 136 |
<text x="397.5" y="94">marker</text> |
| 137 |
|
| 138 |
<text x="0" y="0" transform="translate(34 290)rotate(-90)"><marker></text> |
| 139 |
</g> |
| 140 |
</g> |
| 141 |
|
| 142 |
<polyline id="stroke" |
| 143 |
transform="translate(-55, 0)" onclick="changeGeometryEvt(evt)" |
| 144 |
points="130 150 130 170 130 190 130 210 130 230 130 250 130 270 130 290 |
| 145 |
130 310 130 330 130 350 130 370" |
| 146 |
style="stroke:black; stroke-width:4; fill:none; |
| 147 |
marker:url(#markerStrokeWidth)" /> |
| 148 |
|
| 149 |
|
| 150 |
<polyline id="userspace" |
| 151 |
transform="translate(10 0)" onclick="changeGeometryEvt(evt)" |
| 152 |
points="130 150 130 170 130 190 130 210 130 230 130 250 130 270 130 290 |
| 153 |
130 310 130 330 130 350 130 370" |
| 154 |
style="stroke:black; stroke-width:4; fill:none; |
| 155 |
marker:url(#markerUserSpaceOnUse)" /> |
| 156 |
|
| 157 |
<polyline id="start" |
| 158 |
transform="translate(75 0)" onclick="changeMarkerStartEvt(evt)" |
| 159 |
points="130 150 110 170 150 190 110 210 150 230 110 250 150 270 110 290 150 310 110 330 150 350 130 370" |
| 160 |
style="stroke:black; stroke-width:4; fill:none; marker:url(#markerUserSpaceOnUse)" /> |
| 161 |
|
| 162 |
<polyline id="mid" |
| 163 |
transform="translate(140 0)" onclick="changeMarkerMidEvt(evt)" |
| 164 |
points="130 150 110 170 150 190 110 210 150 230 110 250 150 270 110 290 150 310 110 330 150 350 130 370" |
| 165 |
style="stroke:black; stroke-width:4; fill:none; marker:url(#markerUserSpaceOnUse)" /> |
| 166 |
|
| 167 |
<polyline id="end" |
| 168 |
transform="translate(205 0)" onclick="changeMarkerEndEvt(evt)" |
| 169 |
points="130 150 110 170 150 190 110 210 150 230 110 250 150 270 110 290 150 310 110 330 150 350 130 370" |
| 170 |
style="stroke:black; stroke-width:4; fill:none; marker:url(#markerUserSpaceOnUse)" /> |
| 171 |
|
| 172 |
<polyline id="all" |
| 173 |
transform="translate(270 0)" onclick="changeMarkerEvt(evt)" |
| 174 |
points="130 150 110 170 150 190 110 210 150 230 110 250 150 270 110 290 150 310 110 330 150 350 130 370" |
| 175 |
style="stroke:black; stroke-width:4; fill:none; |
| 176 |
marker:url(#markerUserSpaceOnUse)" /> |
| 177 |
</g> |
| 178 |
|
| 179 |
<g id="run" transform="translate(195, 468)" cursor="pointer" onclick="run()"> |
| 180 |
<rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" /> |
| 181 |
<text x="30" y="18" font-size="14" |
| 182 |
font-weight="bold" text-anchor="middle">Run</text> |
| 183 |
</g> |
| 184 |
</svg> |