Class AbstractJWindowOverlayComponent

java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
javax.swing.JWindow
uk.co.caprica.vlcj.player.component.overlay.AbstractJWindowOverlayComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer

public abstract class AbstractJWindowOverlayComponent extends JWindow
Base implementation for a video overlay component.

Overlay contents may be implemented by using Swing/AWT components in a layout using onCreateOverlay(), and/or by implementing custom painting using onNewSize(int, int) and onPaintOverlay(Graphics2D).

Various template method are provided for sub-classes to provide the required behaviour.

The default implementation of the onSetWindowTransparency() template method attempts to make a transparent overlay by either the preferred method of simply setting the background colour to a transparent colour for Java7+, or by using com.sun.awt.AWTUtilities, if it exists, for Java6.

Best results will be obtained by disabling any compositing desktop window manager.

See Also:
  • Constructor Details

    • AbstractJWindowOverlayComponent

      public AbstractJWindowOverlayComponent(Window owner)
      Create an overlay.

      An "alpha-compatible" graphics configuration will be used when creating the window so as to enable a transparent overlay.

      Parameters:
      owner - owning window, must not be null
      Throws:
      IllegalArgumentException - if the owner parameter is null
    • AbstractJWindowOverlayComponent

      public AbstractJWindowOverlayComponent(Window owner, GraphicsConfiguration graphicsConfiguration)
      Create an overlay.
      Parameters:
      owner - owning window, must not be null
      graphicsConfiguration - graphics configuration to use when creating the Window
      Throws:
      IllegalArgumentException - if the owner parameter is null
  • Method Details