diff options
author | kitfox | 2013-03-19 06:20:37 +0100 |
---|---|---|
committer | kitfox | 2013-03-19 06:20:37 +0100 |
commit | 6776ed9f1a81e517139d85eb6d2e28911fd0fc35 (patch) | |
tree | e169f598f518670f5434d75d1b76ceb3c0765d32 /src/main/java/com/kitfox/svg/Style.java | |
parent | Error handling now sends warnings to Logger. (diff) | |
download | svg-salamander-core-6776ed9f1a81e517139d85eb6d2e28911fd0fc35.tar.gz svg-salamander-core-6776ed9f1a81e517139d85eb6d2e28911fd0fc35.tar.xz svg-salamander-core-6776ed9f1a81e517139d85eb6d2e28911fd0fc35.zip |
Adding support for style sheets.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@153 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b
Diffstat (limited to 'src/main/java/com/kitfox/svg/Style.java')
-rw-r--r-- | src/main/java/com/kitfox/svg/Style.java | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/src/main/java/com/kitfox/svg/Style.java b/src/main/java/com/kitfox/svg/Style.java index 65f99af..24bf2cd 100644 --- a/src/main/java/com/kitfox/svg/Style.java +++ b/src/main/java/com/kitfox/svg/Style.java @@ -33,13 +33,9 @@ *
* Created on September 19, 2004, 1:56 AM
*/
-
package com.kitfox.svg;
import com.kitfox.svg.xml.StyleAttribute;
-import com.kitfox.svg.xml.*;
-import org.xml.sax.*;
-
/**
* Holds title textual information within tree
@@ -47,24 +43,26 @@ import org.xml.sax.*; * @author Mark McKay
* @author <a href="mailto:mark@kitfox.com">Mark McKay</a>
*/
-public class Style extends SVGElement {
+public class Style extends SVGElement
+{
+ public static final String TAG_NAME = "style";
//Should be set to "text/css"
String type;
StringBuffer text = new StringBuffer();
- /** Creates a new instance of Stop */
- public Style() {
- }
-/*
- public void loaderStartElement(SVGLoaderHelper helper, Attributes attrs, SVGElement parent)
+ /**
+ * Creates a new instance of Stop
+ */
+ public Style()
{
- //Load style string
- super.loaderStartElement(helper, attrs, parent);
+ }
- this.type = attrs.getValue("type");
+ public String getTagName()
+ {
+ return TAG_NAME;
}
-*/
+
/**
* Called during load process to add text scanned within a tag
*/
@@ -73,20 +71,21 @@ public class Style extends SVGElement { this.text.append(text);
}
-
protected void build() throws SVGException
{
super.build();
-
+
StyleAttribute sty = new StyleAttribute();
-
- if (getPres(sty.setName("type"))) type = sty.getStringValue();
+
+ if (getPres(sty.setName("type")))
+ {
+ type = sty.getStringValue();
+ }
}
-
+
public boolean updateTime(double curTime) throws SVGException
{
//Style sheet doesn't change
return false;
- }
-
+ }
}
|