private void slidersValueChangeListeners ( ) { colorPickerLayout . getRedSlider ( ) . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; @ Override public void valueChange ( final ValueChangeEvent event ) { final double red = ( Double ) event . getProperty ( ) . getValue ( ) ; final Color newColor = new Color ( ( int ) red , colorPickerLayout . getSelectedColor ( ) . getGreen ( ) , colorPickerLayout . getSelectedColor ( ) . getBlue ( ) ) ; setColorToComponents ( newColor ) ; } } ) ; colorPickerLayout . getGreenSlider ( ) . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; @ Override public void valueChange ( final ValueChangeEvent event ) { final double green = ( Double ) event . getProperty ( ) . getValue ( ) ; final Color newColor = new Color ( colorPickerLayout . getSelectedColor ( ) . getRed ( ) , ( int ) green , colorPickerLayout . getSelectedColor ( ) . getBlue ( ) ) ; setColorToComponents ( newColor ) ; } } ) ; colorPickerLayout . getBlueSlider ( ) . addValueChangeListener ( new ValueChangeListener ( ) { private static final long serialVersionUID = 1L ; @ Override public void valueChange ( final ValueChangeEvent event ) { final double blue = ( Double ) event . getProperty ( ) . getValue ( ) ; final Color newColor = new Color ( colorPickerLayout . getSelectedColor ( ) . getRed ( ) , colorPickerLayout . getSelectedColor ( ) . getGreen ( ) , ( int ) blue ) ; setColorToComponents ( newColor ) ; } } ) ; }
Value change listeners implementations of sliders .