From 6776ed9f1a81e517139d85eb6d2e28911fd0fc35 Mon Sep 17 00:00:00 2001 From: kitfox Date: Tue, 19 Mar 2013 05:20:37 +0000 Subject: Adding support for style sheets. git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@153 7dc7fa77-23fb-e6ad-8e2e-c86bd48ed22b --- src/main/java/com/kitfox/svg/Style.java | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'src/main/java/com/kitfox/svg/Style.java') 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 Mark McKay */ -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; - } - + } } -- cgit v1.2.3-55-g7522