bibliothek.gui.dock.dockable.MovingImage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docking-frames-core Show documentation
Show all versions of docking-frames-core Show documentation
A window docking framework for Swing
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) 2007 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.gui.dock.dockable;
import java.awt.Component;
import java.awt.Point;
/**
* Moving images are used when a drag&drop operation is in progress, and
* an object has to be shown somehow on the screen.
* @author Benjamin Sigg
*
*/
public interface MovingImage {
/**
* Gets a Component which represents the {@link MovingImage}.
* This method must always return the same Component.
* @return always the same Component
*/
public Component getComponent();
/**
* Gest the preferred offset of this image in respect to the mouse.
* @param pressPoint the position of the mouse in respect to the element that was selected
* and that resulted in the creation of this image.
* @return the offset, or null
if a default offset should be used
*/
public Point getOffset( Point pressPoint );
/**
* Called before this image is displayed. The method should connect the
* image with other objects, like the object it represents.
* This method is never called twice in a row.
* @param transparency if true
, then the window showing this
* {@link Component} is transparent. If false
then the window
* is not transparent.
*/
public void bind( boolean transparency );
/**
* The reverse of {@link #bind(boolean)}. The image should remove any connections
* to other objects.
* This method is never called twice in a row.
*/
public void unbind();
}