com.vaadin.polymer.iron.element.IronIconsetSvgElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-iconset-svg project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.iron.element;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.js.JsProperty;
import com.google.gwt.core.client.js.JsType;
/**
* The iron-iconset-svg
element allows users to define their own icon sets
that contain svg icons. The svg icon elements should be children of the
iron-iconset-svg
element. Multiple icons should be given distinct id’s.
* Using svg elements to create icons has a few advantages over traditional
bitmap graphics like jpg or png. Icons that use svg are vector based so they
are resolution independent and should look good on any device. They are
stylable via css. Icons can be themed, colorized, and even animated.
* Example:
* <iron-iconset-svg name="my-svg-icons" size="24">
* <svg>
* <defs>
* <g id="shape">
* <rect x="50" y="50" width="50" height="50" />
* <circle cx="50" cy="50" r="50" />
* </g>
* </defs>
* </svg>
* </iron-iconset-svg>
*
*
*
This will automatically register the icon set “my-svg-icons” to the iconset
database. To use these icons from within another element, make a
iron-iconset
element and call the byId
method
to retrieve a given iconset. To apply a particular icon inside an
element use the applyIcon
method. For example:
* iconset.applyIcon(iconNode, 'car');
*
*
*
*/
@JsType
public interface IronIconsetSvgElement extends HTMLElement {
public static final String TAG = "iron-iconset-svg";
public static final String SRC = "iron-iconset-svg/iron-iconset-svg.html";
/**
* Applies an icon to the given element.
* An svg icon is prepended to the element’s shadowRoot if it exists,
otherwise to the element itself.
*
* JavaScript Info:
* @method applyIcon
* @param {Element} element
* @param {string} iconName
*
*/
void applyIcon(Element element, String iconName);
/**
* Construct an array of all icon names in this iconset.
*
* JavaScript Info:
* @method getIconNames
*
*/
void getIconNames();
/**
* The name of the iconset.
*
* JavaScript Info:
* @property name
* @type String
*
*/
@JsProperty String getName();
/**
* The name of the iconset.
*
* JavaScript Info:
* @property name
* @type String
*
*/
@JsProperty void setName(String value);
/**
* Remove an icon from the given element by undoing the changes effected
by applyIcon
.
*
* JavaScript Info:
* @method removeIcon
* @param {Element} element
*
*/
void removeIcon(Element element);
/**
* The size of an individual icon. Note that icons must be square.
*
* JavaScript Info:
* @property size
* @type Number
*
*/
@JsProperty double getSize();
/**
* The size of an individual icon. Note that icons must be square.
*
* JavaScript Info:
* @property size
* @type Number
*
*/
@JsProperty void setSize(double value);
}