Class FormField<Type>
java.lang.Object
com.github.tadukoo.view.form.field.FormField<Type>
- Type Parameters:
Type- The type of value being stored in the field (used for default value)
- Direct Known Subclasses:
BooleanFormField,ButtonFormField,DateFormField,DropDownFormField,FormFormField,NumberFormField,StringFormField,TableFormField
Form Fields are fields used on
Forms.- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe column position of this fieldprivate final intThe column span of this fieldprivate final TypeThe starting value of the fieldprivate final StringThe path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate final FontResourceLoaderTheFontResourceLoaderto use for fonts on this fieldprivate final GraphicsEnvironmentTheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate final StringThe name of this field (used as a key inForms)private final SizablePaintTheSizablePaintfor the background of the Labelprivate final BorderTheBorderto use for the Labelprivate final FontFamilyTheFontFamilyfor the Label's fontprivate final intThe font size for the Labelprivate final intThe font style for the Labelprivate final SizablePaintTheSizablePaintfor the foreground of the Labelprivate final ShapeInfoTheShapeInfoto use for the Labelprivate final LabelTypeTheLabelTypeto use for this fieldprivate final booleanWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate final com.github.tadukoo.util.logger.EasyLoggerAnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoaderprivate final intThe row position of this fieldprivate final intThe row span of this fieldprivate final FieldTypeTheFieldTypeof this field -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormField(FieldType type, String key, Type defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader) Creates a new FormField with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionintintabstract JComponentCreates theJComponentto be used for this field.getKey()intintcom.github.tadukoo.util.logger.EasyLoggerintintgetType()abstract TypegetValue(JComponent component) Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.boolean
-
Field Details
-
type
TheFieldTypeof this field -
key
The name of this field (used as a key inForms) -
defaultValue
The starting value of the field -
labelType
TheLabelTypeto use for this field -
labelForegroundPaint
TheSizablePaintfor the foreground of the Label -
labelBackgroundPaint
TheSizablePaintfor the background of the Label -
labelFontFamily
TheFontFamilyfor the Label's font -
labelFontStyle
private final int labelFontStyleThe font style for the Label -
labelFontSize
private final int labelFontSizeThe font size for the Label -
labelShape
TheShapeInfoto use for the Label -
labelBorder
TheBorderto use for the Label -
rowPos
private final int rowPosThe row position of this field -
colPos
private final int colPosThe column position of this field -
rowSpan
private final int rowSpanThe row span of this field -
colSpan
private final int colSpanThe column span of this field -
logFontResourceLoaderWarnings
private final boolean logFontResourceLoaderWarningsWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
logger
private final com.github.tadukoo.util.logger.EasyLogger loggerAnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader -
graphEnv
TheGraphicsEnvironmentto 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
TheFontResourceLoaderto use for fonts on this field
-
-
Constructor Details
-
FormField
protected FormField(FieldType type, String key, Type defaultValue, LabelType labelType, SizablePaint labelForegroundPaint, SizablePaint labelBackgroundPaint, FontFamily labelFontFamily, int labelFontStyle, int labelFontSize, ShapeInfo labelShape, Border labelBorder, int rowPos, int colPos, int rowSpan, int colSpan, boolean logFontResourceLoaderWarnings, com.github.tadukoo.util.logger.EasyLogger logger, GraphicsEnvironment graphEnv, String fontFolder, FontResourceLoader fontResourceLoader) Creates a new FormField with the given parameters.- Parameters:
type- TheFieldTypeof this fieldkey- The name of this field (used as a key inForms)defaultValue- The starting value of the fieldlabelType- TheLabelTypeto use for this fieldlabelForegroundPaint- TheSizablePaintfor the foreground of the LabellabelBackgroundPaint- TheSizablePaintfor the background of the LabellabelFontFamily- TheFontFamilyfor the Label's fontlabelFontStyle- The font style for the LabellabelFontSize- The font size for the LabellabelShape- TheShapeInfoto use for the LabellabelBorder- TheBorderto use for the LabelrowPos- The row position of this fieldcolPos- The column position of this fieldrowSpan- The row span of this fieldcolSpan- The column span of this fieldlogFontResourceLoaderWarnings- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderlogger- AnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoadergraphEnv- TheGraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontFolder- The path to the fonts folder to find font files in if needed in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderfontResourceLoader- TheFontResourceLoaderto use for fonts on this field
-
-
Method Details
-
getType
- Returns:
- The
FieldTypeof this field
-
getKey
- Returns:
- The name of this field (used as a key in
Forms)
-
getDefaultValue
- Returns:
- The starting value of this field
-
getLabelType
- Returns:
- The
LabelTypeto use for this field
-
getLabelForegroundPaint
- Returns:
- The
SizablePaintfor the foreground of the Label
-
getLabelBackgroundPaint
- Returns:
- The
SizablePaintfor the background of the Label
-
getLabelFontFamily
- Returns:
- The
FontFamilyfor the Label's font
-
getLabelFontStyle
public int getLabelFontStyle()- Returns:
- The font style for the Label
-
getLabelFontSize
public int getLabelFontSize()- Returns:
- The font size for the Label
-
getLabelShape
- Returns:
- The
ShapeInfoto use for the Label
-
getLabelBorder
- Returns:
- The
Borderto use for the Label
-
getRowPos
public int getRowPos()- Returns:
- The row position of this field
-
getColPos
public int getColPos()- Returns:
- The column position of this field
-
getRowSpan
public int getRowSpan()- Returns:
- The row span of this field
-
getColSpan
public int getColSpan()- Returns:
- The column span of this field
-
logFontResourceLoaderWarnings
public boolean logFontResourceLoaderWarnings()- Returns:
- Whether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader
-
getLogger
public com.github.tadukoo.util.logger.EasyLogger getLogger()- Returns:
- An
EasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoader
-
getGraphEnv
- Returns:
- The
GraphicsEnvironmentto load a font to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoader
-
getFontFolder
- Returns:
- 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
-
getFontResourceLoader
- Returns:
- The
FontResourceLoaderto use for fonts on this field
-
getComponent
Creates theJComponentto be used for this field.- Returns:
- A newly created
JComponentto use on the form - Throws:
Throwable- If anything goes wrong setting up the Component
-
getValue
Takes in theJComponentfor this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.- Parameters:
component- TheJComponentassociated with this field- Returns:
- The data extracted from the
JComponent
-