summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/kitfox/svg/Style.java
diff options
context:
space:
mode:
authorkitfox2013-06-08 17:58:48 +0200
committerkitfox2013-06-08 17:58:48 +0200
commit86ece1cb42537370a924c96591b8f76d6cac1d61 (patch)
tree07c7cf3e8bd54138a8ce46a3c9191887f939d2b5 /src/main/java/com/kitfox/svg/Style.java
parentclip-path can now handle "none". (diff)
downloadsvg-salamander-core-86ece1cb42537370a924c96591b8f76d6cac1d61.tar.gz
svg-salamander-core-86ece1cb42537370a924c96591b8f76d6cac1d61.tar.xz
svg-salamander-core-86ece1cb42537370a924c96591b8f76d6cac1d61.zip
Tspan should now handle setting the x without the y also being specified.
git-svn-id: https://svn.java.net/svn/svgsalamander~svn/trunk/svg-core@157 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.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/com/kitfox/svg/Style.java b/src/main/java/com/kitfox/svg/Style.java
index 24bf2cd..eac0e04 100644
--- a/src/main/java/com/kitfox/svg/Style.java
+++ b/src/main/java/com/kitfox/svg/Style.java
@@ -36,6 +36,7 @@
package com.kitfox.svg;
import com.kitfox.svg.xml.StyleAttribute;
+import com.kitfox.svg.xml.StyleSheet;
/**
* Holds title textual information within tree
@@ -51,6 +52,8 @@ public class Style extends SVGElement
String type;
StringBuffer text = new StringBuffer();
+ StyleSheet styleSheet;
+
/**
* Creates a new instance of Stop
*/
@@ -69,6 +72,9 @@ public class Style extends SVGElement
public void loaderAddText(SVGLoaderHelper helper, String text)
{
this.text.append(text);
+
+ //Invalidate style sheet
+ styleSheet = null;
}
protected void build() throws SVGException
@@ -88,4 +94,13 @@ public class Style extends SVGElement
//Style sheet doesn't change
return false;
}
+
+ public StyleSheet getStyleSheet()
+ {
+ if (styleSheet == null && text.length() > 0)
+ {
+ styleSheet = StyleSheet.parseSheet(text.toString());
+ }
+ return styleSheet;
+ }
}