goog.ui.TwoThumbSlider
Classgoog.ui.TwoThumbSlider
> goog.ui.SliderBase
> goog.ui.Component
> goog.events.EventTarget
> goog.Disposable
goog.ui.TwoThumbSlider(opt_domHelper)
This creates a TwoThumbSlider object.
opt_domHelper
{goog.dom.DomHelper
=}
.CSS_CLASS_PREFIX
{string
}The prefix we use for the CSS class names for the slider and its elements.
.EXTENT_THUMB_CSS_CLASS
{string
}CSS class name for the extent thumb element.
.RANGE_HIGHLIGHT_CSS_CLASS
{string
}CSS class name for the range highlight element.
.VALUE_THUMB_CSS_CLASS
{string
}CSS class name for the value thumb element.
.addChild(child, opt_render)
Inherited from goog.ui.Component
.
Adds the specified component as the last child of this component. See {@link goog.ui.Component#addChildAt} for detailed semantics.
child
{goog.ui.Component
}
opt_render
{boolean
=}
.addChildAt(child, index, opt_render)
Inherited from goog.ui.Component
.
Adds the specified component as a child of this component at the given 0-based index. Both {@code addChild} and {@code addChildAt} assume the following contract between parent and child components:
child
{goog.ui.Component
}
index
{number
}
opt_render
{boolean
=}
void
}
.addEventListener(type, handler, opt_capture, opt_handlerScope)
Inherited from goog.events.EventTarget
.
Adds an event listener to the event target. The same handler can only be added once per the type. Even if you add the same handler multiple times using the same type then it will only be called once when the event is dispatched. Supported for legacy but use goog.events.listen(src, type, handler) instead.
type
{string
}
handler
{Function
|Object
}
opt_capture
{boolean
=}
opt_handlerScope
{Object
=}
.addOnDisposeCallback(callback, opt_scope)
Inherited from goog.Disposable
.
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
callback
{!Function
}
opt_scope
{Object
=}
.animatedSetValue(v)
Inherited from goog.ui.SliderBase
.
Sets the value and starts animating the handle towards that position.
v
{number
}
.canDecorate(element)
Inherited from goog.ui.Component
.
Determines if a given element can be decorated by this type of component. This method should be overridden by inheriting objects.
element
{Element
}
boolean
}
.createDom()
Inherited from goog.ui.SliderBase
.
Creates the initial DOM representation for the component. The default implementation is to set this.element_ = div.
.createThumbs()
[protected] {function
() : void
}Creates the thumb members for a twothumbslider. If the element contains a child with a class name 'goog-twothumbslider-value-thumb' (or 'goog-twothumbslider-extent-thumb', respectively), then that will be used as the valueThumb (or as the extentThumb, respectively). If the element contains a child with a class name 'goog-twothumbslider-rangehighlight', then that will be used as the range highlight.
.creationStack
{string
}Inherited from goog.Disposable
.
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
.decorate(element)
Inherited from goog.ui.Component
.
Decorates the element for the UI component.
element
{Element
}
.decorateInternal(element)
[protected]Inherited from goog.ui.SliderBase
.
Actually decorates the element. Should be overridden by inheriting objects. This method can assume there are checks to ensure the component has not already been rendered have occurred and that enter document will be called afterwards. This method is considered protected.
element
{Element
}
.dispatchEvent(e)
Inherited from goog.events.EventTarget
.
Dispatches an event (or event like object) and calls all listeners listening for events of this type. The type of the event is decided by the type property on the event object. If any of the listeners returns false OR calls preventDefault then this function will return false. If one of the capture listeners calls stopPropagation, then the bubble listeners won't fire.
e
{string
|Object
|goog.events.Event
}
boolean
}
.dispose()
Inherited from goog.Disposable
.
Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
void
}
.disposeInternal()
[protected]Inherited from goog.ui.SliderBase
.
Disposes of the component. Calls {@code exitDocument}, which is expected to remove event handlers and clean up the component. Propagates the call to the component's children, if any. Removes the component's DOM from the document unless it was decorated.
.dom_
[protected] {!goog.dom.DomHelper
}Inherited from goog.ui.Component
.
DomHelper used to interact with the document, allowing components to be created in a different window.
.enableFlipForRtl(flipForRtl)
Inherited from goog.ui.SliderBase
.
Enables/disables true RTL behavior. This should be called immediately after construction. This is a temporary flag to allow clients to transition to the new behavior at their convenience. At some point it will be the default.
flipForRtl
{boolean
}
.enterDocument()
Inherited from goog.ui.SliderBase
.
Called when the DOM for the component is for sure in the document. Subclasses should override this method to set this element's role.
.exitDocument()
Inherited from goog.ui.SliderBase
.
Called by dispose to clean up the elements and listeners created by a component, or by a parent component/application who has removed the component from the document but wants to reuse it later. If the component contains child components, this call is propagated to its children. It should be possible for the component to be rendered again once this method has been called.
.extentThumb
[protected] {HTMLDivElement
}Inherited from goog.ui.SliderBase
.
The maxThumb dom-element, pointing to the end of the selected range.
.forEachChild(f, opt_obj)
Inherited from goog.ui.Component
.
Calls the given function on each of this component's children in order. If {@code opt_obj} is provided, it will be used as the 'this' object in the function when called. The function should take two arguments: the child component and its 0-based index. The return value is ignored.
f
{Function
}
opt_obj
{Object
=}
.getBlockIncrement()
Inherited from goog.ui.SliderBase
.
number
}
.getChild(id)
Inherited from goog.ui.Component
.
Returns the child with the given ID, or null if no such child exists.
id
{string
}
goog.ui.Component
?}
.getChildAt(index)
Inherited from goog.ui.Component
.
Returns the child at the given index, or null if the index is out of bounds.
index
{number
}
goog.ui.Component
?}
.getChildCount()
Inherited from goog.ui.Component
.
Returns the number of children of this component.
number
}
.getChildIds()
Inherited from goog.ui.Component
.
Returns an array containing the IDs of the children of this component, or an empty array if the component has no children.
Array
.<string
>}
.getContentElement()
Inherited from goog.ui.Component
.
Returns the DOM element into which child components are to be rendered, or null if the component itself hasn't been rendered yet. This default implementation returns the component's root element. Subclasses with complex DOM structures must override this method.
Element
}
.getCssClass(orient)
[protected]Returns the CSS class applied to the slider element for the given orientation. Subclasses must override this method.
orient
{goog.ui.SliderBase.Orientation
}
string
}
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.getDomHelper()
Inherited from goog.ui.Component
.
Returns the dom helper that is being used on this component.
goog.dom.DomHelper
}
.getElement()
Inherited from goog.ui.Component
.
Gets the component's element.
Element
}
.getElementByClass(className)
Inherited from goog.ui.Component
.
Returns the first element in this component's DOM with the provided className.
className
{string
}
Element
}
.getElementByFragment(idFragment)
Inherited from goog.ui.Component
.
Helper function for returning an element in the document with a unique id generated using makeId().
idFragment
{string
}
Element
}
.getElementsByClass(className)
Inherited from goog.ui.Component
.
Returns an array of all the elements in this component's DOM with the provided className.
className
{string
}
goog.array.ArrayLike
}
.getExtent()
Inherited from goog.ui.SliderBase
.
number
}
.getExtentThumb()
Inherited from goog.ui.SliderBase
.
HTMLDivElement
}
.getFragmentFromId(id)
Inherited from goog.ui.Component
.
Helper function for returning the fragment portion of an id generated using makeId().
id
{string
}
string
}
.getHandler()
[protected]Inherited from goog.ui.Component
.
Returns the event handler for this component, lazily created the first time this method is called.
goog.events.EventHandler
}
.getId()
Inherited from goog.ui.Component
.
Gets the unique ID for the instance of this component. If the instance doesn't already have an ID, generates one on the fly.
string
}
.getMaximum()
Inherited from goog.ui.SliderBase
.
number
}
.getMinimum()
Inherited from goog.ui.SliderBase
.
number
}
.getModel()
Inherited from goog.ui.Component
.
Returns the model associated with the UI component.
.getMoveToPointEnabled()
Inherited from goog.ui.SliderBase
.
boolean
}
.getOrientation()
Inherited from goog.ui.SliderBase
.
goog.ui.SliderBase.Orientation
}
.getParent()
Inherited from goog.ui.Component
.
Returns the component's parent, if any.
goog.ui.Component
?}
.getParentEventTarget()
Inherited from goog.events.EventTarget
.
Returns the parent of this event target to use for bubbling.
goog.events.EventTarget
}
.getStep()
Inherited from goog.ui.SliderBase
.
number
}
.getThumbCoordinateForValue(val)
Inherited from goog.ui.SliderBase
.
Returns the position to move the handle to for a given value
val
{number
}
goog.math.Coordinate
}
.getUnitIncrement()
Inherited from goog.ui.SliderBase
.
number
}
.getValue()
Inherited from goog.ui.SliderBase
.
number
}
.getValueFromMousePosition(e)
Inherited from goog.ui.SliderBase
.
Returns the value to use for the current mouse position
e
{goog.events.Event
}
number
}
.getValueThumb()
Inherited from goog.ui.SliderBase
.
HTMLDivElement
}
.handleRangeModelChange(e)
[protected]Inherited from goog.ui.SliderBase
.
Call back when the internal range model changes. Sub-classes may override and re-enter this method to update a11y state. Consider protected.
e
{goog.events.Event
}
.hasChildren()
Inherited from goog.ui.Component
.
Returns true if the component has children.
boolean
}
.indexOfChild(child)
Inherited from goog.ui.Component
.
Returns the 0-based index of the given child component, or -1 if no such child is found.
child
{goog.ui.Component
?}
number
}
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.isEnabled()
Inherited from goog.ui.SliderBase
.
boolean
}
.isHandleMouseWheel()
Inherited from goog.ui.SliderBase
.
boolean
}
.isInDocument()
Inherited from goog.ui.Component
.
Determines whether the component has been added to the document.
boolean
}
.isRightToLeft()
Inherited from goog.ui.Component
.
Returns true if the component is rendered right-to-left, false otherwise. The first time this function is invoked, the right-to-left rendering property is set if it has not been already.
boolean
}
.makeId(idFragment)
Inherited from goog.ui.Component
.
Helper function for subclasses that gets a unique id for a given fragment, this can be used by components to generate unique string ids for DOM elements.
idFragment
{string
}
string
}
.makeIds(object)
Inherited from goog.ui.Component
.
Makes a collection of ids. This is a convenience method for makeId. The object's values are the id fragments and the new values are the generated ids. The key will remain the same.
object
{Object
}
Object
}
.moveThumbs(delta)
Inherited from goog.ui.SliderBase
.
Moves the thumbs by the specified delta as follows - as long as both thumbs stay within [min,max], both thumbs are moved - once a thumb reaches or exceeds min (or max, respectively), it stays - at min (or max, respectively). In case both thumbs have reached min (or max), no change event will fire.
delta
{number
}
.rangeHighlight
[protected] {HTMLDivElement
}Inherited from goog.ui.SliderBase
.
The dom-element highlighting the selected range.
.rangeModel
[protected] {goog.ui.RangeModel
}Inherited from goog.ui.SliderBase
.
The underlying range model
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.removeChild(child, opt_unrender)
Inherited from goog.ui.Component
.
Removes the given child from this component, and returns it. Throws an error if the argument is invalid or if the specified child isn't found in the parent component. The argument can either be a string (interpreted as the ID of the child component to remove) or the child component itself. If {@code opt_unrender} is true, calls {@link goog.ui.component#exitDocument} on the removed child, and subsequently detaches the child's DOM from the document. Otherwise it is the caller's responsibility to clean up the child component's DOM.
child
{string
|goog.ui.Component
|null
}
opt_unrender
{boolean
=}
goog.ui.Component
}
.removeChildAt(index, opt_unrender)
Inherited from goog.ui.Component
.
Removes the child at the given index from this component, and returns it. Throws an error if the argument is out of bounds, or if the specified child isn't found in the parent. See {@link goog.ui.Component#removeChild} for detailed semantics.
index
{number
}
opt_unrender
{boolean
=}
goog.ui.Component
}
.removeChildren(opt_unrender)
Inherited from goog.ui.Component
.
Removes every child component attached to this one and returns them.
opt_unrender
{boolean
=}
Array
.<goog.ui.Component
>|undefined
}
.removeEventListener(type, handler, opt_capture, opt_handlerScope)
Inherited from goog.events.EventTarget
.
Removes an event listener from the event target. The handler must be the same object as the one added. If the handler has not been added then nothing is done.
type
{string
}
handler
{Function
|Object
}
opt_capture
{boolean
=}
opt_handlerScope
{Object
=}
.render(opt_parentElement)
Inherited from goog.ui.Component
.
Renders the component. If a parent element is supplied, the component's element will be appended to it. If there is no optional parent element and the element doesn't have a parentNode then it will be appended to the document body. If this component has a parent component, and the parent component is not in the document already, then this will not call {@code enterDocument} on this component. Throws an Error if the component is already rendered.
opt_parentElement
{Element
=}
.renderBefore(sibling)
Inherited from goog.ui.Component
.
Renders the component before another element. The other element should be in the document already. Throws an Error if the component is already rendered.
sibling
{Node
}
.setBlockIncrement(value)
Inherited from goog.ui.SliderBase
.
Sets the amount to increment/decrement for page up/down as well as when holding down the mouse button on the background.
value
{number
}
.setElementInternal(element)
[protected]Inherited from goog.ui.Component
.
Sets the component's root element to the given element. Considered protected and final. This should generally only be called during createDom. Setting the element does not actually change which element is rendered, only the element that is associated with this UI component.
element
{Element
}
.setEnabled(enable)
Inherited from goog.ui.SliderBase
.
Enables or disables the slider. A disabled slider will ignore all user-initiated events. Also fires goog.ui.Component.EventType.ENABLE/DISABLE event as appropriate.
enable
{boolean
}
.setExtent(extent)
Inherited from goog.ui.SliderBase
.
Sets the extent of the underlying range model. We enforce that getMinExtent() <= extent <= getMaximum() - getValue() If this is not satisifed for the given extent, the call is ignored and no CHANGE event fires.
extent
{number
}
.setHandleMouseWheel(enable)
Inherited from goog.ui.SliderBase
.
Enables or disables mouse wheel handling for the slider. The mouse wheel handler enables the user to change the value of slider using a mouse wheel.
enable
{boolean
}
.setId(id)
Inherited from goog.ui.Component
.
Assigns an ID to this component instance. It is the caller's responsibility to guarantee that the ID is unique. If the component is a child of a parent component, then the parent component's child index is updated to reflect the new ID; this may throw an error if the parent already has a child with an ID that conflicts with the new ID.
id
{string
}
.setMaximum(max)
Inherited from goog.ui.SliderBase
.
Sets the maximum number.
max
{number
}
.setMinExtent(value)
Inherited from goog.ui.SliderBase
.
Sets the minimal value that the extent may have.
value
{number
}
.setMinimum(min)
Inherited from goog.ui.SliderBase
.
Sets the minimum number.
min
{number
}
.setModel(obj)
Inherited from goog.ui.Component
.
Sets the model associated with the UI component.
obj
{*}
.setMoveToPointEnabled(val)
Inherited from goog.ui.SliderBase
.
Sets whether clicking on the background should move directly to that point.
val
{boolean
}
.setOrientation(orient)
Inherited from goog.ui.SliderBase
.
Changes the orientation.
orient
{goog.ui.SliderBase.Orientation
}
.setParent(parent)
Inherited from goog.ui.Component
.
Sets the parent of this component to use for event bubbling. Throws an error if the component already has a parent or if an attempt is made to add a component to itself as a child. Callers must use {@code removeChild} or {@code removeChildAt} to remove components from their containers before calling this method.
parent
{goog.ui.Component
}
.setParentEventTarget(parent)
Inherited from goog.ui.Component
.
Overrides {@link goog.events.EventTarget#setParentEventTarget} to throw an error if the parent component is set, and the argument is not the parent.
parent
{goog.events.EventTarget
?}
.setRightToLeft(rightToLeft)
Inherited from goog.ui.Component
.
Set is right-to-left. This function should be used if the component needs to know the rendering direction during dom creation (i.e. before {@link #enterDocument} is called and is right-to-left is set).
rightToLeft
{boolean
}
.setStep(step)
Inherited from goog.ui.SliderBase
.
Sets the step value. The step value is used to determine how to round the value.
step
{?number
}
.setUnitIncrement(value)
Inherited from goog.ui.SliderBase
.
Sets the amount to increment/decrement for up, down, left and right arrow keys.
value
{number
}
.setValue(value)
Inherited from goog.ui.SliderBase
.
Sets the value of the underlying range model. We enforce that getMinimum() <= value <= getMaximum() - getExtent() If this is not satisifed for the given value, the call is ignored and no CHANGE event fires.
value
{number
}
.setValueAndExtent(value, extent)
Inherited from goog.ui.SliderBase
.
Sets the value and extent of the underlying range model. We enforce that getMinimum() <= value <= getMaximum() - extent and getMinExtent <= extent <= getMaximum() - getValue() If this is not satisifed for the given extent, the call is ignored and no CHANGE event fires. This is a utility method to allow setting the thumbs simultaneously and ensuring that only one event fires.
value
{number
}
extent
{number
}
.setVisible(visible)
Inherited from goog.ui.SliderBase
.
Change the visibility of the slider. You must call this if you had set the slider's value when it was invisible.
visible
{boolean
}
.updateAriaStates()
[protected]Inherited from goog.ui.SliderBase
.
Set a11y roles and state when values change.
.valueThumb
[protected] {HTMLDivElement
}Inherited from goog.ui.SliderBase
.
The minThumb dom-element, pointing to the start of the selected range.
.wasDecorated()
Inherited from goog.ui.Component
.
boolean
}