Class TadukooTheme.TadukooThemeBuilder
java.lang.Object
com.github.tadukoo.view.lookandfeel.TadukooTheme.TadukooThemeBuilder
- Enclosing class:
- TadukooTheme
Builder for
TadukooTheme. There are no required fields - all of them will be
defaulted based on the default Tadukoo Theme. The following fields may be specified:
| Field | Description | Default Value |
|---|---|---|
| buttonUI | The ButtonUI class to use |
TadukooButtonUI.class |
| labelUI | The LabelUI class to use |
TadukooLabelUI.class |
| Field | Description | Default Value |
|---|---|---|
| defaultForegroundPaint | The PaintUIResource to use for all unspecified foreground paints |
new ColorPaintUIResource(Color.BLACK) |
| buttonForegroundPaint | The PaintUIResource to use for the foreground on Buttons |
null (defaults to the defaultForegroundPaint value) |
| labelForegroundPaint | The PaintUIResource to use for the foreground on Labels |
null (defaults to the defaultForegroundPaint value) |
| defaultBackgroundPaint | The PaintUIResource to use for all unspecified background paints |
new ColorPaintUIResource(Color.WHITE) |
| buttonBackgroundPaint | The PaintUIResource to use for the background on Buttons |
null (defaults to the defaultBackgroundPaint value) |
| labelBackgroundPaint | The PaintUIResource to use for the background on Labels |
new NoPaintUIResource (can set to null to use the defaultBackgroundPaint value
if you want to) |
| defaultFocusPaint | The PaintUIResource to use for all unspecified focus paints |
new ColorPaintUIResource(Color.YELLOW) |
| buttonFocusPaint | The PaintUIResource to use for focus on Buttons |
null (defaults to the defaultFocusPaint value) |
| defaultSelectPaint | The PaintUIResource to use for all unspecified select paints |
new ColorPaintUIResource(Color.RED) |
| buttonSelectPaint | The PaintUIResource to use for select on Buttons |
null (defaults to the defaultSelectPaint value) |
| defaultDisabledTextPaint | The PaintUIResource to use for all unspecified disabled text paints |
new ColorPaintUIResource(Color.GRAY) |
| buttonDisabledTextPaint | The PaintUIResource to use for disabled text on Buttons |
null (defaults to the defaultDisabledTextPaint value) |
| defaultDisabledForegroundPaint | The PaintUIResource to use for all unspecified disabled foreground paints |
new ColorPaintUIResource(Color.GRAY) |
| labelDisabledForegroundPaint | The PaintUIResource to use for disabled foreground on Labels |
null (defaults to the defaultDisabledForegroundPaint value) |
| Field | Description | Default Value |
|---|---|---|
| defaultFont | The font to use for unspecified font | FontFamilies.CALIBRI, style Font.PLAIN, and size 12 |
| buttonFont | The font to use for Buttons | null (defaults to the defaultFont value) |
| labelFont | The font to use for Labels | null (defaults to the defaultFont value) |
| 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 |
| Field | Description | Default Value |
|---|---|---|
| defaultShapeInfo | The ShapeInfoUIResource to use for all unspecified shapes |
Shapes.RECTANGLE_WITH_CUT_CORNERS_TR_BL |
| buttonShapeInfo | The ShapeInfoUIResource to use for Buttons |
null (defaults to the defaultShapeInfo value) |
| labelShapeInfo | The ShapeInfoUIResource to use for Labels |
null (defaults to the defaultShapeInfo value) |
| Field | Description | Default Value |
|---|---|---|
| defaultBorder | The BorderUIResource to use for all unspecified borders |
new TadukooBorder() |
| buttonBorder | The BorderUIResource to use on Buttons |
null (defaults to the defaultBorder value) |
| labelBorder | The BorderUIResource to use on Labels |
new NoBorderUIResource() (can be changed to null to use the defaultBorder value) |
| Field | Description | Default Value |
|---|---|---|
| titledBorderBorder | The default border to use in Titled Borders | null (defaults to the defaultBorder value) |
| titledBorderFont | The default font to use in Titled Borders | null (defaults to the defaultFont value) |
| titledBorderColor | The default color to use in Titled Borders | Color.BLACK |
| titledBorderPosition | The default position for the title in Titled Borders | TitlePosition.TOP |
| Field | Description | Default Value |
|---|---|---|
| classDefaults | Class defaults beyond those specified in the "Component UI Classes" section | Empty list |
| systemColorDefaults | System Color defaults | Empty list |
| componentDefaults | Component defaults beyond those specified in the above sections | Empty list |
- Since:
- Alpha v.0.2
- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PaintUIResourceThePaintUIResourceto use for the background on Buttonsprivate BorderUIResourceTheBorderUIResourceto use on Buttonsprivate PaintUIResourceThePaintUIResourceto use for disabled text on Buttonsprivate PaintUIResourceThePaintUIResourceto use for focus on Buttonsprivate FontFamilyTheFontFamilyto use for Buttonsprivate intThe font size to use for Buttonsprivate intThe Font style to use for Buttonsprivate PaintUIResourceThePaintUIResourceto use for the foreground on Buttonsprivate PaintUIResourceThePaintUIResourceto use for select on Buttonsprivate ShapeInfoUIResourceTheShapeInfoUIResourceto use for ButtonsTheButtonUIclass to useClass defaults beyond those specified in the "Component UI Classes" sectionComponent defaults beyond those specified in the above sectionsprivate PaintUIResourceThePaintUIResourceto use for all unspecified background paintsprivate BorderUIResourceTheBorderUIResourceto use for all unspecified bordersprivate PaintUIResourceThePaintUIResourceto use for all unspecified disabled foreground paintsprivate PaintUIResourceThePaintUIResourceto use for all unspecified disabled text paintsprivate PaintUIResourceThePaintUIResourceto use for all unspecified focus paintsprivate FontFamilyTheFontFamilyto use for unspecified fontsprivate intThe font size to use for unspecified fontsprivate intThe font style to use for unspecified fontsprivate PaintUIResourceThePaintUIResourceto use for all unspecified foreground paintsprivate PaintUIResourceThePaintUIResourceto use for all unspecified select paintsprivate ShapeInfoUIResourceTheShapeInfoUIResourceto use for unspecified shapesprivate 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 FontResourceLoaderTheFontResourceLoaderto use in loading fonts and/or ensuring they're in the systemprivate GraphicsEnvironmentTheGraphicsEnvironmentto load fonts to in the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate PaintUIResourceThePaintUIResourceto use for the background on Labelsprivate BorderUIResourceTheBorderUIResourceto use on Labelsprivate PaintUIResourceThePaintUIResourceto use for disabled foreground on Labelsprivate FontFamilyTheFontFamilyto use for Labelsprivate intThe font size to use for Labelsprivate intThe Font style to use for Labelsprivate PaintUIResourceThePaintUIResourceto use for the foreground on Labelsprivate ShapeInfoUIResourceTheShapeInfoUIResourceto use for LabelsTheLabelUIclass to useprivate booleanWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoaderprivate com.github.tadukoo.util.logger.EasyLoggerAnEasyLoggerthat will be sent to the FontResourceLoader by default - can be ignored if you specify your own FontResourceLoaderprivate Map<String,ColorUIResource> System Color defaultsprivate BorderUIResourceThe defaultBorderUIResourceto use in Titled Bordersprivate ColorUIResourceThe default color to use in Titled Bordersprivate FontFamilyThe defaultFontFamilyto use in Titled Bordersprivate intThe default font size to use in Titled Bordersprivate intThe default font style to use in Titled Bordersprivate TitlePositionThe default position for the title in Titled Borders -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCannot create TadukooThemeBuilder outside of TadukooTheme -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aTadukooThemeusing the given customizations (or default customizations for unspecified parameters).buttonBackgroundPaint(PaintUIResource buttonBackgroundPaint) buttonBorder(BorderUIResource buttonBorder) buttonDisabledTextPaint(PaintUIResource buttonDisabledTextPaint) buttonFocusPaint(PaintUIResource buttonFocusPaint) buttonFont(FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize) Specifies the font to use for ButtonsbuttonForegroundPaint(PaintUIResource buttonForegroundPaint) buttonSelectPaint(PaintUIResource buttonSelectPaint) buttonShapeInfo(ShapeInfoUIResource buttonShapeInfo) voidChecks for any errors in the parameters that were setclassDefault(String key, Class<?> clazz) Adds a class default beyond those specified in the "Component UI Classes" section - this adds to the map instead of overwriting itclassDefaults(Map<String, Class<?>> classDefaults) componentDefault(String key, Object value) Adds a component default beyond those specified in the above sections - this adds to the map instead of overwriting itcomponentDefaults(Map<String, Object> componentDefaults) defaultBackgroundPaint(PaintUIResource defaultBackgroundPaint) defaultBorder(BorderUIResource defaultBorder) defaultDisabledForegroundPaint(PaintUIResource defaultDisabledForegroundPaint) defaultDisabledTextPaint(PaintUIResource defaultDisabledTextPaint) defaultFocusPaint(PaintUIResource defaultFocusPaint) defaultFont(FontFamily defaultFontFamily, int defaultFontStyle, int defaultFontSize) Specifies the font to use for unspecified fontsdefaultForegroundPaint(PaintUIResource defaultForegroundPaint) defaultSelectPaint(PaintUIResource defaultSelectPaint) defaultShapeInfo(ShapeInfoUIResource defaultShapeInfo) fontFolder(String fontFolder) fontResourceLoader(FontResourceLoader fontResourceLoader) graphEnv(GraphicsEnvironment graphEnv) labelBackgroundPaint(PaintUIResource labelBackgroundPaint) labelBorder(BorderUIResource labelBorder) labelDisabledForegroundPaint(PaintUIResource labelDisabledForegroundPaint) labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use for LabelslabelForegroundPaint(PaintUIResource labelForegroundPaint) labelShapeInfo(ShapeInfoUIResource labelShapeInfo) logFontResourceLoaderWarnings(boolean logFontResourceLoaderWarnings) logger(com.github.tadukoo.util.logger.EasyLogger logger) systemColorDefault(String key, ColorUIResource color) Adds a system color default - this adds to the map instead of overwriting itsystemColorDefaults(Map<String, ColorUIResource> systemColorDefaults) titledBorderBorder(BorderUIResource titledBorderBorder) titledBorderColor(ColorUIResource titledBorderColor) titledBorderFont(FontFamily titledBorderFontFamily, int titledBorderFontStyle, int titledBorderFontSize) Specifies the default font to use for Titled BorderstitledBorderPosition(TitlePosition titledBorderPosition)
-
Field Details
-
buttonUI
TheButtonUIclass to use -
labelUI
TheLabelUIclass to use -
defaultForegroundPaint
ThePaintUIResourceto use for all unspecified foreground paints -
buttonForegroundPaint
ThePaintUIResourceto use for the foreground on Buttons -
labelForegroundPaint
ThePaintUIResourceto use for the foreground on Labels -
defaultBackgroundPaint
ThePaintUIResourceto use for all unspecified background paints -
buttonBackgroundPaint
ThePaintUIResourceto use for the background on Buttons -
labelBackgroundPaint
ThePaintUIResourceto use for the background on Labels -
defaultFocusPaint
ThePaintUIResourceto use for all unspecified focus paints -
buttonFocusPaint
ThePaintUIResourceto use for focus on Buttons -
defaultSelectPaint
ThePaintUIResourceto use for all unspecified select paints -
buttonSelectPaint
ThePaintUIResourceto use for select on Buttons -
defaultDisabledTextPaint
ThePaintUIResourceto use for all unspecified disabled text paints -
buttonDisabledTextPaint
ThePaintUIResourceto use for disabled text on Buttons -
defaultDisabledForegroundPaint
ThePaintUIResourceto use for all unspecified disabled foreground paints -
labelDisabledForegroundPaint
ThePaintUIResourceto use for disabled foreground on Labels -
defaultFontFamily
TheFontFamilyto use for unspecified fonts -
defaultFontStyle
private int defaultFontStyleThe font style to use for unspecified fonts -
defaultFontSize
private int defaultFontSizeThe font size to use for unspecified fonts -
buttonFontFamily
TheFontFamilyto use for Buttons -
buttonFontStyle
private int buttonFontStyleThe Font style to use for Buttons -
buttonFontSize
private int buttonFontSizeThe font size to use for Buttons -
labelFontFamily
TheFontFamilyto use for Labels -
labelFontStyle
private int labelFontStyleThe Font style to use for Labels -
labelFontSize
private int labelFontSizeThe font size to use for Labels -
logFontResourceLoaderWarnings
private boolean logFontResourceLoaderWarningsWhether to log warnings generated by the FontResourceLoader - can be ignored if you specify your own FontResourceLoader -
logger
private 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 fonts 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 in loading fonts and/or ensuring they're in the system -
defaultShapeInfo
TheShapeInfoUIResourceto use for unspecified shapes -
buttonShapeInfo
TheShapeInfoUIResourceto use for Buttons -
labelShapeInfo
TheShapeInfoUIResourceto use for Labels -
defaultBorder
TheBorderUIResourceto use for all unspecified borders -
buttonBorder
TheBorderUIResourceto use on Buttons -
labelBorder
TheBorderUIResourceto use on Labels -
titledBorderBorder
The defaultBorderUIResourceto use in Titled Borders -
titledBorderFontFamily
The defaultFontFamilyto use in Titled Borders -
titledBorderFontStyle
private int titledBorderFontStyleThe default font style to use in Titled Borders -
titledBorderFontSize
private int titledBorderFontSizeThe default font size to use in Titled Borders -
titledBorderColor
The default color to use in Titled Borders -
titledBorderPosition
The default position for the title in Titled Borders -
classDefaults
Class defaults beyond those specified in the "Component UI Classes" section -
systemColorDefaults
System Color defaults -
componentDefaults
Component defaults beyond those specified in the above sections
-
-
Constructor Details
-
TadukooThemeBuilder
private TadukooThemeBuilder()Cannot create TadukooThemeBuilder outside of TadukooTheme
-
-
Method Details
-
buttonUI
- Parameters:
buttonUI- TheButtonUIclass to use- Returns:
- this, to continue building
-
labelUI
- Parameters:
labelUI- TheLabelUIclass to use- Returns:
- this, to continue building
-
defaultForegroundPaint
public TadukooTheme.TadukooThemeBuilder defaultForegroundPaint(PaintUIResource defaultForegroundPaint) - Parameters:
defaultForegroundPaint- ThePaintUIResourceto use for all unspecified foreground paints- Returns:
- this, to continue building
-
buttonForegroundPaint
public TadukooTheme.TadukooThemeBuilder buttonForegroundPaint(PaintUIResource buttonForegroundPaint) - Parameters:
buttonForegroundPaint- ThePaintUIResourceto use for the foreground on Buttons- Returns:
- this, to continue building
-
labelForegroundPaint
- Parameters:
labelForegroundPaint- ThePaintUIResourceto use for the foreground on Labels- Returns:
- this, to continue building
-
defaultBackgroundPaint
public TadukooTheme.TadukooThemeBuilder defaultBackgroundPaint(PaintUIResource defaultBackgroundPaint) - Parameters:
defaultBackgroundPaint- ThePaintUIResourceto use for all unspecified background paints- Returns:
- this, to continue building
-
buttonBackgroundPaint
public TadukooTheme.TadukooThemeBuilder buttonBackgroundPaint(PaintUIResource buttonBackgroundPaint) - Parameters:
buttonBackgroundPaint- ThePaintUIResourceto use for the background on Buttons- Returns:
- this, to continue building
-
labelBackgroundPaint
- Parameters:
labelBackgroundPaint- ThePaintUIResourceto use for the background on Labels- Returns:
- this, to continue building
-
defaultFocusPaint
- Parameters:
defaultFocusPaint- ThePaintUIResourceto use for all unspecified focus paints- Returns:
- this, to continue building
-
buttonFocusPaint
- Parameters:
buttonFocusPaint- ThePaintUIResourceto use for focus on Buttons- Returns:
- this, to continue building
-
defaultSelectPaint
- Parameters:
defaultSelectPaint- ThePaintUIResourceto use for all unspecified select paints- Returns:
- this, to continue building
-
buttonSelectPaint
- Parameters:
buttonSelectPaint- ThePaintUIResourceto use for select on Buttons- Returns:
- this, to continue building
-
defaultDisabledTextPaint
public TadukooTheme.TadukooThemeBuilder defaultDisabledTextPaint(PaintUIResource defaultDisabledTextPaint) - Parameters:
defaultDisabledTextPaint- ThePaintUIResourceto use for all unspecified disabled text paints- Returns:
- this, to continue building
-
buttonDisabledTextPaint
public TadukooTheme.TadukooThemeBuilder buttonDisabledTextPaint(PaintUIResource buttonDisabledTextPaint) - Parameters:
buttonDisabledTextPaint- ThePaintUIResourceto use for disabled text on Buttons- Returns:
- this, to continue building
-
defaultDisabledForegroundPaint
public TadukooTheme.TadukooThemeBuilder defaultDisabledForegroundPaint(PaintUIResource defaultDisabledForegroundPaint) - Parameters:
defaultDisabledForegroundPaint- ThePaintUIResourceto use for all unspecified disabled foreground paints- Returns:
- this, to continue building
-
labelDisabledForegroundPaint
public TadukooTheme.TadukooThemeBuilder labelDisabledForegroundPaint(PaintUIResource labelDisabledForegroundPaint) - Parameters:
labelDisabledForegroundPaint- ThePaintUIResourceto use for disabled foreground on Labels- Returns:
- this, to continue building
-
defaultFont
public TadukooTheme.TadukooThemeBuilder defaultFont(FontFamily defaultFontFamily, int defaultFontStyle, int defaultFontSize) Specifies the font to use for unspecified fonts- Parameters:
defaultFontFamily- TheFontFamilyto usedefaultFontStyle- The font style to usedefaultFontSize- The font size to use- Returns:
- this, to continue building
-
buttonFont
public TadukooTheme.TadukooThemeBuilder buttonFont(FontFamily buttonFontFamily, int buttonFontStyle, int buttonFontSize) Specifies the font to use for Buttons- Parameters:
buttonFontFamily- TheFontFamilyto usebuttonFontStyle- The font style to usebuttonFontSize- The font size to use- Returns:
- this, to continue building
-
labelFont
public TadukooTheme.TadukooThemeBuilder labelFont(FontFamily labelFontFamily, int labelFontStyle, int labelFontSize) Specifies the font to use for Labels- Parameters:
labelFontFamily- TheFontFamilyto uselabelFontStyle- The font style to uselabelFontSize- the font size to use- Returns:
- this, to continue building
-
logFontResourceLoaderWarnings
public TadukooTheme.TadukooThemeBuilder 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- AnEasyLoggerthat 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- TheGraphicsEnvironmentto 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- TheFontResourceLoaderto use in loading fonts and/or ensuring they're in the system- Returns:
- this, to continue building
-
defaultShapeInfo
- Parameters:
defaultShapeInfo- TheShapeInfoUIResourceto use for unspecified shapes- Returns:
- this, to continue building
-
buttonShapeInfo
- Parameters:
buttonShapeInfo- TheShapeInfoUIResourceto use for Buttons- Returns:
- this, to continue building
-
labelShapeInfo
- Parameters:
labelShapeInfo- TheShapeInfoUIResourceto use for Labels- Returns:
- this, to continue building
-
defaultBorder
- Parameters:
defaultBorder- TheBorderto use for all unspecified borders- Returns:
- this, to continue building
-
buttonBorder
- Parameters:
buttonBorder- TheBorderto use on Buttons- Returns:
- this, to continue building
-
labelBorder
- Parameters:
labelBorder- TheBorderUIResourceto use on Labels- Returns:
- this, to continue building
-
titledBorderBorder
- Parameters:
titledBorderBorder- The defaultBorderUIResourceto use in Titled Borders- Returns:
- this, to continue building
-
titledBorderFont
public TadukooTheme.TadukooThemeBuilder titledBorderFont(FontFamily titledBorderFontFamily, int titledBorderFontStyle, int titledBorderFontSize) Specifies the default font to use for Titled Borders- Parameters:
titledBorderFontFamily- TheFontFamilyto usetitledBorderFontStyle- The font style to usetitledBorderFontSize- The font size to use- Returns:
- this, to continue building
-
titledBorderColor
- Parameters:
titledBorderColor- The default color to use in Titled Borders- Returns:
- this, to continue building
-
titledBorderPosition
- Parameters:
titledBorderPosition- The default position for the title in Titled Borders- Returns:
- this, to continue building
-
classDefaults
- Parameters:
classDefaults- Class defaults beyond those specified in the "Component UI Classes" section - this overwrites the map- Returns:
- this, to continue building
-
classDefault
Adds a class default beyond those specified in the "Component UI Classes" section - this adds to the map instead of overwriting it- Parameters:
key- The key for the class defaultclazz- The actual Class for the class default- Returns:
- this, to continue building
-
systemColorDefaults
public TadukooTheme.TadukooThemeBuilder systemColorDefaults(Map<String, ColorUIResource> systemColorDefaults) - Parameters:
systemColorDefaults- System Color defaults- Returns:
- this, to continue building
-
systemColorDefault
Adds a system color default - this adds to the map instead of overwriting it- Parameters:
key- The key for the system color defaultcolor- The actual color for the system color default- Returns:
- this, to continue building
-
componentDefaults
- Parameters:
componentDefaults- Component defaults beyond those specified in the above sections- Returns:
- this, to continue building
-
componentDefault
Adds a component default beyond those specified in the above sections - this adds to the map instead of overwriting it- Parameters:
key- The key for the component defaultvalue- The actual value for the component default- Returns:
- this, to continue building
-
checkForErrors
public void checkForErrors()Checks for any errors in the parameters that were set -
build
Builds aTadukooThemeusing the given customizations (or default customizations for unspecified parameters).- Returns:
- A new
TadukooTheme - Throws:
IOException- If something goes wrong in loading fontsFontFormatException- If something goes wrong in loading fonts
-