org.knime.core.node.defaultnodesettings
Class DialogComponentDoubleRange

java.lang.Object
  extended by org.knime.core.node.defaultnodesettings.DialogComponent
      extended by org.knime.core.node.defaultnodesettings.DialogComponentDoubleRange

public class DialogComponentDoubleRange
extends DialogComponent

Allows the user to enter a floating point number range. It shows two spinners labeled "min=" and "max=" which expect each a floating point number. The component requires a SettingsModelDoubleRange with its constructor, that holds the two values entered.

Author:
berthold, University of Konstanz
See Also:
SettingsModelDoubleRange

Nested Class Summary
 
Nested classes/interfaces inherited from class org.knime.core.node.defaultnodesettings.DialogComponent
DialogComponent.EmptySettingsModel
 
Field Summary
 
Fields inherited from class org.knime.core.node.defaultnodesettings.DialogComponent
DEFAULT_BG, DEFAULT_FG
 
Constructor Summary
DialogComponentDoubleRange(SettingsModelDoubleRange model, double lowerMin, double lowerMax, double lowerStepSize, double upperMin, double upperMax, double upperStepSize, String label)
          Finegrain constructor to specify minimum and maximum values for the lower and upper bound and different step sizes for each spinner.
DialogComponentDoubleRange(SettingsModelDoubleRange model, double lowerMin, double upperMax, double stepSize, String label)
          Creates two spinner to enter the lower and upper value of the range.
DialogComponentDoubleRange(SettingsModelDoubleRange model, String label)
          Deprecated. use DialogComponentDoubleRange( SettingsModelDoubleRange, double, double, double, String) or this DialogComponentDoubleRange(SettingsModelDoubleRange, double, double, double, double, double, double, String) constructor instead.
 
Method Summary
protected  void checkConfigurabilityBeforeLoad(PortObjectSpec[] specs)
          Will be called before the new values are loaded from the NodeSettings object.
protected  void setEnabledComponents(boolean enabled)
          This method is called by the above (final) DialogComponent.setEnabled(boolean) method.
 void setToolTipText(String text)
          Implement this so it sets the tooltip on your component(s).
protected  void updateComponent()
          Read the value from the DialogComponent.EmptySettingsModel and set/display it in the component.
protected  void validateSettingsBeforeSave()
          Will be called before the value of the component is saved into the NodeSettings object.
 
Methods inherited from class org.knime.core.node.defaultnodesettings.DialogComponent
clearError, getComponentPanel, getLastTableSpec, getLastTableSpecs, getModel, loadSettingsFrom, saveSettingsTo, setEnabled, showError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogComponentDoubleRange

@Deprecated
public DialogComponentDoubleRange(SettingsModelDoubleRange model,
                                             String label)
Deprecated. use DialogComponentDoubleRange( SettingsModelDoubleRange, double, double, double, String) or this DialogComponentDoubleRange(SettingsModelDoubleRange, double, double, double, double, double, double, String) constructor instead.

Constructor assumes the range between 0 and 10.

Parameters:
model - stores the double numbers entered.
label - the text showing next to the components.

DialogComponentDoubleRange

public DialogComponentDoubleRange(SettingsModelDoubleRange model,
                                  double lowerMin,
                                  double upperMax,
                                  double stepSize,
                                  String label)
Creates two spinner to enter the lower and upper value of the range.

Parameters:
model - stores the double numbers entered
lowerMin - minimum value to be entered
upperMax - maximum value to be entered
stepSize - step size for the spinners
label - label for this component

DialogComponentDoubleRange

public DialogComponentDoubleRange(SettingsModelDoubleRange model,
                                  double lowerMin,
                                  double lowerMax,
                                  double lowerStepSize,
                                  double upperMin,
                                  double upperMax,
                                  double upperStepSize,
                                  String label)
Finegrain constructor to specify minimum and maximum values for the lower and upper bound and different step sizes for each spinner.

Parameters:
model - stores the double numbers entered
lowerMin - minimum value for the lower bound spinner
lowerMax - maximum value for the lower bound spinner
lowerStepSize - step size for the lower bound spinner
upperMin - minimum value for the upper bound spinner
upperMax - maximum value for the upper bound spinner
upperStepSize - step size for the upper bound spinner
label - label for this component
Method Detail

checkConfigurabilityBeforeLoad

protected void checkConfigurabilityBeforeLoad(PortObjectSpec[] specs)
                                       throws NotConfigurableException
Will be called before the new values are loaded from the NodeSettings object. Can be used to avoid loading due to missing, invalid, or inappropriate incoming table specs.
Note: This is called even if the component is disabled. Don't reject specs that might be handled by other components

Specified by:
checkConfigurabilityBeforeLoad in class DialogComponent
Parameters:
specs - the specs from the input ports.
Throws:
NotConfigurableException - if the component can't be used due to inappropriate table specs. (Prevents the dialog from being opened.)

setEnabledComponents

protected void setEnabledComponents(boolean enabled)
This method is called by the above (final) DialogComponent.setEnabled(boolean) method. Derived classes should disable all the contained components in here.

Specified by:
setEnabledComponents in class DialogComponent
Parameters:
enabled - the new status of the component
See Also:
DialogComponent.setEnabled(boolean)

setToolTipText

public void setToolTipText(String text)
Implement this so it sets the tooltip on your component(s).

Specified by:
setToolTipText in class DialogComponent
Parameters:
text - the tool tip text to set.
See Also:
JComponent.setToolTipText(java.lang.String)

updateComponent

protected void updateComponent()
Read the value from the DialogComponent.EmptySettingsModel and set/display it in the component. (Called after loading new values in the model to ensure they are transfered into the component.) Implementations should set the new value(s) in the components, should clear any possible error indications, and should also take over the enable state.

Specified by:
updateComponent in class DialogComponent

validateSettingsBeforeSave

protected void validateSettingsBeforeSave()
                                   throws InvalidSettingsException
Will be called before the value of the component is saved into the NodeSettings object. Can be used to commit values, to update the model and must be used to validate the entered value. NOTE: it will be called even if the model is disabled.

Specified by:
validateSettingsBeforeSave in class DialogComponent
Throws:
InvalidSettingsException - if the entered values are invalid


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.