Class ButtonFormField
java.lang.Object
com.github.tadukoo.view.form.field.FormField<String>
com.github.tadukoo.view.form.field.ButtonFormField
Button Form Field is a
FormField
that is just a button- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tadukoo.view.form.field.FormField
FormField.FormFieldBuilder<Type>
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ActionListener
The action to perform on click of the Buttonprivate final SizablePaint
TheSizablePaint
to use for the background of the Buttonprivate final Border
TheBorder
to use on the Buttonprivate final SizablePaint
TheSizablePaint
to use for disabled text on the Buttonprivate final SizablePaint
TheSizablePaint
to use for when the Button is focusedprivate final FontFamily
TheFontFamily
to use on the font of the Buttonprivate final int
The font size to use on the font of the Buttonprivate final int
The font style to use on the font of the Buttonprivate final SizablePaint
TheSizablePaint
to use for the foreground of the Buttonprivate final SizablePaint
TheSizablePaint
to use for when the Button is selectedprivate final ShapeInfo
TheShapeInfo
to use on the Button -
Constructor Summary
ModifierConstructorDescriptionprivate
ButtonFormField
(String key, String 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, ActionListener actionListener, SizablePaint buttonForegroundPaint, SizablePaint buttonBackgroundPaint, SizablePaint buttonSelectPaint, SizablePaint buttonFocusPaint, SizablePaint buttonDisabledTextPaint, FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize, Border buttonBorder, ShapeInfo buttonShape) Creates a new ButtonFormField with the given parameters -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
int
int
Creates theJComponent
to be used for this field.getValue
(JComponent component) Takes in theJComponent
for this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.Methods inherited from class com.github.tadukoo.view.form.field.FormField
getColPos, getColSpan, getDefaultValue, getFontFolder, getFontResourceLoader, getGraphEnv, getKey, getLabelBackgroundPaint, getLabelBorder, getLabelFontFamily, getLabelFontSize, getLabelFontStyle, getLabelForegroundPaint, getLabelShape, getLabelType, getLogger, getRowPos, getRowSpan, getType, logFontResourceLoaderWarnings
-
Field Details
-
actionListener
The action to perform on click of the Button -
buttonForegroundPaint
TheSizablePaint
to use for the foreground of the Button -
buttonBackgroundPaint
TheSizablePaint
to use for the background of the Button -
buttonSelectPaint
TheSizablePaint
to use for when the Button is selected -
buttonFocusPaint
TheSizablePaint
to use for when the Button is focused -
buttonDisabledTextPaint
TheSizablePaint
to use for disabled text on the Button -
buttonFontFamily
TheFontFamily
to use on the font of the Button -
buttonFontStyle
private final int buttonFontStyleThe font style to use on the font of the Button -
buttonFontSize
private final int buttonFontSizeThe font size to use on the font of the Button -
buttonBorder
TheBorder
to use on the Button -
buttonShape
TheShapeInfo
to use on the Button
-
-
Constructor Details
-
ButtonFormField
private ButtonFormField(String key, String 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, ActionListener actionListener, SizablePaint buttonForegroundPaint, SizablePaint buttonBackgroundPaint, SizablePaint buttonSelectPaint, SizablePaint buttonFocusPaint, SizablePaint buttonDisabledTextPaint, FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize, Border buttonBorder, ShapeInfo buttonShape) Creates a new ButtonFormField with the given parameters- Parameters:
key
- The name of this field (used as a key in Forms)defaultValue
- The starting value of the fieldlabelType
- TheLabelType
to use for this fieldlabelForegroundPaint
- TheSizablePaint
for the foreground of the LabellabelBackgroundPaint
- TheSizablePaint
for the background of the LabellabelFontFamily
- TheFontFamily
for the Label's fontlabelFontStyle
- The font style for the LabellabelFontSize
- The font size for the LabellabelShape
- TheShapeInfo
to use for the LabellabelBorder
- TheBorder
to 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
- AnEasyLogger
that will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoadergraphEnv
- TheGraphicsEnvironment
to 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
- TheFontResourceLoader
to use for fonts on this fieldactionListener
- The action to perform on click of the ButtonbuttonForegroundPaint
- TheSizablePaint
to use for the foreground of the ButtonbuttonBackgroundPaint
- TheSizablePaint
to use for the background of the ButtonbuttonSelectPaint
- TheSizablePaint
to use for when the Button is selectedbuttonFocusPaint
- TheSizablePaint
to use for when the Button is focusedbuttonDisabledTextPaint
- TheSizablePaint
to use for disabled text on the ButtonbuttonFontFamily
- TheFontFamily
to use on the font of the ButtonbuttonFontStyle
- The font style to use on the font of the ButtonbuttonFontSize
- The font size to use on the font of the ButtonbuttonBorder
- TheBorder
to use on the ButtonbuttonShape
- TheShapeInfo
to use on the Button
-
-
Method Details
-
builder
- Returns:
- A new
ButtonFormField.ButtonFormFieldBuilder
to use to make aButtonFormField
-
getActionListener
- Returns:
- The action to perform on click of the Button
-
getButtonForegroundPaint
- Returns:
- The
SizablePaint
to use for the foreground of the Button
-
getButtonBackgroundPaint
- Returns:
- The
SizablePaint
to use for the background of the Button
-
getButtonSelectPaint
- Returns:
- The
SizablePaint
to use for when the Button is selected
-
getButtonFocusPaint
- Returns:
- The
SizablePaint
to use for when the Button is focused
-
getButtonDisabledTextPaint
- Returns:
- The
SizablePaint
to use for disabled text on the Button
-
getButtonFontFamily
- Returns:
- The
FontFamily
to use on the font of the Button
-
getButtonFontStyle
public int getButtonFontStyle()- Returns:
- The font style to use on the font of the Button
-
getButtonFontSize
public int getButtonFontSize()- Returns:
- The font size to use on the font of the Button
-
getButtonBorder
- Returns:
- The
Border
to use on the Button
-
getButtonShape
- Returns:
- The
ShapeInfo
to use on the Button
-
getComponent
Creates theJComponent
to be used for this field.- Specified by:
getComponent
in classFormField<String>
- Returns:
- A newly created
JComponent
to use on the form - Throws:
IOException
FontFormatException
-
getValue
Takes in theJComponent
for this field and grabs the data off of it, returning it in the proper format for the field to be repopulated on the form.- Specified by:
getValue
in classFormField<String>
- Parameters:
component
- TheJComponent
associated with this field- Returns:
- The data extracted from the
JComponent
-