Class NumberFormField.NumberFormFieldBuilder<Type extends Number & Comparable<?>>
java.lang.Object
com.github.tadukoo.view.form.field.FormField.FormFieldBuilder<Type>
com.github.tadukoo.view.form.field.number.NumberFormField.NumberFormFieldBuilder<Type>
- Type Parameters:
Type
- The type ofNumber
being stored in the field (used for default value)
- Direct Known Subclasses:
DoubleFormField.DoubleFormFieldBuilder
,FloatFormField.FloatFormFieldBuilder
,IntFormField.IntFormFieldBuilder
,LongFormField.LongFormFieldBuilder
,ShortFormField.ShortFormFieldBuilder
- Enclosing class:
- NumberFormField<Type extends Number & Comparable<?>>
public abstract static class NumberFormField.NumberFormFieldBuilder<Type extends Number & Comparable<?>>
extends FormField.FormFieldBuilder<Type>
Builder to be used to create a
This builder also provides methods and parameters for
NumberFormField
. This is the abstract version to be extended
in subclasses of NumberFormField. It has the following parameters:
Name | Description | Default Value or Required |
---|---|---|
key | The name of the field (used as a key in Forms ) |
Required |
defaultValue | The starting value of the field | Defaults to 0 in implementations (defaults to null here, will cause errors) |
labelType | The LabelType to use for the field |
Defaults to LabelType.LABEL |
labelForegroundPaint | The SizablePaint for the foreground of the Label |
Defaults to null (to use the Look & Feel's default Label foreground paint) |
labelBackgroundPaint | The SizablePaint for the background of the Label |
Defaults to null (to use the Look & Feel's default Label background paint) |
labelFont | The Font to use for the Label - specified as a FontFamily , style, and size |
Defaults to null (to use the Look & Feel's default Label font) |
labelShape | The ShapeInfo to use for the Label |
Defaults to null (to use the Look & Feel's default Label shape) |
labelBorder | The Border to use for the Label |
Defaults to null (to use the Look & Feel's default Label border) |
rowPos | The row position of the field | Required |
colPos | The column position of the field | Required |
rowSpan | The row span of the field | Defaults to 1 |
colSpan | The column span of the field | Defaults to 1 |
minValue | The minimum value allowed for the field | Defaults to null (no minimum) |
maxValue | The maximum value allowed for the field | Defaults to null (no maximum) |
stepSize | The increment value for the spinner for the field | Defaults to 1 in implementations (no default here) |
font resource loading
:
Field | Description | Default Value |
---|---|---|
logFontResourceLoaderWarnings | Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader | false |
logger | An EasyLogger that will be sent to the FontResourceLoader by default
- can be ignored if you specify your own FontResourceLoader |
null (since logging warnings is set to false by default) |
graphEnv | The GraphicsEnvironment to load fonts to in the FontResourceLoader
- can be ignored if you specify your own FontResourceLoader |
GraphicsEnvironment.getLocalGraphicsEnvironment() |
fontFolder | The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader | "fonts/" |
fontResourceLoader | The FontResourceLoader to use in loading fonts and/or ensuring they're in the system |
a new FontResourceLoader with the specified values for FormField.FormFieldBuilder.logFontResourceLoaderWarnings(boolean) ,
FormField.FormFieldBuilder.logger(com.github.tadukoo.util.logger.EasyLogger) , FormField.FormFieldBuilder.graphEnv(java.awt.GraphicsEnvironment) , and FormField.FormFieldBuilder.fontFolder(java.lang.String) |
- Since:
- Alpha v.0.2.1
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprotected Type
The maximum value allowed for the fieldprotected Type
The minimum value allowed for the fieldprotected Type
The increment value for the spinner for the fieldFields inherited from class com.github.tadukoo.view.form.field.FormField.FormFieldBuilder
colPos, colSpan, defaultValue, fontFolder, fontResourceLoader, graphEnv, key, labelBackgroundPaint, labelBorder, labelFontFamily, labelFontSize, labelFontStyle, labelForegroundPaint, labelShape, labelType, logFontResourceLoaderWarnings, logger, rowPos, rowSpan
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs a new NumberFormFieldBuilder (to be called in subclasses) -
Method Summary
Methods inherited from class com.github.tadukoo.view.form.field.FormField.FormFieldBuilder
colPos, colSpan, defaultValue, fontFolder, fontResourceLoader, graphEnv, key, labelBackgroundPaint, labelBorder, labelFont, labelForegroundPaint, labelShape, labelType, logFontResourceLoaderWarnings, logger, rowPos, rowSpan
-
Field Details
-
minValue
The minimum value allowed for the field -
maxValue
The maximum value allowed for the field -
stepSize
The increment value for the spinner for the field
-
-
Constructor Details
-
NumberFormFieldBuilder
protected NumberFormFieldBuilder()Constructs a new NumberFormFieldBuilder (to be called in subclasses)
-
-
Method Details
-
minValue
- Parameters:
minValue
- The minimum value allowed for the field- Returns:
- this, to continue building
-
maxValue
- Parameters:
maxValue
- The maximum value allowed for the field- Returns:
- this, to continue building
-
stepSize
- Parameters:
stepSize
- The increment value for the spinner for the field- Returns:
- this, to continue building
-
build
Builds theFormField
- Specified by:
build
in classFormField.FormFieldBuilder<Type extends Number & Comparable<?>>
- Returns:
- A newly created
FormField
-