plugins.adufour.vars.gui.swing
Class ChannelSelector

java.lang.Object
  extended by plugins.adufour.vars.gui.VarEditor<V>
      extended by plugins.adufour.vars.gui.swing.SwingVarEditor<java.lang.Integer>
          extended by plugins.adufour.vars.gui.swing.ChannelSelector
All Implemented Interfaces:
VarListener<java.lang.Integer>

public class ChannelSelector
extends SwingVarEditor<java.lang.Integer>


Field Summary
 
Fields inherited from class plugins.adufour.vars.gui.VarEditor
variable
 
Constructor Summary
ChannelSelector(Var<java.lang.Integer> variable, Var<icy.sequence.Sequence> sequence, boolean allowAllChannels)
           
 
Method Summary
protected  void activateListeners()
          Activates listeners on the editor component.
 javax.swing.JComponent createEditorComponent()
          Creates a graphical component able to receive user input to change the variable value.
Note that listeners are NOT registered here.
protected  void deactivateListeners()
          Deactivates listeners on the editor component.
 void dispose()
          Dispose of resources (e.g.
 javax.swing.JComboBox getEditorComponent()
           
 java.awt.Dimension getPreferredSize()
           
protected  void updateInterfaceValue()
          Updates the graphical interface component to reflect the new value of the underlying variable (accessible via the Var.getValue() method).
 
Methods inherited from class plugins.adufour.vars.gui.swing.SwingVarEditor
isComponentEnabled, isComponentOpaque, setComponentToolTipText, setEditorEnabled
 
Methods inherited from class plugins.adufour.vars.gui.VarEditor
getComponentHorizontalResizeFactor, getComponentVerticalResizeFactor, getVariable, isComponentFocusable, isComponentResizeable, isNameVisible, referenceChanged, setComponentFocusable, setComponentResizeable, setEnabled, setNameVisible, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelSelector

public ChannelSelector(Var<java.lang.Integer> variable,
                       Var<icy.sequence.Sequence> sequence,
                       boolean allowAllChannels)
Method Detail

createEditorComponent

public javax.swing.JComponent createEditorComponent()
Creates a graphical component able to receive user input to change the variable value.
Note that listeners are NOT registered here. This operation should be done when (and if) the component is to be used (to avoid memory leaks due to improper cleaning)

Specified by:
createEditorComponent in class SwingVarEditor<java.lang.Integer>
Returns:
a graphical input component that is linked to the variable and can be used to view or adjust the variable value

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class SwingVarEditor<java.lang.Integer>
Returns:
The preferred dimension of the local VarEditor.editorComponent. By default, this method calls the component's JComponent.getPreferredSize() method. However, this method can be overridden to provide a custom dimension, e.g. to fix the size of the component regardless of its content

dispose

public void dispose()
Description copied from class: VarEditor
Dispose of resources (e.g. listeners, IO etc.) before releasing the editor. This method must be called by overriding implementations to ensure proper cleaning

Overrides:
dispose in class VarEditor<java.lang.Integer>

updateInterfaceValue

protected void updateInterfaceValue()
Description copied from class: VarEditor
Updates the graphical interface component to reflect the new value of the underlying variable (accessible via the Var.getValue() method).

Specified by:
updateInterfaceValue in class VarEditor<java.lang.Integer>

getEditorComponent

public javax.swing.JComboBox getEditorComponent()
Overrides:
getEditorComponent in class SwingVarEditor<java.lang.Integer>
Returns:
the graphical component used to view or modify the variable's value. By default, the returned component is the one created by the VarEditor.createEditorComponent() method during object construction. This method can be overridden to return a new component for each call (note however that this method may be called many times, e.g. during interface refresh)

activateListeners

protected void activateListeners()
Description copied from class: VarEditor
Activates listeners on the editor component. Listeners should be activated here rather than in the VarEditor.createEditorComponent() method, in order to allow the target containers to optimize the scheduling and load of events to fire, and to ensure proper garbage collection when the interface is destroyed.

Specified by:
activateListeners in class VarEditor<java.lang.Integer>

deactivateListeners

protected void deactivateListeners()
Description copied from class: VarEditor
Deactivates listeners on the editor component. Listeners should be deactivated here rather than in the VarEditor.createEditorComponent() method, in order to allow the target containers to optimize the scheduling and load of events to fire, and to ensure proper garbage collection when the interface is destroyed.

Specified by:
deactivateListeners in class VarEditor<java.lang.Integer>