com.vaadin.polymer.paper.widget.PaperSlider Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from paper-slider project by The Polymer Authors
* that is licensed with http://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.paper.widget;
import com.vaadin.polymer.paper.element.*;
import com.vaadin.polymer.change.widget.event.ChangeEvent;
import com.vaadin.polymer.change.widget.event.ChangeEventHandler;
import com.vaadin.polymer.immediate.widget.event.ImmediateValueChangeEvent;
import com.vaadin.polymer.immediate.widget.event.ImmediateValueChangeEventHandler;
import com.vaadin.polymer.value.widget.event.ValueChangeEvent;
import com.vaadin.polymer.value.widget.event.ValueChangeEventHandler;
import com.vaadin.polymer.iron.widget.event.IronFormElementRegisterEvent;
import com.vaadin.polymer.iron.widget.event.IronFormElementRegisterEventHandler;
import com.vaadin.polymer.iron.widget.event.IronFormElementUnregisterEvent;
import com.vaadin.polymer.iron.widget.event.IronFormElementUnregisterEventHandler;
import com.vaadin.polymer.PolymerWidget;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.core.client.JavaScriptObject;
/**
* paper-slider
allows user to select a value from a range of values by
moving the slider thumb. The interactive nature of the slider makes it a
great choice for settings that reflect intensity levels, such as volume,
brightness, or color saturation.
* Example:
* <paper-slider></paper-slider>
*
*
*
Use min
and max
to specify the slider range. Default is 0 to 100.
* Example:
* <paper-slider min="10" max="200" value="110"></paper-slider>
*
*
*
Styling
* The following custom properties and mixins are available for styling:
*
*
*
* Custom property
* Description
* Default
*
*
*
*
* --paper-slider-bar-color
* The background color of the slider
* transparent
*
*
* --paper-slider-active-color
* The progress bar color
* --google-blue-700
*
*
* --paper-slider-secondary-color
* The secondary progress bar color
* --google-blue-300
*
*
* --paper-slider-knob-color
* The knob color
* --google-blue-700
*
*
* --paper-slider-disabled-knob-color
* The disabled knob color
* --google-grey-500
*
*
* --paper-slider-pin-color
* The pin color
* --google-blue-700
*
*
* --paper-slider-font-color
* The pin’s text color
* #fff
*
*
* --paper-slider-disabled-active-color
* The disabled progress bar color
* --google-grey-500
*
*
* --paper-slider-disabled-secondary-color
* The disabled secondary progress bar color
* --google-grey-300
*
*
*
*/
public class PaperSlider extends PolymerWidget {
/**
* Default Constructor.
*/
public PaperSlider() {
this("");
}
/**
* Constructor used by UIBinder to create widgets with content.
*/
public PaperSlider(String html) {
super(PaperSliderElement.TAG, PaperSliderElement.SRC, html);
getPolymerElement().addEventListener(
com.vaadin.polymer.change.element.event.ChangeEvent.NAME,
new com.vaadin.polymer.change.element.event.ChangeEvent.Listener() {
@Override
protected void handleEvent(com.vaadin.polymer.change.element.event.ChangeEvent event) {
fireEvent(new ChangeEvent(event));
}
});
getPolymerElement().addEventListener(
com.vaadin.polymer.immediate.element.event.ImmediateValueChangeEvent.NAME,
new com.vaadin.polymer.immediate.element.event.ImmediateValueChangeEvent.Listener() {
@Override
protected void handleEvent(com.vaadin.polymer.immediate.element.event.ImmediateValueChangeEvent event) {
fireEvent(new ImmediateValueChangeEvent(event));
}
});
getPolymerElement().addEventListener(
com.vaadin.polymer.value.element.event.ValueChangeEvent.NAME,
new com.vaadin.polymer.value.element.event.ValueChangeEvent.Listener() {
@Override
protected void handleEvent(com.vaadin.polymer.value.element.event.ValueChangeEvent event) {
fireEvent(new ValueChangeEvent(event));
}
});
getPolymerElement().addEventListener(
com.vaadin.polymer.iron.element.event.IronFormElementRegisterEvent.NAME,
new com.vaadin.polymer.iron.element.event.IronFormElementRegisterEvent.Listener() {
@Override
protected void handleEvent(com.vaadin.polymer.iron.element.event.IronFormElementRegisterEvent event) {
fireEvent(new IronFormElementRegisterEvent(event));
}
});
getPolymerElement().addEventListener(
com.vaadin.polymer.iron.element.event.IronFormElementUnregisterEvent.NAME,
new com.vaadin.polymer.iron.element.event.IronFormElementUnregisterEvent.Listener() {
@Override
protected void handleEvent(com.vaadin.polymer.iron.element.event.IronFormElementUnregisterEvent event) {
fireEvent(new IronFormElementUnregisterEvent(event));
}
});
}
/**
* Gets a handle to the Polymer object's underlying DOM element.
*/
public PaperSliderElement getPolymerElement() {
return (PaperSliderElement) getElement();
}
/**
* Decreases value by step
but not below min
.
*
* JavaScript Info:
* @method decrement
*
*/
public void decrement() {
getPolymerElement().decrement();
}
/**
* True when the user is dragging the slider.
*
* JavaScript Info:
* @property dragging
* @type Boolean
*
*/
public boolean getDragging(){
return getPolymerElement().getDragging();
}
/**
* True when the user is dragging the slider.
*
* JavaScript Info:
* @property dragging
* @type Boolean
*
*/
public void setDragging(boolean value) {
getPolymerElement().setDragging(value);
}
/**
* If true, an input is shown and user can use it to set the slider value.
*
* JavaScript Info:
* @property editable
* @type Boolean
*
*/
public boolean getEditable(){
return getPolymerElement().getEditable();
}
/**
* If true, an input is shown and user can use it to set the slider value.
*
* JavaScript Info:
* @property editable
* @type Boolean
*
*/
public void setEditable(boolean value) {
getPolymerElement().setEditable(value);
}
/**
* If true, the knob is expanded
*
* JavaScript Info:
* @property expand
* @type Boolean
*
*/
public boolean getExpand(){
return getPolymerElement().getExpand();
}
/**
* If true, the knob is expanded
*
* JavaScript Info:
* @property expand
* @type Boolean
*
*/
public void setExpand(boolean value) {
getPolymerElement().setExpand(value);
}
/**
* The immediate value of the slider. This value is updated while the user
is dragging the slider.
*
* JavaScript Info:
* @property immediateValue
* @type Number
*
*/
public double getImmediateValue(){
return getPolymerElement().getImmediateValue();
}
/**
* The immediate value of the slider. This value is updated while the user
is dragging the slider.
*
* JavaScript Info:
* @property immediateValue
* @type Number
*
*/
public void setImmediateValue(double value) {
getPolymerElement().setImmediateValue(value);
}
/**
* The immediate value of the slider. This value is updated while the user
is dragging the slider.
*
* JavaScript Info:
* @attribute immediate-value
*
*/
public void setImmediateValue(String value) {
getPolymerElement().setAttribute("immediate-value", value);
}
/**
* Increases value by step
but not above max
.
*
* JavaScript Info:
* @method increment
*
*/
public void increment() {
getPolymerElement().increment();
}
/**
*
*
* JavaScript Info:
* @property keyBindings
* @type Object
*
*/
public JavaScriptObject getKeyBindings(){
return getPolymerElement().getKeyBindings();
}
/**
*
*
* JavaScript Info:
* @property keyBindings
* @type Object
*
*/
public void setKeyBindings(JavaScriptObject value) {
getPolymerElement().setKeyBindings(value);
}
/**
*
*
* JavaScript Info:
* @property markers
* @type Array
*
*/
public JsArray getMarkers(){
return getPolymerElement().getMarkers();
}
/**
*
*
* JavaScript Info:
* @property markers
* @type Array
*
*/
public void setMarkers(JsArray value) {
getPolymerElement().setMarkers(value);
}
/**
*
*
* JavaScript Info:
* @attribute markers
*
*/
public void setMarkers(String value) {
getPolymerElement().setAttribute("markers", value);
}
/**
* The maximum number of markers
*
* JavaScript Info:
* @property maxMarkers
* @type Number
*
*/
public double getMaxMarkers(){
return getPolymerElement().getMaxMarkers();
}
/**
* The maximum number of markers
*
* JavaScript Info:
* @property maxMarkers
* @type Number
*
*/
public void setMaxMarkers(double value) {
getPolymerElement().setMaxMarkers(value);
}
/**
* The maximum number of markers
*
* JavaScript Info:
* @attribute max-markers
*
*/
public void setMaxMarkers(String value) {
getPolymerElement().setAttribute("max-markers", value);
}
/**
* If true, a pin with numeric value label is shown when the slider thumb
is pressed. Use for settings for which users need to know the exact
value of the setting.
*
* JavaScript Info:
* @property pin
* @type Boolean
*
*/
public boolean getPin(){
return getPolymerElement().getPin();
}
/**
* If true, a pin with numeric value label is shown when the slider thumb
is pressed. Use for settings for which users need to know the exact
value of the setting.
*
* JavaScript Info:
* @property pin
* @type Boolean
*
*/
public void setPin(boolean value) {
getPolymerElement().setPin(value);
}
/**
* The number that represents the current secondary progress.
*
* JavaScript Info:
* @property secondaryProgress
* @type Number
*
*/
public double getSecondaryProgress(){
return getPolymerElement().getSecondaryProgress();
}
/**
* The number that represents the current secondary progress.
*
* JavaScript Info:
* @property secondaryProgress
* @type Number
*
*/
public void setSecondaryProgress(double value) {
getPolymerElement().setSecondaryProgress(value);
}
/**
* The number that represents the current secondary progress.
*
* JavaScript Info:
* @attribute secondary-progress
*
*/
public void setSecondaryProgress(String value) {
getPolymerElement().setAttribute("secondary-progress", value);
}
/**
* If true, the slider thumb snaps to tick marks evenly spaced based
on the step
property value.
*
* JavaScript Info:
* @property snaps
* @type Boolean
*
*/
public boolean getSnaps(){
return getPolymerElement().getSnaps();
}
/**
* If true, the slider thumb snaps to tick marks evenly spaced based
on the step
property value.
*
* JavaScript Info:
* @property snaps
* @type Boolean
*
*/
public void setSnaps(boolean value) {
getPolymerElement().setSnaps(value);
}
/**
*
*
* JavaScript Info:
* @property transiting
* @type Boolean
*
*/
public boolean getTransiting(){
return getPolymerElement().getTransiting();
}
/**
*
*
* JavaScript Info:
* @property transiting
* @type Boolean
*
*/
public void setTransiting(boolean value) {
getPolymerElement().setTransiting(value);
}
/**
*
*
* JavaScript Info:
* @property hostAttributes
* @type Object
*
*/
public JavaScriptObject getHostAttributes(){
return getPolymerElement().getHostAttributes();
}
/**
*
*
* JavaScript Info:
* @property hostAttributes
* @type Object
*
*/
public void setHostAttributes(JavaScriptObject value) {
getPolymerElement().setHostAttributes(value);
}
/**
*
*
* JavaScript Info:
* @property observers
* @type Array
*
*/
public JsArray getObservers(){
return getPolymerElement().getObservers();
}
/**
*
*
* JavaScript Info:
* @property observers
* @type Array
*
*/
public void setObservers(JsArray value) {
getPolymerElement().setObservers(value);
}
/**
* Can be used to imperatively add a key binding to the implementing
element. This is the imperative equivalent of declaring a keybinding
in the keyBindings
prototype property.
*
* JavaScript Info:
* @method addOwnKeyBinding
* @param {} eventString
* @param {} handlerName
* @behavior PaperTabs
*/
public void addOwnKeyBinding(JavaScriptObject eventString, JavaScriptObject handlerName) {
getPolymerElement().addOwnKeyBinding(eventString, handlerName);
}
/**
* The HTMLElement that will be firing relevant KeyboardEvents.
*
* JavaScript Info:
* @property keyEventTarget
* @type Object
* @behavior PaperTabs
*/
public JavaScriptObject getKeyEventTarget(){
return getPolymerElement().getKeyEventTarget();
}
/**
* The HTMLElement that will be firing relevant KeyboardEvents.
*
* JavaScript Info:
* @property keyEventTarget
* @type Object
* @behavior PaperTabs
*/
public void setKeyEventTarget(JavaScriptObject value) {
getPolymerElement().setKeyEventTarget(value);
}
/**
* The HTMLElement that will be firing relevant KeyboardEvents.
*
* JavaScript Info:
* @attribute key-event-target
* @behavior PaperTabs
*/
public void setKeyEventTarget(String value) {
getPolymerElement().setAttribute("key-event-target", value);
}
/**
*
*
* JavaScript Info:
* @method keyboardEventMatchesKeys
* @param {} event
* @param {} eventString
* @behavior PaperTabs
*/
public void keyboardEventMatchesKeys(JavaScriptObject event, JavaScriptObject eventString) {
getPolymerElement().keyboardEventMatchesKeys(event, eventString);
}
/**
* When called, will remove all imperatively-added key bindings.
*
* JavaScript Info:
* @method removeOwnKeyBindings
* @behavior PaperTabs
*/
public void removeOwnKeyBindings() {
getPolymerElement().removeOwnKeyBindings();
}
/**
*
*
* JavaScript Info:
* @method attached
* @behavior PaperTabs
*/
public void attached() {
getPolymerElement().attached();
}
/**
*
*
* JavaScript Info:
* @method detached
* @behavior PaperTabs
*/
public void detached() {
getPolymerElement().detached();
}
/**
*
*
* JavaScript Info:
* @method registered
* @behavior PaperTabs
*/
public void registered() {
getPolymerElement().registered();
}
/**
* If true, the button is a toggle and is currently in the active state.
*
* JavaScript Info:
* @property active
* @type Boolean
* @behavior PaperSlider
*/
public boolean getActive(){
return getPolymerElement().getActive();
}
/**
* If true, the button is a toggle and is currently in the active state.
*
* JavaScript Info:
* @property active
* @type Boolean
* @behavior PaperSlider
*/
public void setActive(boolean value) {
getPolymerElement().setActive(value);
}
/**
* True if the element is currently being pressed by a “pointer,” which
is loosely defined as mouse or touch input (but specifically excluding
keyboard input).
*
* JavaScript Info:
* @property pointerDown
* @type Boolean
* @behavior PaperSlider
*/
public boolean getPointerDown(){
return getPolymerElement().getPointerDown();
}
/**
* True if the element is currently being pressed by a “pointer,” which
is loosely defined as mouse or touch input (but specifically excluding
keyboard input).
*
* JavaScript Info:
* @property pointerDown
* @type Boolean
* @behavior PaperSlider
*/
public void setPointerDown(boolean value) {
getPolymerElement().setPointerDown(value);
}
/**
* If true, the user is currently holding down the button.
*
* JavaScript Info:
* @property pressed
* @type Boolean
* @behavior PaperSlider
*/
public boolean getPressed(){
return getPolymerElement().getPressed();
}
/**
* If true, the user is currently holding down the button.
*
* JavaScript Info:
* @property pressed
* @type Boolean
* @behavior PaperSlider
*/
public void setPressed(boolean value) {
getPolymerElement().setPressed(value);
}
/**
* True if the input device that caused the element to receive focus
was a keyboard.
*
* JavaScript Info:
* @property receivedFocusFromKeyboard
* @type Boolean
* @behavior PaperSlider
*/
public boolean getReceivedFocusFromKeyboard(){
return getPolymerElement().getReceivedFocusFromKeyboard();
}
/**
* True if the input device that caused the element to receive focus
was a keyboard.
*
* JavaScript Info:
* @property receivedFocusFromKeyboard
* @type Boolean
* @behavior PaperSlider
*/
public void setReceivedFocusFromKeyboard(boolean value) {
getPolymerElement().setReceivedFocusFromKeyboard(value);
}
/**
* If true, the button toggles the active state with each tap or press
of the spacebar.
*
* JavaScript Info:
* @property toggles
* @type Boolean
* @behavior PaperSlider
*/
public boolean getToggles(){
return getPolymerElement().getToggles();
}
/**
* If true, the button toggles the active state with each tap or press
of the spacebar.
*
* JavaScript Info:
* @property toggles
* @type Boolean
* @behavior PaperSlider
*/
public void setToggles(boolean value) {
getPolymerElement().setToggles(value);
}
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
* @behavior PaperSlider
*/
public JavaScriptObject getListeners(){
return getPolymerElement().getListeners();
}
/**
*
*
* JavaScript Info:
* @property listeners
* @type Object
* @behavior PaperSlider
*/
public void setListeners(JavaScriptObject value) {
getPolymerElement().setListeners(value);
}
/**
* If true, the user cannot interact with this element.
*
* JavaScript Info:
* @property disabled
* @type Boolean
* @behavior PaperInput
*/
public boolean getDisabled(){
return getPolymerElement().getDisabled();
}
/**
* If true, the user cannot interact with this element.
*
* JavaScript Info:
* @property disabled
* @type Boolean
* @behavior PaperInput
*/
public void setDisabled(boolean value) {
getPolymerElement().setDisabled(value);
}
/**
* If true, the element currently has focus.
*
* JavaScript Info:
* @property focused
* @type Boolean
* @behavior PaperInput
*/
public boolean getFocused(){
return getPolymerElement().getFocused();
}
/**
* If true, the element currently has focus.
*
* JavaScript Info:
* @property focused
* @type Boolean
* @behavior PaperInput
*/
public void setFocused(boolean value) {
getPolymerElement().setFocused(value);
}
/**
* The name of this element.
*
* JavaScript Info:
* @property name
* @type String
* @behavior PaperTextarea
*/
public String getName(){
return getPolymerElement().getName();
}
/**
* The name of this element.
*
* JavaScript Info:
* @property name
* @type String
* @behavior PaperTextarea
*/
public void setName(String value) {
getPolymerElement().setName(value);
}
/**
* The value for this element.
*
* JavaScript Info:
* @property value
* @type String
* @behavior PaperTextarea
*/
public String getValue(){
return getPolymerElement().getValue();
}
/**
* The value for this element.
*
* JavaScript Info:
* @property value
* @type String
* @behavior PaperTextarea
*/
public void setValue(String value) {
getPolymerElement().setValue(value);
}
/**
* The number that indicates the maximum value of the range.
*
* JavaScript Info:
* @property max
* @type Number
* @behavior PaperSlider
*/
public double getMax(){
return getPolymerElement().getMax();
}
/**
* The number that indicates the maximum value of the range.
*
* JavaScript Info:
* @property max
* @type Number
* @behavior PaperSlider
*/
public void setMax(double value) {
getPolymerElement().setMax(value);
}
/**
* The number that indicates the maximum value of the range.
*
* JavaScript Info:
* @attribute max
* @behavior PaperSlider
*/
public void setMax(String value) {
getPolymerElement().setAttribute("max", value);
}
/**
* The number that indicates the minimum value of the range.
*
* JavaScript Info:
* @property min
* @type Number
* @behavior PaperSlider
*/
public double getMin(){
return getPolymerElement().getMin();
}
/**
* The number that indicates the minimum value of the range.
*
* JavaScript Info:
* @property min
* @type Number
* @behavior PaperSlider
*/
public void setMin(double value) {
getPolymerElement().setMin(value);
}
/**
* The number that indicates the minimum value of the range.
*
* JavaScript Info:
* @attribute min
* @behavior PaperSlider
*/
public void setMin(String value) {
getPolymerElement().setAttribute("min", value);
}
/**
* Returns the ratio of the value.
*
* JavaScript Info:
* @property ratio
* @type Number
* @behavior PaperSlider
*/
public double getRatio(){
return getPolymerElement().getRatio();
}
/**
* Returns the ratio of the value.
*
* JavaScript Info:
* @property ratio
* @type Number
* @behavior PaperSlider
*/
public void setRatio(double value) {
getPolymerElement().setRatio(value);
}
/**
* Returns the ratio of the value.
*
* JavaScript Info:
* @attribute ratio
* @behavior PaperSlider
*/
public void setRatio(String value) {
getPolymerElement().setAttribute("ratio", value);
}
/**
* Specifies the value granularity of the range’s value.
*
* JavaScript Info:
* @property step
* @type Number
* @behavior PaperSlider
*/
public double getStep(){
return getPolymerElement().getStep();
}
/**
* Specifies the value granularity of the range’s value.
*
* JavaScript Info:
* @property step
* @type Number
* @behavior PaperSlider
*/
public void setStep(double value) {
getPolymerElement().setStep(value);
}
/**
* Specifies the value granularity of the range’s value.
*
* JavaScript Info:
* @attribute step
* @behavior PaperSlider
*/
public void setStep(String value) {
getPolymerElement().setAttribute("step", value);
}
/**
* Fired when the slider’s value changes due to user interaction.
* Changes to the slider’s value due to changes in an underlying
bound variable will not trigger this event.
*
* JavaScript Info:
* @event change
*/
public HandlerRegistration addChangeHandler(ChangeEventHandler handler) {
return addHandler(handler, ChangeEvent.TYPE);
}
/**
* Fired when the slider’s immediateValue changes.
*
* JavaScript Info:
* @event immediate-value-change
*/
public HandlerRegistration addImmediateValueChangeHandler(ImmediateValueChangeEventHandler handler) {
return addHandler(handler, ImmediateValueChangeEvent.TYPE);
}
/**
* Fired when the slider’s value changes.
*
* JavaScript Info:
* @event value-change
*/
public HandlerRegistration addValueChangeHandler(ValueChangeEventHandler handler) {
return addHandler(handler, ValueChangeEvent.TYPE);
}
/**
* Fired when the element is added to an iron-form
.
*
* JavaScript Info:
* @event iron-form-element-register
*/
public HandlerRegistration addIronFormElementRegisterHandler(IronFormElementRegisterEventHandler handler) {
return addHandler(handler, IronFormElementRegisterEvent.TYPE);
}
/**
* Fired when the element is removed from an iron-form
.
*
* JavaScript Info:
* @event iron-form-element-unregister
*/
public HandlerRegistration addIronFormElementUnregisterHandler(IronFormElementUnregisterEventHandler handler) {
return addHandler(handler, IronFormElementUnregisterEvent.TYPE);
}
}