All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bibliothek.util.workarounds.Workaround Maven / Gradle / Ivy

The newest version!
/*
 * Bibliothek - DockingFrames
 * Library built on Java/Swing, allows the user to "drag and drop"
 * panels containing any Swing-Component the developer likes to add.
 * 
 * Copyright (C) 2011 Benjamin Sigg
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Benjamin Sigg
 * [email protected]
 * CH - Switzerland
 */
package bibliothek.util.workarounds;

import java.awt.Component;
import java.awt.Shape;
import java.awt.Window;

import bibliothek.gui.DockController;
import bibliothek.util.Workarounds;

/**
 * A {@link Workaround} provides code to workaround an issue that is only present in some versions of the
 * JRE or in some libraries.
 * @author Benjamin Sigg
 */
public interface Workaround {
	/**
	 * Called whenever a new {@link DockController} is created, the {@link Workaround} may modify the controller in 
	 * any way it likes (e.g. install specialied factories).
	 * @param controller the {@link DockController} which was just created and initialized
	 */
	public void setup( DockController controller );
	
	/**
	 * Called for any {@link Component} which is used as glass pane (as invisible panel).
	 * @param component the component that is invisible
	 */
	public void markAsGlassPane( Component component );
	
	/**
	 * Tells whether this {@link Workaround} has the abbility to make window translucent.
	 * Translucent means that each pixel of the window can have its own alpha value.
	 * @param window the window to test
	 * @return whether translucency is an option
	 */
	public boolean supportsPerpixelTranslucency( Window window );
	
	/**
	 * Makes the window window translucent. See {@link Workarounds#setTranslucent(Window)} for a more
	 * detailed description.
	 * @param window the window that should be transparent
	 * @return whether translucency is supported for window
	 */
	public boolean setTranslucent( Window window );
	
	/**
	 * Tells whether this {@link Workaround} has the abbility to make window transparent.
	 * Transparent means that some pixels of the window cannot be seen.
	 * @param window the widnow to test
	 * @return whether transparency is an option
	 */
	public boolean supportsPerpixelTransparency( Window window );
	
	/**
	 * Makes the window window transparent in all the regions that are not inside shape.
	 * @param window the window that should be transparent
	 * @param shape the shape of the window, or null if the window should not be transparent
	 * @return whether transparency is supported for window
	 */
	public boolean setTransparent( Window window, Shape shape );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy