Interface TComponentUIUtil

All Known Implementing Classes:
TadukooButtonUI, TadukooLabelUI

public interface TComponentUIUtil
This interface provides utilities for TComponents - 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 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

      default SizablePaint getForegroundPaint()
      Returns:
      The SizablePaint to be used for the foreground from the Look & Feel
    • getForegroundPaint

      default Paint getForegroundPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the foreground paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the foreground - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • getBackgroundPaint

      default SizablePaint getBackgroundPaint()
      Returns:
      The SizablePaint to be used for the background from the Look & Feel
    • getBackgroundPaint

      default Paint getBackgroundPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the background paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the background - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • getShape

      default ShapeInfo getShape()
      Returns:
      The ShapeInfo to be used from the Look & Feel
    • getShape

      default ShapeInfo getShape(Component c)
      Parameters:
      c - A Component which may be Shaped
      Returns:
      The ShapeInfo from the Component if it has it, or from the Look & Feel otherwise
    • getSelectPaint

      default SizablePaint getSelectPaint()
      Returns:
      The SizablePaint to be used for when the Component is selected from the Look & Feel
    • getSelectPaint

      default Paint getSelectPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the select paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the select - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • getFocusPaint

      default SizablePaint getFocusPaint()
      Returns:
      The SizablePaint to be used for when the Component is focused from the Look & Feel
    • getFocusPaint

      default Paint getFocusPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the focus paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the focus - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • getDisabledTextPaint

      default SizablePaint getDisabledTextPaint()
      Returns:
      The SizablePaint to be used for disabled text on the Component from the Look & Feel
    • getDisabledTextPaint

      default Paint getDisabledTextPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the disabled text paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the disabled text - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • getDisabledForegroundPaint

      default SizablePaint getDisabledForegroundPaint()
      Returns:
      The SizablePaint to be used for disabled foreground on the Component from the Look & Feel
    • getDisabledForegroundPaint

      default Paint getDisabledForegroundPaint(Component c, Dimension size)
      Parameters:
      c - A Component which may have the disabled foreground paint on it
      size - The Dimensions of the surface to be painted
      Returns:
      The sized Paint for the disabled foreground - the SizablePaint used may come from the Component if it has it, or default to the Look & Feel's paint
    • installHasSizablePaints

      default void installHasSizablePaints(HasSizablePaints c)
      Installs foreground and background paint on the given Component
      Parameters:
      c - The Component that HasSizablePaints and is to have paints installed
    • installShaped

      default void installShaped(Shaped c)
      Installs shape info on the given Component
      Parameters:
      c - The Component that is Shaped and is to have shape info installed
    • installTComponent

      default void installTComponent(TComponent c)
      Installs the customizations associated with TComponent on the given Component, which are the foreground and background paints and the shape info.
      Parameters:
      c - The TComponent that is to have customizations installed
    • installTComponentDefaults

      default void installTComponentDefaults(Component c)
      Checks if the given Component has any of the custom interfaces present in TComponent and will install any customizations on it if it has those interfaces.
      Parameters:
      c - The Component that is to have customizations installed
    • installHasSelectAndFocusPaints

      default void installHasSelectAndFocusPaints(HasSelectAndFocusPaints c)
      Installs focus and select paint on the given Component
      Parameters:
      c - The Component that HasSelectAndFocusPaints and is to have paints installed
    • installHasSelectAndFocusPaintsDefaults

      default void installHasSelectAndFocusPaintsDefaults(Component c)
      Checks if the given Component has the HasSelectAndFocusPaints interface and will install the select and focus paints if the interface is present.
      Parameters:
      c - The Component that is to have customizations installed
    • installHasDisabledTextPaint

      default void installHasDisabledTextPaint(HasDisabledTextPaint c)
      Installs disabledText paint on the given Component
      Parameters:
      c - The Component that HasDisabledTextPaint and is to have the paint installed
    • installHasDisabledTextPaintDefaults

      default void installHasDisabledTextPaintDefaults(Component c)
      Checks if the given Component has the HasDisabledTextPaint interface and will install the disabledText paint if the interface is present.
      Parameters:
      c - The Component that is to have customizations installed
    • installHasDisabledForegroundPaint

      default void installHasDisabledForegroundPaint(HasDisabledForegroundPaint c)
      Installs disabledForeground paint on the given Component
      Parameters:
      c - The Component that HasDisabledForegroundPaint and is to have the paint installed
    • installHasDisabledForegroundPaintDefaults

      default void installHasDisabledForegroundPaintDefaults(Component c)
      Checks if the given Component has the HasDisabledForegroundPaint interface and will install the disabledForeground paint if the interface is present.
      Parameters:
      c - The Component that is to have customizations installed
    • uninstallHasSizablePaints

      default void uninstallHasSizablePaints(HasSizablePaints c)
      Uninstalls foreground and background paint from the given Component
      Parameters:
      c - The Component that HasSizablePaints and is to have paints uninstalled
    • uninstallShaped

      default void uninstallShaped(Shaped c)
      Uninstalls shape info from the given Component
      Parameters:
      c - The Component that is Shaped and is to have shape info uninstalled
    • uninstallTComponent

      default void uninstallTComponent(TComponent c)
      Uninstalls the customizations associated with TComponent from the given Component, which are the foreground and background paints and the shape info.
      Parameters:
      c - The TComponent that is to have customizations uninstalled
    • uninstallTComponentDefaults

      default void uninstallTComponentDefaults(Component c)
      Checks if the given Component has any of the custom interfaces present in TComponent and will uninstall any customizations from it if it has those interfaces.
      Parameters:
      c - The Component that is to have customizations uninstalled
    • uninstallHasSelectAndFocusPaints

      default void uninstallHasSelectAndFocusPaints(HasSelectAndFocusPaints c)
      Uninstalls select and focus paint from the given Component
      Parameters:
      c - The Component that HasSelectAndFocusPaints and is to have paints uninstalled
    • uninstallHasSelectAndFocusPaintsDefaults

      default void uninstallHasSelectAndFocusPaintsDefaults(Component c)
      Checks if the given Component has the HasSelectAndFocusPaints interface and will uninstall the select and focus paints if the interface is present.
      Parameters:
      c - The Component that is to have customizations uninstalled
    • uninstallHasDisabledTextPaint

      default void uninstallHasDisabledTextPaint(HasDisabledTextPaint c)
      Uninstalls disabledText paint from the given Component
      Parameters:
      c - The Component that HasDisabledTextPaint and is to have the paint uninstalled
    • uninstallHasDisabledTextPaintDefaults

      default void uninstallHasDisabledTextPaintDefaults(Component c)
      Checks if the given Component has the HasDisabledTextPaint interface and will uninstall the disabledText paint if the interface is present.
      Parameters:
      c - The Component that is to have customizations uninstalled
    • uninstallHasDisabledForegroundPaint

      default void uninstallHasDisabledForegroundPaint(HasDisabledForegroundPaint c)
      Uninstalls disabledForeground paint from the given Component
      Parameters:
      c - The Component that HasDisabledForegroundPaint and is to have the paint uninstalled
    • uninstallHasDisabledForegroundPaintDefaults

      default void uninstallHasDisabledForegroundPaintDefaults(Component c)
      Checks if the given Component has the HasDisabledForegroundPaint interface and will uninstall the disabledForeground paint if the interface is present.
      Parameters:
      c - The Component that is to have customizations uninstalled
    • paintBackground

      default void paintBackground(Graphics g, Component c)
      Paints the background for the Component using its ShapeInfo (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)
      Parameters:
      g - The Graphics to use to paint
      c - The Component to use for painting its background (potentially)