Class CustomizableDesktopPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class CustomizableDesktopPane extends JDesktopPane
A customized JDesktopPane that allows setting a customized background instead of the default one provided by Java.
Author:
scorbett
See Also:
  • Constructor Details

    • CustomizableDesktopPane

      public CustomizableDesktopPane(Gradient gradient)
      Creates a new CustomizableDesktopPane with the specified initial GradientConfig and no logo image. The GradientConfig can be modified later via setGradientConfig().
      Parameters:
      gradient - The GradientConfig to use initially for drawing the background.
    • CustomizableDesktopPane

      public CustomizableDesktopPane(BufferedImage image, CustomizableDesktopPane.LogoPlacement placement, float alpha, Gradient gradient)
      Creates a new CustomizableDesktopPane with the specified logo image and placement, and the specified initial GradientConfig. The GradientConfig can be modified later via setGradientConfig(), but the logo image cannot be changed once set.
      Parameters:
      image - The logo image to render in the background.
      placement - Where on the desktop the logo image should be rendered.
      alpha - The transparency value to use for the logo image (0=invisible, 1=opaque).
      gradient - The GradientConfig to use initially for drawing the background.
  • Method Details

    • setLogoImageTransparency

      public void setLogoImageTransparency(float alpha)
      Adjusts the transparency of the logo image, if a logo image is being shown.
      Parameters:
      alpha - The transparency value for the logo image (0=invisible, 1=opaque).
    • setGradientConfig

      public void setGradientConfig(Gradient conf)
      Sets the GradientConfig to use for drawing the desktop background.
      Parameters:
      conf - The new GradientConfig to use.
    • setLogoImagePlacement

      public void setLogoImagePlacement(CustomizableDesktopPane.LogoPlacement placement)
      Sets the LogoPlacement for use with the logo image.
      Parameters:
      placement - The new position for the logo image.
    • paintComponent

      public void paintComponent(Graphics g)
      Overridden to allow rendering of our custom desktop background.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - The Graphics object to use for rendering.