public void mouseReleased(MouseEvent evt)
    {
        boolean orderChanged = false;
        
        for (int i=0; i<slotList.size(); ++i)
        {            
            Slot slot = slotList.get(i);          
            
            if (!slot.isDragged())
                continue;
            if (insertBeforeSlotIndex >= 0)
            {
                orderChanged = true;
                animation.moveCell(i, insertBeforeSlotIndex);
                // TODO: do a command for this 
            }
        }       
        
        // relayout slots
        if (orderChanged)
        {
            setAnimation(animation);
        }

        for (int i=0; i<slotList.size(); ++i)
        {
            Slot slot = slotList.get(i);
            slot.setDragged(false);
        }

        if (orderChanged && insertBeforeSlotIndex < slotList.size())
                slotList.get(insertBeforeSlotIndex).setSelected(true);

        insertBeforeSlotIndex = -1;        
    }