| <?xml version="1.0" standalone="no"?> |
| <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" |
| "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> |
| |
| |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <!-- ========================================================================= --> |
| <!-- Tests support for the DOMFocusIn, DOMFocusOut, DOMActivate --> |
| <!-- --> |
| <!-- @author tkormann@ilog.fr --> |
| <!-- @author vincent.hardy@sun.com --> |
| <!-- @version $Id$ --> |
| <!-- ========================================================================= --> |
| |
| <?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?> |
| |
| <svg xmlns="http://www.w3.org/2000/svg" |
| xmlns:xlink="http://www.w3.org/1999/xlink" |
| id="body" width="450" height="500" viewBox="0 0 450 500"> |
| |
| <text class="title" x="50%" y="50">KeyEvents test<tspan x="50%" dy="1.3em">(type an upper case 'A' on each color)</tspan></text> |
| |
| <g id="body-content"> |
| |
| <rect onkeypress="set('orange', 'keypress')" onkeydown="set('orange', 'keydown')" onkeyup="set('orange', 'keypress')" |
| x="100" y="100" width="100" height="100" style="fill:orange" /> |
| |
| <rect onkeypress="set('crimson', 'keypress')" onkeydown="set('crimson', 'keydown')" onkeyup="set('crimson', 'keypress')" |
| x="250" y="100" width="100" height="100" style="fill:crimson" /> |
| |
| <rect onkeypress="set('gold', 'keypress')" onkeydown="set('gold', 'keydown')" onkeyup="set('gold', 'keypress')" |
| x="100" y="250" width="100" height="100" style="fill:gold" /> |
| |
| <rect onkeypress="set('aaa', 'keypress')" onkeydown="set('aaa', 'keydown')" onkeyup="set('aaa', 'keypress')" |
| x="250" y="250" width="100" height="100" style="fill:#aaa" /> |
| |
| <circle onkeypress="set('eee', 'keypress')" onkeydown="set('eee', 'keydown')" onkeyup="set('eee', 'keypress')" |
| cx="225" cy="225" r="75" style="fill:#eee" /> |
| |
| </g> |
| |
| <script type="text/ecmascript"><![CDATA[ |
| function set(color, state) { |
| var elt = document.getElementById(color + "." + state); |
| elt.setAttribute("fill", "green"); |
| } |
| |
| function onDone() { |
| if (!(regardTestInstance == null)) { |
| regardTestInstance.scriptDone(); |
| } else { |
| alert("This button only works when run in the regard framework"); |
| } |
| } |
| ]]></script> |
| |
| <g fill="red" stroke="black" transform="translate(40, 420)"> |
| <g transform="translate(0,0)"> |
| <rect id="orange.keypress" width="20" height="20" /> |
| <rect id="orange.keydown" x="25" width="20" height="20" /> |
| <rect id="orange.keyup" x="50" width="20" height="20" /> |
| </g> |
| |
| <g transform="translate(75,0)"> |
| <rect id="crimson.keypress" width="20" height="20" /> |
| <rect id="crimson.keydown" x="25" width="20" height="20" /> |
| <rect id="crimson.keyup" x="50" width="20" height="20" /> |
| </g> |
| |
| <g transform="translate(150,0)"> |
| <rect id="gold.keypress" width="20" height="20" /> |
| <rect id="gold.keydown" x="25" width="20" height="20" /> |
| <rect id="gold.keyup" x="50" width="20" height="20" /> |
| </g> |
| |
| <g transform="translate(225,0)"> |
| <rect id="aaa.keypress" width="20" height="20" /> |
| <rect id="aaa.keydown" x="25" width="20" height="20" /> |
| <rect id="aaa.keyup" x="50" width="20" height="20" /> |
| </g> |
| |
| <g transform="translate(300,0)"> |
| <rect id="eee.keypress" width="20" height="20" /> |
| <rect id="eee.keydown" x="25" width="20" height="20" /> |
| <rect id="eee.keyup" x="50" width="20" height="20" /> |
| </g> |
| |
| |
| </g> |
| |
| <g id="done" transform="translate(195, 458)" cursor="pointer" onclick="onDone()"> |
| <rect rx="5" ry="5" width="60" height="25" fill="#eeeeee" stroke="black" /> |
| <text x="30" y="18" font-size="14" font-weight="bold" text-anchor="middle">Done</text> |
| </g> |
| |
| |
| </svg> |