1 /********************************************** 2 * Copyright (C) 2010 Lukas Laag 3 * This file is part of lib-gwt-svg. 4 * 5 * libgwtsvg is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * libgwtsvg is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public License 16 * along with libgwtsvg. If not, see http://www.gnu.org/licenses/ 17 **********************************************/ 18 package org.vectomatic.dom.svg.itf; 19 20 import org.vectomatic.dom.svg.OMSVGAnimatedString; 21 import org.vectomatic.dom.svg.OMSVGStyle; 22 23 /** 24 * The {@link org.vectomatic.dom.svg.itf.ISVGStylable} interface is implemented on all objects 25 * corresponding to SVG elements that can have <code>'style'</code> attribute, 26 * <code>'class'</code> and presentation attributes specified on them. It 27 * is thus an ancestor interface for many of the interfaces defined in this 28 * specification. 29 */ 30 public interface ISVGStylable { 31 /** 32 * Returns the CSS style of this element 33 */ 34 public OMSVGStyle getStyle(); 35 /** 36 * Returns the CSS class name of this element. Note that 37 * in SVG, this class name can change over the time (there is 38 * a baseVal and an animVal). 39 * @return the CSS class name of this element 40 */ 41 public OMSVGAnimatedString getClassName(); 42 /** 43 * Adds the specified class name to the baseVal CSS class name of this element 44 * @param className the class name to add 45 */ 46 public void addClassNameBaseVal(String className); 47 /** 48 * Removes the specified class name from the baseVal CSS class name of this element 49 * @param className the class name to remove 50 */ 51 public void removeClassNameBaseVal(String className); 52 /** 53 * Replaces the specified class name in the baseVal CSS class name of this element 54 * with a new class name 55 * @param oldClassName the class name to replace 56 * @param newClassName the replacement class name 57 */ 58 public void replaceClassNameBaseVal(String oldClassName, String newClassName); 59 /** 60 * Sets the baseVal CSS class name of this element to the specified value 61 * @param className the class name 62 */ 63 public void setClassNameBaseVal(String className); 64 }