private void connectTo(AbstractUnit next, int posConn){
        if(selected instanceof IMultipuleOutputUnit){
            Object result = JOptionPane.showInputDialog(
                tulip.Tulip.mainFrame, 
                "Which connection?", 
                PropagatorUnit.lastConnectedUnit
            );

            if( result != null){
                try{
                    int n = Integer.parseInt((String) result);
                    PropagatorUnit.lastConnectedUnit = 
                            (PropagatorUnit.lastConnectedUnit+1 == n)?PropagatorUnit.lastConnectedUnit+1:n;
                    PropagatorUnit.lastConnectedUnit++;
                    if(n>-1 && n <((IMultipuleOutputUnit)selected).getNumberOfNext()){
                        ((IMultipuleOutputUnit)selected).setNextUnit(next, AbstractUnit.Operand.values()[posConn], n);
                        tulip.Tulip.mainFrame.getGrapPanel().repaint();
                    }
                }catch(NumberFormatException e1){
                }
            }
        }else{
            ((IOutputUnit)selected).setNextUnit(next, AbstractUnit.Operand.values()[posConn]);
            tulip.Tulip.mainFrame.getGrapPanel().repaint();
        }
    }