Class FormField.FormFieldBuilder<Type>
java.lang.Object
com.github.tadukoo.view.form.field.FormField.FormFieldBuilder<Type>
- Type Parameters:
Type
- The type of value being stored in the field (used for default value)
- Direct Known Subclasses:
BooleanFormField.BooleanFormFieldBuilder
,ButtonFormField.ButtonFormFieldBuilder
,DateFormField.DateFormFieldBuilder
,DropDownFormField.DropDownFormFieldBuilder
,FormFormField.FormFormFieldBuilder
,NumberFormField.NumberFormFieldBuilder
,StringFormField.StringFormFieldBuilder
,TableFormField.TableFormFieldBuilder
Builder to be used to create a
This builder also provides methods and parameters for
FormField
. This is the abstract version to be extended
in subclasses of FormField. 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 null |
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 |
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 logFontResourceLoaderWarnings ,
logger , graphEnv , and fontFolder |
- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
The column position of the fieldprotected int
The column span of the fieldprotected Type
The starting value of the fieldprotected String
The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprotected FontResourceLoader
TheFontResourceLoader
to use in loading a font and/or ensuring they're in the systemprotected GraphicsEnvironment
TheGraphicsEnvironment
to load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprotected String
The name of the field (used as a key inForms
)protected SizablePaint
TheSizablePaint
for the background of the Labelprotected Border
TheBorder
to use for the Labelprotected FontFamily
TheFontFamily
for the Label's fontprotected int
The font size for the Labelprotected int
The font style for the Labelprotected SizablePaint
TheSizablePaint
for the foreground of the Labelprotected ShapeInfo
TheShapeInfo
to use for the Labelprotected LabelType
TheLabelType
to use for the fieldprotected boolean
Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprotected com.github.tadukoo.util.logger.EasyLogger
AnEasyLogger
that will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoaderprotected int
The row position of the fieldprotected int
The row span of the field -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs a new FormFieldBuilder (to be called in subclasses) -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds theFormField
colPos
(int colPos) colSpan
(int colSpan) defaultValue
(Type defaultValue) fontFolder
(String fontFolder) fontResourceLoader
(FontResourceLoader fontResourceLoader) graphEnv
(GraphicsEnvironment graphEnv) labelBackgroundPaint
(SizablePaint labelBackgroundPaint) labelBorder
(Border labelBorder) labelFont
(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use on the LabellabelForegroundPaint
(SizablePaint labelForegroundPaint) labelShape
(ShapeInfo labelShape) logFontResourceLoaderWarnings
(boolean logFontResourceLoaderWarnings) logger
(com.github.tadukoo.util.logger.EasyLogger logger) rowPos
(int rowPos) rowSpan
(int rowSpan)
-
Field Details
-
key
The name of the field (used as a key inForms
) -
defaultValue
The starting value of the field -
labelType
TheLabelType
to use for the field -
labelForegroundPaint
TheSizablePaint
for the foreground of the Label -
labelBackgroundPaint
TheSizablePaint
for the background of the Label -
labelFontFamily
TheFontFamily
for the Label's font -
labelFontStyle
protected int labelFontStyleThe font style for the Label -
labelFontSize
protected int labelFontSizeThe font size for the Label -
labelShape
TheShapeInfo
to use for the Label -
labelBorder
TheBorder
to use for the Label -
rowPos
protected int rowPosThe row position of the field -
colPos
protected int colPosThe column position of the field -
rowSpan
protected int rowSpanThe row span of the field -
colSpan
protected int colSpanThe column span of the field -
logFontResourceLoaderWarnings
protected boolean logFontResourceLoaderWarningsWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
logger
protected com.github.tadukoo.util.logger.EasyLogger loggerAnEasyLogger
that will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader -
graphEnv
TheGraphicsEnvironment
to load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
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 -
fontResourceLoader
TheFontResourceLoader
to use in loading a font and/or ensuring they're in the system
-
-
Constructor Details
-
FormFieldBuilder
protected FormFieldBuilder()Constructs a new FormFieldBuilder (to be called in subclasses)
-
-
Method Details
-
key
- Parameters:
key
- The name of the field (used as a key inForms
)- Returns:
- this, to continue building
-
defaultValue
- Parameters:
defaultValue
- The starting value of the field- Returns:
- this, to continue building
-
labelType
- Parameters:
labelType
- TheLabelType
to use for the field- Returns:
- this, to continue building
-
labelForegroundPaint
- Parameters:
labelForegroundPaint
- TheSizablePaint
for the foreground of the Label- Returns:
- this, to continue building
-
labelBackgroundPaint
- Parameters:
labelBackgroundPaint
- TheSizablePaint
for the background of the Label- Returns:
- this, to continue building
-
labelFont
public FormField.FormFieldBuilder<Type> labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use on the Label- Parameters:
labelFontFamily
- TheFontFamily
for the Label's fontlabelFontStyle
- The font style for the LabellabelFontSize
- The font size for the Label- Returns:
- this, to continue building
-
labelShape
- Parameters:
labelShape
- TheShapeInfo
to use for the Label- Returns:
- this, to continue building
-
labelBorder
- Parameters:
labelBorder
- TheBorder
to use for the Label- Returns:
- this, to continue building
-
rowPos
- Parameters:
rowPos
- The row position of the field- Returns:
- this, to continue building
-
colPos
- Parameters:
colPos
- The column position of the field- Returns:
- this, to continue building
-
rowSpan
- Parameters:
rowSpan
- The row span of the field- Returns:
- this, to continue building
-
colSpan
- Parameters:
colSpan
- The column span of the field- Returns:
- this, to continue building
-
logFontResourceLoaderWarnings
public FormField.FormFieldBuilder<Type> logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) - Parameters:
logFontResourceLoaderWarnings
- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
logger
- Parameters:
logger
- AnEasyLogger
that will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
graphEnv
- Parameters:
graphEnv
- TheGraphicsEnvironment
to load fonts to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader- Returns:
- this, to continue building
-
fontFolder
- Parameters:
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- Returns:
- this, to continue building
-
fontResourceLoader
- Parameters:
fontResourceLoader
- TheFontResourceLoader
to use in loading fonts and/or ensuring they're in the system- Returns:
- this, to continue building
-
build
Builds theFormField
-