ButtonWheel Component
This Echo3 component is modelled after the 'spinner' example given in the Echo Development Guide for Client Side Components. A property change and an action events are sent to the server. The property change affects the 'ActionCommand' associated with the button, and the action event is sent to registered listeners.
The current JavaScript data model for this component uses and integer model, in which left and right buttons, decrement and increment, while the top button set the value to zero and bottom button set the value to its maximum. This may not ideal for all cases. See the next paragraph.
Future enhanements include, specifying the ActionCommand for each button, loading a user supplied image to serve as the button background and, most importantly of all, uploading an alternate (JavaScript) button model to change value behavior of the buttons.
Demonstration
The range is set from 0 to 100, the right and left buttons increment and decrement the value, the up button sets the component to its minimum value, while the down button sets its maximum value, as if one were selecting the top or the bottom of a vertical list. A mouse scroll wheel will also affect the component's value and feedback display.
Firefox does not use the 'onmousewheel' event type, but rather, 'DOMMouseScroll' event type. Echo3 registers JavaScript events by using a shorten form i.e. 'mousewheel' and prefixing this with 'on'. Hence, it is not straight forward to register the 'DOMMouseScroll' and thus no scroll wheel support for the FireFox browser.
ButtonWheel - Summary API
package org.informagen.echo.app;
// Echo - Components
import nextapp.echo.app.Component;
// Echo - Events
import nextapp.echo.app.event.ActionListener;
// Echo - Button Model
import nextapp.echo.app.button.ButtonModel;
public class ButtonWheel extends Component {
public ButtonWheel()
public ButtonWheel(final int diameter)
public ButtonModel getModel()
public int getDiameter()
public void setDiameter(final int diameter)
public int getMaximum()
public void setMaximum(final int maximum)
public int getMinimum()
public void setMinimum(final int minimum )
public int getValue()
public void setValue(final int value)
public int getSensitivity()
public void setSensitivity(final int sensitivity)
public void processInput(String inputName, Object inputValue)
public void addActionListener(ActionListener listener)
public void removeActionListener(ActionListener listener)
}