1 18 package org.apache.batik.css.engine; 19 20 import org.w3c.css.sac.SACMediaList; 21 22 28 public class MediaRule extends StyleSheet implements Rule { 29 30 33 public final static short TYPE = (short)1; 34 35 38 protected SACMediaList mediaList; 39 40 43 public short getType() { 44 return TYPE; 45 } 46 47 50 public void setMediaList(SACMediaList ml) { 51 mediaList = ml; 52 } 53 54 57 public SACMediaList getMediaList() { 58 return mediaList; 59 } 60 61 64 public String toString(CSSEngine eng) { 65 StringBuffer sb = new StringBuffer (); 66 sb.append("@media"); 67 if (mediaList != null) { 68 for (int i = 0; i < mediaList.getLength(); i++) { 69 sb.append(' '); 70 sb.append(mediaList.item(i)); 71 } 72 } 73 sb.append(" {\n"); 74 for (int i = 0; i < size; i++) { 75 sb.append(rules[i].toString(eng)); 76 } 77 sb.append("}\n"); 78 return sb.toString(); 79 } 80 } 81 | Popular Tags |