@Override
    public int getIndexOfChild(Object parent, Object child) {
        if ( parent.getClass() == SpritesFile.class ) {
            SpritesFile file = (SpritesFile)parent;
            
            for ( int i = 0 ; i < file.getMoveCount() ; i++ )
                if (child.equals(file.getMove(i)))return i;
        } else if ( parent instanceof MoveElement ){ 
            MoveElement move = (MoveElement)parent;
            for ( int i = 0 ; i < move.getSpriteCount(); i++)
                if (move.getSprite(i).equals(child))return i;
            
        }
        return -1;
    }