com.vaadin.polymer.iron.IronIconsetElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from iron-iconset project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.iron;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* The iron-iconset
element allows users to define their own icon set using
an image file. (To create an iconset using SVG icons, see iron-iconset-svg
.)
* The src
property specifies the url of the icon image. Multiple icons may
be included in this image and they may be organized into rows.
The icons
property is a space separated list of names corresponding to the
icons. The names must be ordered as the icons are ordered in the icon image.
Icons are expected to be square and are the size specified by the size
property. The width
property corresponds to the width of the icon image
and must be specified if icons are arranged into multiple rows in the image.
* All iron-iconset
elements are available for use by other iron-iconset
elements via a database keyed by id. Typically, an element author that wants
to support a set of custom icons uses a iron-iconset
to retrieve
and use another, user-defined icon set, or simply uses the iron-icon
element to display an icon by specifying its icon set name and id.
* Example:
* <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24"
* icons="location place starta stopb bus car train walk">
* </iron-iconset>
*
*
*
This will automatically register the icon set “my-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 to an element, use the
applyIcon
method. For example:
* iconset.applyIcon(iconNode, 'car');
*
*
*
Themed icon sets are also supported. The iron-iconset
can contain child
property
elements that specify a theme with an offsetX and offsetY of the
theme within the icon resource. For example.
* <iron-iconset id="my-icons" src="my-icons.png" width="96" size="24"
* icons="location place starta stopb bus car train walk">
* <property theme="special" offsetX="256" offsetY="24"></property>
* </iron-iconset>
*
*
*
Then a themed icon can be applied like this:
* iconset.applyIcon(iconNode, 'car', 'special');
*
*
*
See also:
*
* iron-iconset-svg
. Build icon sets with SVG elements.
* iron-icons
. Predefined icon sets.
* iron-icon
. Simple element to display an icon.
*
*/
@JsType(isNative=true)
public interface IronIconsetElement extends HTMLElement {
@JsOverlay public static final String TAG = "iron-iconset";
@JsOverlay public static final String SRC = "iron-iconset/iron-iconset.html";
/**
* Array of fully-qualified names of icons in this set.
*
* JavaScript Info:
* @property iconNames
* @type Array
*
*/
@JsProperty JsArray getIconNames();
/**
* Array of fully-qualified names of icons in this set.
*
* JavaScript Info:
* @property iconNames
* @type Array
*
*/
@JsProperty void setIconNames(JsArray value);
/**
* 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);
/**
* The width of the iconset image. This must only be specified if the
icons are arranged into separate rows inside the image.
*
* JavaScript Info:
* @property width
* @type Number
*
*/
@JsProperty double getWidth();
/**
* The width of the iconset image. This must only be specified if the
icons are arranged into separate rows inside the image.
*
* JavaScript Info:
* @property width
* @type Number
*
*/
@JsProperty void setWidth(double value);
/**
* A space separated list of names corresponding to icons in the iconset
image file. This list must be ordered the same as the icon images
in the image file.
*
* JavaScript Info:
* @property icons
* @type String
*
*/
@JsProperty String getIcons();
/**
* A space separated list of names corresponding to icons in the iconset
image file. This list must be ordered the same as the icon images
in the image file.
*
* JavaScript Info:
* @property icons
* @type String
*
*/
@JsProperty void setIcons(String value);
/**
* 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);
/**
* The URL of the iconset image.
*
* JavaScript Info:
* @property src
* @type String
*
*/
@JsProperty String getSrc();
/**
* The URL of the iconset image.
*
* JavaScript Info:
* @property src
* @type String
*
*/
@JsProperty void setSrc(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);
/**
* Applies an icon to the given element as a css background image. This
method does not size the element, and it’s usually necessary to set
the element’s height and width so that the background image is visible.
*
* JavaScript Info:
* @method applyIcon
* @param {Element} element
* @param {(string|number)} icon
* @param {string=} theme
* @param {number=} scale
*
*
*/
void applyIcon(Element element, Object icon, String theme, double scale);
}