Class NumberArgument
java.lang.Object
org.gorpipe.querydialogs.BasicBean
org.gorpipe.querydialogs.AbstractListBean
org.gorpipe.querydialogs.Argument
org.gorpipe.querydialogs.argument.NumberArgument
- All Implemented Interfaces:
java.io.Serializable,javax.swing.ListModel
public class NumberArgument extends Argument
Represents an argument that expects a numeric value.
Provides support for specifying a minimum and/or a maximum allowed value
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROPERTY_NUMBER_VALUEThe property name for the argument's numeric value.Fields inherited from class org.gorpipe.querydialogs.Argument
allowedValues, defaultValue, DEFERRED_LIST, path2LoadedValues, path2LoadedValuesHeader, PROPERTY_OPERATOR, PROPERTY_VALUE, type, value -
Constructor Summary
Constructors Constructor Description NumberArgument(NumberArgument numbArg)Constructor that copies the input number argument.NumberArgument(ArgumentDescription argDescr, java.lang.Boolean optional, java.lang.Object defaultValue, java.util.List<? extends java.lang.Object> allowedValues, java.net.URI valuesPath, java.util.List<java.lang.String> operators, java.lang.Boolean advanced, java.lang.Integer displayWidth, java.lang.Number min, java.lang.Number max, ArgumentType argType) -
Method Summary
Modifier and Type Method Description NumberArgumentcopyArgument()Make a copy of the argument.java.lang.DoublegetMax()intgetMaxTextFieldMinWidth()Get the minium width of a text field for the argument maximum value.java.lang.DoublegetMin()intgetMinTextFieldMinWidth()Get the minium width of a text field for the argument minimum value.java.lang.NumbergetNumberValue()intgetValueTextFieldMinWidth()The minium width of a text field for the argument value.protected java.lang.ObjectparseValue(java.lang.String val)voidsetMax(java.lang.Double max)voidsetMaxTextFieldMinWidth(int maxTextFieldMinWidth)Set the minium width of a text field for the argument maximum value.voidsetMin(java.lang.Double min)voidsetMinTextFieldMinWidth(int minTextFieldMinWidth)Set the minium width of a text field for the argument minimum value.voidsetNumberValue(java.lang.Number value)voidsetValue(java.lang.Object value)voidsetValueTextFieldMinWidth(int valueTextFieldMinWidth)Set the minium width of a text field for the argument value.Methods inherited from class org.gorpipe.querydialogs.Argument
checkAllowed, deferredValuesLoaded, getDefaultValue, getDescription, getDisplayName, getDisplayWidth, getElementAt, getName, getOperator, getOperators, getSize, getTooltip, getType, getValue, getValuesHeader, getValuesPath, hasDeferredValues, isAdvanced, isEmpty, isOptional, loadDeferredValues, setDisplayWidth, setOperator, setValue, toStringMethods inherited from class org.gorpipe.querydialogs.AbstractListBean
addListDataListener, fireContentsChanged, removeListDataListenerMethods inherited from class org.gorpipe.querydialogs.BasicBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
PROPERTY_NUMBER_VALUE
public static final java.lang.String PROPERTY_NUMBER_VALUEThe property name for the argument's numeric value.- See Also:
- Constant Field Values
-
-
Constructor Details
-
NumberArgument
public NumberArgument(ArgumentDescription argDescr, java.lang.Boolean optional, java.lang.Object defaultValue, java.util.List<? extends java.lang.Object> allowedValues, java.net.URI valuesPath, java.util.List<java.lang.String> operators, java.lang.Boolean advanced, java.lang.Integer displayWidth, java.lang.Number min, java.lang.Number max, ArgumentType argType)- Parameters:
min- - the minimum allowed valuemax- - the maximum allowed value
-
NumberArgument
Constructor that copies the input number argument.- Parameters:
numbArg- the number argument to copy
-
-
Method Details
-
getMin
public java.lang.Double getMin() -
setMin
public void setMin(java.lang.Double min) -
getMax
public java.lang.Double getMax() -
setMax
public void setMax(java.lang.Double max) -
setValue
public void setValue(java.lang.Object value) -
getNumberValue
public java.lang.Number getNumberValue() -
setNumberValue
public void setNumberValue(java.lang.Number value) -
parseValue
protected java.lang.Object parseValue(java.lang.String val)- Overrides:
parseValuein classArgument
-
getValueTextFieldMinWidth
public int getValueTextFieldMinWidth()The minium width of a text field for the argument value. Used for example if the argument belongs to a group.- Returns:
- the minium width of a text field for the argument value
-
setValueTextFieldMinWidth
public void setValueTextFieldMinWidth(int valueTextFieldMinWidth)Set the minium width of a text field for the argument value. Used for example if the argument belongs to a group.- Parameters:
valueTextFieldMinWidth- the width value to set
-
getMinTextFieldMinWidth
public int getMinTextFieldMinWidth()Get the minium width of a text field for the argument minimum value. Used for example if the argument belongs to a group.- Returns:
- the minium width of a text field for the argument minimum value
-
setMinTextFieldMinWidth
public void setMinTextFieldMinWidth(int minTextFieldMinWidth)Set the minium width of a text field for the argument minimum value. Used for example if the argument belongs to a group.- Parameters:
minTextFieldMinWidth- the width to set
-
getMaxTextFieldMinWidth
public int getMaxTextFieldMinWidth()Get the minium width of a text field for the argument maximum value. Used for example if the argument belongs to a group.- Returns:
- the minium width of a text field for the argument maximum value
-
setMaxTextFieldMinWidth
public void setMaxTextFieldMinWidth(int maxTextFieldMinWidth)Set the minium width of a text field for the argument maximum value. Used for example if the argument belongs to a group.- Parameters:
maxTextFieldMinWidth- the width to set
-
copyArgument
Description copied from class:ArgumentMake a copy of the argument.- Specified by:
copyArgumentin classArgument- Returns:
- the argument copy
-