1 43 44 package org.jfree.xml.parser.coretypes; 45 46 import java.awt.Insets ; 47 48 import org.jfree.xml.parser.AbstractXmlReadHandler; 49 import org.jfree.xml.parser.XmlReaderException; 50 import org.xml.sax.Attributes ; 51 import org.xml.sax.SAXException ; 52 53 56 public class InsetsReadHandler extends AbstractXmlReadHandler { 57 58 59 private Insets insets; 60 61 64 public InsetsReadHandler() { 65 super(); 66 } 67 68 75 protected void startParsing(final Attributes attrs) throws SAXException { 76 77 final String top = attrs.getValue("top"); 78 final String left = attrs.getValue("left"); 79 final String bottom = attrs.getValue("bottom"); 80 final String right = attrs.getValue("right"); 81 82 this.insets = new Insets ( 83 Integer.parseInt(top), Integer.parseInt(left), 84 Integer.parseInt(bottom), Integer.parseInt(right) 85 ); 86 87 } 88 89 96 public Object getObject() throws XmlReaderException { 97 return this.insets; 98 } 99 } 100 | Popular Tags |