com.groovemanager.gui.custom.controls
Class FloatControlComposite

java.lang.Object
  extended by com.groovemanager.gui.custom.CustomComposite
      extended by com.groovemanager.gui.custom.controls.FloatControlComposite
All Implemented Interfaces:
ControlContainer

public class FloatControlComposite
extends CustomComposite
implements ControlContainer

This class can be used to make a FloatControl editable for the user

Author:
Manu Robledo

Field Summary
private  boolean auto
          Indicates whether auto-apply is turned on or off
private  javax.sound.sampled.FloatControl control
          The FloatControl to edit
private  org.eclipse.swt.widgets.Label controlName
          The Label containing the Controlīs name
private  org.eclipse.swt.widgets.Label controlUnits
          The Label containing the controlīs unit
private  float prec
          The precision of the Control
private  org.eclipse.swt.widgets.Slider slider
          The slider for value changes
private  org.eclipse.swt.widgets.Text value
          Text field displaying the current value
 
Constructor Summary
FloatControlComposite(javax.sound.sampled.FloatControl control, org.eclipse.swt.widgets.Composite parent)
          Construct a new FloatControlComposite using SWT.NONE style
FloatControlComposite(javax.sound.sampled.FloatControl control, org.eclipse.swt.widgets.Composite parent, int style)
          Construct a new FloatControlComposite
 
Method Summary
 void apply()
          Appl the changes made by the user to the underlying Control instance
protected  org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent, int style)
          This method is to be overwritten by concrete subclasses to create the real contents of this CustomComposite
protected  int[] getListenerTypes()
          For all types of listeners that should be possible to add to this Composite directly, the corresponding SWT.* constant should be contained in the returned Array.
protected  int getPossibleStyles()
          Get a combination of all allowed SWT.* style constants
 void reset()
          Reset the GUI elements to the value of the underlying Control instance
 void setAutoApply(boolean auto)
          Set this Container into auto-apply mode or out of auto-apply mode.
 
Methods inherited from class com.groovemanager.gui.custom.CustomComposite
addListener, checkStyle, getComposite, getData, getListeners, getParent, removeListener, setData, setLayoutData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

auto

private boolean auto
Indicates whether auto-apply is turned on or off


control

private javax.sound.sampled.FloatControl control
The FloatControl to edit


controlName

private org.eclipse.swt.widgets.Label controlName
The Label containing the Controlīs name


controlUnits

private org.eclipse.swt.widgets.Label controlUnits
The Label containing the controlīs unit


prec

private float prec
The precision of the Control


slider

private org.eclipse.swt.widgets.Slider slider
The slider for value changes


value

private org.eclipse.swt.widgets.Text value
Text field displaying the current value

Constructor Detail

FloatControlComposite

public FloatControlComposite(javax.sound.sampled.FloatControl control,
                             org.eclipse.swt.widgets.Composite parent)
Construct a new FloatControlComposite using SWT.NONE style

Parameters:
control - The parent Composite
parent - The parent Composite

FloatControlComposite

public FloatControlComposite(javax.sound.sampled.FloatControl control,
                             org.eclipse.swt.widgets.Composite parent,
                             int style)
Construct a new FloatControlComposite

Parameters:
control - The FloatControl to edit
parent - The parent Composite
style - Combination of SWT.* style constants
Method Detail

apply

public void apply()
Description copied from interface: ControlContainer
Appl the changes made by the user to the underlying Control instance

Specified by:
apply in interface ControlContainer
See Also:
ControlContainer.apply()

createComposite

protected org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
                                                            int style)
Description copied from class: CustomComposite
This method is to be overwritten by concrete subclasses to create the real contents of this CustomComposite

Specified by:
createComposite in class CustomComposite
Parameters:
parent - The parent Composite under which this Composite should be created
style - Combination of valid SWT.* style constants
Returns:
The new created main composite
See Also:
CustomComposite.createComposite(org.eclipse.swt.widgets.Composite, int)

getListenerTypes

protected int[] getListenerTypes()
Description copied from class: CustomComposite
For all types of listeners that should be possible to add to this Composite directly, the corresponding SWT.* constant should be contained in the returned Array.

Specified by:
getListenerTypes in class CustomComposite
Returns:
An Array of SWT.* constants defining the set of listeners types applicable to this Composite
See Also:
CustomComposite.getListenerTypes()

getPossibleStyles

protected int getPossibleStyles()
Description copied from class: CustomComposite
Get a combination of all allowed SWT.* style constants

Specified by:
getPossibleStyles in class CustomComposite
Returns:
A combination of all allowed style constants, for example SWT.BORDER | SWT.LEFT | SWT.BORDER
See Also:
CustomComposite.getPossibleStyles()

reset

public void reset()
Description copied from interface: ControlContainer
Reset the GUI elements to the value of the underlying Control instance

Specified by:
reset in interface ControlContainer
See Also:
ControlContainer.reset()

setAutoApply

public void setAutoApply(boolean auto)
Description copied from interface: ControlContainer
Set this Container into auto-apply mode or out of auto-apply mode. In auto-apply mode all changes made by the user will be directly made to the underlying Control instance

Specified by:
setAutoApply in interface ControlContainer
Parameters:
auto - true if auto-apply should be turned on, false otherwise
See Also:
ControlContainer.setAutoApply(boolean)