FileDocCategorySizeDatePackage
GhostGlassPane.javaAPI DocExample1109Mon Jan 09 11:02:00 GMT 2006None

GhostGlassPane

public class GhostGlassPane extends JPanel

Fields Summary
private AlphaComposite
composite
private BufferedImage
dragged
private Point
location
Constructors Summary
public GhostGlassPane()


     
    
        setOpaque(false);
        composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f);
    
Methods Summary
public voidpaintComponent(java.awt.Graphics g)

        if (dragged == null)
            return;

        Graphics2D g2 = (Graphics2D) g;
        g2.setComposite(composite);
        g2.drawImage(dragged,
                     (int) (location.getX() - (dragged.getWidth(this)  / 2)),
                     (int) (location.getY() - (dragged.getHeight(this) / 2)),
                     null);
    
public voidsetImage(java.awt.image.BufferedImage dragged)

        this.dragged = dragged;
    
public voidsetPoint(java.awt.Point location)

        this.location = location;