001/********************************************** 002 * Copyright (C) 2010 Lukas Laag 003 * This file is part of lib-gwt-svg. 004 * 005 * libgwtsvg is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Lesser General Public License as published by 007 * the Free Software Foundation, either version 3 of the License, or 008 * (at your option) any later version. 009 * 010 * libgwtsvg is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public License 016 * along with libgwtsvg. If not, see http://www.gnu.org/licenses/ 017 **********************************************/ 018package org.vectomatic.dom.svg.itf; 019 020import org.vectomatic.dom.svg.OMSVGAnimatedString; 021import org.vectomatic.dom.svg.OMSVGStyle; 022 023/** 024 * The {@link org.vectomatic.dom.svg.itf.ISVGStylable} interface is implemented on all objects 025 * corresponding to SVG elements that can have <code>'style'</code> attribute, 026 * <code>'class'</code> and presentation attributes specified on them. It 027 * is thus an ancestor interface for many of the interfaces defined in this 028 * specification. 029 */ 030public interface ISVGStylable { 031 /** 032 * Returns the CSS style of this element 033 */ 034 public OMSVGStyle getStyle(); 035 /** 036 * Returns the CSS class name of this element. Note that 037 * in SVG, this class name can change over the time (there is 038 * a baseVal and an animVal). 039 * @return the CSS class name of this element 040 */ 041 public OMSVGAnimatedString getClassName(); 042 /** 043 * Adds the specified class name to the baseVal CSS class name of this element 044 * @param className the class name to add 045 */ 046 public void addClassNameBaseVal(String className); 047 /** 048 * Removes the specified class name from the baseVal CSS class name of this element 049 * @param className the class name to remove 050 */ 051 public void removeClassNameBaseVal(String className); 052 /** 053 * Replaces the specified class name in the baseVal CSS class name of this element 054 * with a new class name 055 * @param oldClassName the class name to replace 056 * @param newClassName the replacement class name 057 */ 058 public void replaceClassNameBaseVal(String oldClassName, String newClassName); 059 /** 060 * Sets the baseVal CSS class name of this element to the specified value 061 * @param className the class name 062 */ 063 public void setClassNameBaseVal(String className); 064}