Interface TComponentUIUtil
- All Known Implementing Classes:
TadukooButtonUI
,TadukooLabelUI
public interface TComponentUIUtil
This interface provides utilities for
TComponent
s - this interface is to be implemented in
Component UI classes for them to utilize the methods present to help in accessing customizations
from the TadukooTheme
and/or the components themselves and installing and uninstalling said
customizations. It also contains some common paint methods.- Version:
- Alpha v.0.3
- Author:
- Logan Ferree (Tadukoo)
-
Method Summary
Modifier and TypeMethodDescriptiondefault SizablePaint
default Paint
getBackgroundPaint
(Component c, Dimension size) default SizablePaint
default Paint
getDisabledForegroundPaint
(Component c, Dimension size) default SizablePaint
default Paint
getDisabledTextPaint
(Component c, Dimension size) default SizablePaint
default Paint
getFocusPaint
(Component c, Dimension size) default SizablePaint
default Paint
getForegroundPaint
(Component c, Dimension size) Retrieves the Property Prefix string present on the Component UI class.default SizablePaint
default Paint
getSelectPaint
(Component c, Dimension size) default ShapeInfo
getShape()
default ShapeInfo
default void
Installs disabledForeground paint on the given Componentdefault void
Checks if the givenComponent
has theHasDisabledForegroundPaint
interface and will install the disabledForeground paint if the interface is present.default void
Installs disabledText paint on the given Componentdefault void
Checks if the givenComponent
has theHasDisabledTextPaint
interface and will install the disabledText paint if the interface is present.default void
Installs focus and select paint on the given Componentdefault void
Checks if the givenComponent
has theHasSelectAndFocusPaints
interface and will install the select and focus paints if the interface is present.default void
Installs foreground and background paint on the given Componentdefault void
Installs shape info on the given Componentdefault void
Installs the customizations associated withTComponent
on the givenComponent
, which are the foreground and background paints and the shape info.default void
Checks if the givenComponent
has any of the custom interfaces present inTComponent
and will install any customizations on it if it has those interfaces.default void
paintBackground
(Graphics g, Component c) default void
Uninstalls disabledForeground paint from the given Componentdefault void
Checks if the givenComponent
has theHasDisabledForegroundPaint
interface and will uninstall the disabledForeground paint if the interface is present.default void
Uninstalls disabledText paint from the given Componentdefault void
Checks if the givenComponent
has theHasDisabledTextPaint
interface and will uninstall the disabledText paint if the interface is present.default void
Uninstalls select and focus paint from the given Componentdefault void
Checks if the givenComponent
has theHasSelectAndFocusPaints
interface and will uninstall the select and focus paints if the interface is present.default void
Uninstalls foreground and background paint from the given Componentdefault void
Uninstalls shape info from the given Componentdefault void
Uninstalls the customizations associated withTComponent
from the givenComponent
, which are the foreground and background paints and the shape info.default void
Checks if the givenComponent
has any of the custom interfaces present inTComponent
and will uninstall any customizations from it if it has those interfaces.
-
Method Details
-
getPropertyPrefixString
String getPropertyPrefixString()Retrieves the Property Prefix string present on the Component UI class.
This method is necessary due to the normal propertyPrefix method being default, so it's not available here in this interface.- Returns:
- The property prefix string for this Component UI
-
getForegroundPaint
- Returns:
- The
SizablePaint
to be used for the foreground from the Look & Feel
-
getForegroundPaint
- Parameters:
c
- AComponent
which may have the foreground paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the foreground - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
getBackgroundPaint
- Returns:
- The
SizablePaint
to be used for the background from the Look & Feel
-
getBackgroundPaint
- Parameters:
c
- AComponent
which may have the background paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the background - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
getShape
- Returns:
- The
ShapeInfo
to be used from the Look & Feel
-
getShape
-
getSelectPaint
- Returns:
- The
SizablePaint
to be used for when the Component is selected from the Look & Feel
-
getSelectPaint
- Parameters:
c
- AComponent
which may have the select paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the select - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
getFocusPaint
- Returns:
- The
SizablePaint
to be used for when the Component is focused from the Look & Feel
-
getFocusPaint
- Parameters:
c
- AComponent
which may have the focus paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the focus - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
getDisabledTextPaint
- Returns:
- The
SizablePaint
to be used for disabled text on the Component from the Look & Feel
-
getDisabledTextPaint
- Parameters:
c
- AComponent
which may have the disabled text paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the disabled text - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
getDisabledForegroundPaint
- Returns:
- The
SizablePaint
to be used for disabled foreground on the Component from the Look & Feel
-
getDisabledForegroundPaint
- Parameters:
c
- AComponent
which may have the disabled foreground paint on itsize
- TheDimension
s of the surface to be painted- Returns:
- The sized
Paint
for the disabled foreground - theSizablePaint
used may come from theComponent
if it has it, or default to the Look & Feel's paint
-
installHasSizablePaints
Installs foreground and background paint on the given Component- Parameters:
c
- TheComponent
thatHasSizablePaints
and is to have paints installed
-
installShaped
Installs shape info on the given Component -
installTComponent
Installs the customizations associated withTComponent
on the givenComponent
, which are the foreground and background paints and the shape info.- Parameters:
c
- TheTComponent
that is to have customizations installed
-
installTComponentDefaults
Checks if the givenComponent
has any of the custom interfaces present inTComponent
and will install any customizations on it if it has those interfaces.- Parameters:
c
- TheComponent
that is to have customizations installed
-
installHasSelectAndFocusPaints
Installs focus and select paint on the given Component- Parameters:
c
- TheComponent
thatHasSelectAndFocusPaints
and is to have paints installed
-
installHasSelectAndFocusPaintsDefaults
Checks if the givenComponent
has theHasSelectAndFocusPaints
interface and will install the select and focus paints if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations installed
-
installHasDisabledTextPaint
Installs disabledText paint on the given Component- Parameters:
c
- TheComponent
thatHasDisabledTextPaint
and is to have the paint installed
-
installHasDisabledTextPaintDefaults
Checks if the givenComponent
has theHasDisabledTextPaint
interface and will install the disabledText paint if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations installed
-
installHasDisabledForegroundPaint
Installs disabledForeground paint on the given Component- Parameters:
c
- TheComponent
thatHasDisabledForegroundPaint
and is to have the paint installed
-
installHasDisabledForegroundPaintDefaults
Checks if the givenComponent
has theHasDisabledForegroundPaint
interface and will install the disabledForeground paint if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations installed
-
uninstallHasSizablePaints
Uninstalls foreground and background paint from the given Component- Parameters:
c
- TheComponent
thatHasSizablePaints
and is to have paints uninstalled
-
uninstallShaped
Uninstalls shape info from the given Component -
uninstallTComponent
Uninstalls the customizations associated withTComponent
from the givenComponent
, which are the foreground and background paints and the shape info.- Parameters:
c
- TheTComponent
that is to have customizations uninstalled
-
uninstallTComponentDefaults
Checks if the givenComponent
has any of the custom interfaces present inTComponent
and will uninstall any customizations from it if it has those interfaces.- Parameters:
c
- TheComponent
that is to have customizations uninstalled
-
uninstallHasSelectAndFocusPaints
Uninstalls select and focus paint from the given Component- Parameters:
c
- TheComponent
thatHasSelectAndFocusPaints
and is to have paints uninstalled
-
uninstallHasSelectAndFocusPaintsDefaults
Checks if the givenComponent
has theHasSelectAndFocusPaints
interface and will uninstall the select and focus paints if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations uninstalled
-
uninstallHasDisabledTextPaint
Uninstalls disabledText paint from the given Component- Parameters:
c
- TheComponent
thatHasDisabledTextPaint
and is to have the paint uninstalled
-
uninstallHasDisabledTextPaintDefaults
Checks if the givenComponent
has theHasDisabledTextPaint
interface and will uninstall the disabledText paint if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations uninstalled
-
uninstallHasDisabledForegroundPaint
Uninstalls disabledForeground paint from the given Component- Parameters:
c
- TheComponent
thatHasDisabledForegroundPaint
and is to have the paint uninstalled
-
uninstallHasDisabledForegroundPaintDefaults
Checks if the givenComponent
has theHasDisabledForegroundPaint
interface and will uninstall the disabledForeground paint if the interface is present.- Parameters:
c
- TheComponent
that is to have customizations uninstalled
-
paintBackground
Paints the background for theComponent
using itsShapeInfo
(if it has it), and using its background paint (if it has it). If the background paint turns out to be null, the background will not be painted.
This method is to be used in the overridden update method of Component UI classes (where the background is normally painted)
-