Search in sources :

Example 1 with DraggablePanel

use of org.magic.game.gui.components.DraggablePanel in project MtgDesktopCompanion by nicho92.

the class CardTransfertHandler method exportDone.

@Override
protected void exportDone(JComponent c, Transferable data, int action) {
    DisplayableCard src = (DisplayableCard) c;
    if (action == TransferHandler.MOVE) {
        dragLab.setIcon(null);
        window.setVisible(false);
        if (c.getParent() instanceof DraggablePanel) {
            DraggablePanel dest = ((DraggablePanel) c.getParent());
            if (dest.getMousePosition() != null)
                src.setLocation(dest.getMousePosition());
            dest.postTreatment(src);
        }
    }
}
Also used : DraggablePanel(org.magic.game.gui.components.DraggablePanel) DisplayableCard(org.magic.game.gui.components.DisplayableCard)

Aggregations

DisplayableCard (org.magic.game.gui.components.DisplayableCard)1 DraggablePanel (org.magic.game.gui.components.DraggablePanel)1