Package qupath.lib.plugins.parameters
Interface Parameter<S>
- Type Parameters:
S
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
BooleanParameter
,ChoiceParameter
,DoubleParameter
,EmptyParameter
,IntParameter
,NumericParameter
,StringParameter
Interface defining algorithm parameters, which need to be displayed to users somehow.
- Author:
- Pete Bankhead
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new Parameter with the same text and value.Get a default value to use if the Parameter has not been otherwise set.Get a description of the meaning of the Parameter; may be displayed e.g.Get some prompt text that may be displayed to a user.getValue()
Get the current set value (may be null).Get the current set value, or any default if no value has been set.boolean
Query whether getHelpText() returns a meaningful String (as opposed to null).boolean
isHidden()
Test is the 'hidden' flag is set for the parameter.boolean
isValidInput
(S value) Query if a specified value would be valid for this parameter.void
Set last value to null (so default can be used).void
setHidden
(boolean hidden) Mark that a parameter should not be displayed to a user.boolean
setStringLastValue
(Locale locale, String value) Set last value using a string; implementing classes may need to parse thisboolean
Set the Parameter to have a specified value.
-
Method Details
-
getDefaultValue
S getDefaultValue()Get a default value to use if the Parameter has not been otherwise set.- Returns:
-
setValue
Set the Parameter to have a specified value.- Parameters:
value
-- Returns:
-
setStringLastValue
Set last value using a string; implementing classes may need to parse this- Parameters:
locale
-value
-- Returns:
-
resetValue
void resetValue()Set last value to null (so default can be used). -
getValue
S getValue()Get the current set value (may be null).- Returns:
- See Also:
-
getValueOrDefault
S getValueOrDefault()Get the current set value, or any default if no value has been set.- Returns:
- See Also:
-
getPrompt
String getPrompt()Get some prompt text that may be displayed to a user.- Returns:
-
isValidInput
Query if a specified value would be valid for this parameter.- Parameters:
value
-- Returns:
- true if the value would be valid, false otherwise
-
setHidden
void setHidden(boolean hidden) Mark that a parameter should not be displayed to a user. This is useful, for example, if a parameter list changes the parameters to be displayed depending upon the image available or current settings, e.g. using different parameters when the pixel size is known in microns.- Parameters:
hidden
-
-
isHidden
boolean isHidden()Test is the 'hidden' flag is set for the parameter.- Returns:
-
duplicate
Create a new Parameter with the same text and value.- Returns:
-
hasHelpText
boolean hasHelpText()Query whether getHelpText() returns a meaningful String (as opposed to null).- Returns:
-
getHelpText
String getHelpText()Get a description of the meaning of the Parameter; may be displayed e.g. as a tooltip.- Returns:
-