source: josm/trunk/src/com/kitfox/svg/A.java@ 5693

Last change on this file since 5693 was 4256, checked in by bastiK, 13 years ago

see #6560 - basic svg support, includes kitfox svgsalamander, r 98, patched

File size: 2.9 KB
Line 
1/*
2 * Stop.java
3 *
4 *
5 * The Salamander Project - 2D and 3D graphics libraries in Java
6 * Copyright (C) 2004 Mark McKay
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 * Mark McKay can be contacted at mark@kitfox.com. Salamander and other
23 * projects can be found at http://www.kitfox.com
24 *
25 * Created on January 26, 2004, 1:56 AM
26 */
27
28package com.kitfox.svg;
29
30import com.kitfox.svg.xml.StyleAttribute;
31import java.awt.*;
32import java.net.URI;
33
34/**
35 * @author Mark McKay
36 * @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
37 */
38public class A extends Group {
39
40 URI href;
41 String title;
42
43 /** Creates a new instance of Stop */
44 public A() {
45 }
46/*
47 public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
48 {
49 //Load style string
50 super.loaderStartElement(helper, attrs, parent);
51
52 String offset = attrs.getValue("offset");
53 this.offset = (float)XMLParseUtil.parseRatio(offset);
54
55 buildStop();
56 }
57 */
58
59 protected void build() throws SVGException
60 {
61 super.build();
62
63 StyleAttribute sty = new StyleAttribute();
64
65 if (getPres(sty.setName("xlink:href")))
66 {
67 href = sty.getURIValue(getXMLBase());
68 }
69
70 if (getPres(sty.setName("xlink:title")))
71 {
72 title = sty.getStringValue();
73 }
74 }
75
76 /**
77 * Updates all attributes in this diagram associated with a time event.
78 * Ie, all attributes with track information.
79 * @return - true if this node has changed state as a result of the time
80 * update
81 */
82 public boolean updateTime(double curTime) throws SVGException
83 {
84 boolean changeState = super.updateTime(curTime);
85// if (trackManager.getNumTracks() == 0) return false;
86
87 //Get current values for parameters
88 StyleAttribute sty = new StyleAttribute();
89
90 if (getPres(sty.setName("xlink:href")))
91 {
92 href = sty.getURIValue(getXMLBase());
93 }
94
95 if (getPres(sty.setName("xlink:title")))
96 {
97 title = sty.getStringValue();
98 }
99
100 return changeState;
101 }
102}
Note: See TracBrowser for help on using the repository browser.